diff options
author | Justine Smithies <justine@smithies.me.uk> | 2025-02-01 15:54:42 +0000 |
---|---|---|
committer | Justine Smithies <justine@smithies.me.uk> | 2025-02-01 15:54:42 +0000 |
commit | 6fe6bd334f8c006e6fc8fdf0c8a9a4181000be13 (patch) | |
tree | 4c91fcc95664ff640b6b926b7b0cbc9258f9ca7a /.config/nvim/lua | |
parent | 3fe8cfadba3c095565d30710be5e281780966e78 (diff) |
Initial commit of my revamped Neovim config
Diffstat (limited to '.config/nvim/lua')
25 files changed, 772 insertions, 0 deletions
diff --git a/.config/nvim/lua/config/autocmd.lua b/.config/nvim/lua/config/autocmd.lua new file mode 100644 index 0000000..b1facb8 --- /dev/null +++ b/.config/nvim/lua/config/autocmd.lua @@ -0,0 +1,31 @@ +local autocmd = vim.api.nvim_create_autocmd -- Create autocommand + +-- Remove end of buffer ~ on buffer enter +autocmd('BufEnter', { + pattern = '*', + command = "let &fcs='eob: '" +}) + +-- Turn off line numbers on entering terminal +autocmd('TermOpen', { + pattern = '*', + command = 'setlocal nonumber norelativenumber' +}) + +-- Insert mode on entering terminal +autocmd('TermOpen', { + pattern = '*', + command = 'startinsert' +}) + +-- Close terminal buffer on process exit +autocmd('BufLeave', { + pattern = 'term://*', + command = 'stopinsert' +}) + +-- Close terminal buffer on process exit +autocmd('TermClose', { + pattern = 'term://*', + command = 'call nvim_input("<CR>")' +}) diff --git a/.config/nvim/lua/config/globals.lua b/.config/nvim/lua/config/globals.lua new file mode 100644 index 0000000..2e2e702 --- /dev/null +++ b/.config/nvim/lua/config/globals.lua @@ -0,0 +1,2 @@ +vim.g.mapleader = " " +vim.g.maplocalleader = " " diff --git a/.config/nvim/lua/config/init.lua b/.config/nvim/lua/config/init.lua new file mode 100644 index 0000000..2b6e039 --- /dev/null +++ b/.config/nvim/lua/config/init.lua @@ -0,0 +1,44 @@ +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not vim.loop.fs_stat(lazypath) then + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", -- latest stable release + lazypath, + }) +end +vim.opt.rtp:prepend(lazypath) + +require('config.globals') +require('config.options') +require('config.keymaps') +require('config.autocmd') + +local opts = { + defaults = { + lazy = true, + }, + install = { + colorscheme = { "gruvbox" } + }, + rtp = { + disabled_plugins = { + "gzip", + "matchit", + "matchparen", + "netrw", + "netrwPlugin", + "tarPlugin", + "tohtml", + "tutor", + "zipPlugin", + } + }, + change_detection = { + notify = true + }, +} + +require("lazy").setup('plugins', opts) diff --git a/.config/nvim/lua/config/keymaps.lua b/.config/nvim/lua/config/keymaps.lua new file mode 100644 index 0000000..363f8bc --- /dev/null +++ b/.config/nvim/lua/config/keymaps.lua @@ -0,0 +1,27 @@ +local keymap = vim.keymap + +local opts = { noremap = true, silent = true } + +-- DIRECTORY NAVIGATION ------------------------------------------------------ +keymap.set("n", "<leader>m", ":NvimTreeFocus<CR>", opts) +keymap.set("n", "<leader>f", ":NvimTreeToggle<CR> :NvimTreeRefresh<CR>", { silent = true }) +keymap.set("n", "<C-k>", "<C-w>k", opts) -- NAVIGATE [^] UP +keymap.set("n", "<C-h>", "<C-w>h", opts) -- NAVIGATE [<] LEFT +keymap.set("n", "<C-l>", "<C-w>l", opts) -- NAVIGATE [>] RIGHT +keymap.set("n", "<C-j>", "<C-w>j", opts) -- NAVIGATE [v] DOWN + +-- WINDOW MANAGEMENT --------------------------------------------------------- +keymap.set("n", "<leader>sv", ":vsplit<CR>", opts) -- SPLIT VERTICALLY +keymap.set("n", "<leader>sh", ":split<CR>", opts) -- SPLIT HORIZONTALLY + +-- INDENT -------------------------------------------------------------------- +keymap.set("v", "<", "<gv") +keymap.set("v", ">", ">gv") + +-- COMMENTS ------------------------------------------------------------------ +vim.api.nvim_set_keymap("n", "<C-c>", "gcc", { noremap = false }) +vim.api.nvim_set_keymap("v", "<C-c>", "gcc", { noremap = false }) + +-- MOVE SELECTED LINES --------------------------------------------------------- +vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv") +vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv") diff --git a/.config/nvim/lua/config/options.lua b/.config/nvim/lua/config/options.lua new file mode 100644 index 0000000..dbd8e66 --- /dev/null +++ b/.config/nvim/lua/config/options.lua @@ -0,0 +1,51 @@ +-- disable netrw at the very start of your init.lua -------------------------- +vim.g.loaded_netrw = 1 +vim.g.loaded_netrwPlugin = 1 + +local opt = vim.opt + +-- TAB/INDENT ---------------------------------------------------------------- +opt.tabstop = 2 +opt.shiftwidth = 2 +opt.softtabstop = 2 +opt.expandtab = true +opt.smartindent = true +opt.wrap = false + +-- SEARCH -------------------------------------------------------------------- +opt.incsearch = true +opt.ignorecase = true +opt.smartcase = true +opt.hlsearch = false + +-- APPEARANCE ---------------------------------------------------------------- +opt.number = true +opt.relativenumber = false +opt.termguicolors = true +--opt.colorcolumn = "100" +opt.signcolumn = "yes" +opt.cmdheight = 1 +opt.scrolloff = 10 +opt.completeopt = "menuone,noinsert,noselect" +opt.cursorline = true -- Highlight the active cursor line + +-- MISC ---------------------------------------------------------------------- +opt.hidden = true +opt.errorbells = false +opt.swapfile = false +opt.backup = false +opt.undodir = vim.fn.expand("~/.config/nvim/undodir//") +opt.undofile = true +opt.backspace = "indent,eol,start" +opt.splitright = true +opt.splitbelow = true +opt.autochdir = false +opt.modifiable = true +opt.encoding = "UTF-8" +opt.guicursor = "n-v-c:block,i-ci-ve:block,r-cr:hor20,o:hor50,a:blinkwait700-blinkoff400-blinkon250-Cursor/lCursor,sm:block-blinkwait175-blinkoff150-blinkon175" +opt.termguicolors = true + +-- APPEND -------------------------------------------------------------------- +opt.mouse:append('a') +opt.iskeyword:append("-") +opt.clipboard:append("unnamedplus") diff --git a/.config/nvim/lua/plugins/alpha.lua b/.config/nvim/lua/plugins/alpha.lua new file mode 100644 index 0000000..acec7c6 --- /dev/null +++ b/.config/nvim/lua/plugins/alpha.lua @@ -0,0 +1,125 @@ +return { + "goolord/alpha-nvim", + event = "VimEnter", + config = function() +local dashboard = require('alpha.themes.dashboard') +local fortune = require('alpha.fortune') + +local logo = { + type = 'text', + val = { + ' ', + ' ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ ', + ' ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ ', + ' ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ ', + ' ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ ', + ' ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ ', + ' ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ ', + }, + opts = { + position = 'center', + hl = 'DevIconDart', + }, +} + +local function info_value() + local total_plugins = " Total plugins " .. vim.fn.len(vim.fn.globpath("~/.local/share/nvim/lazy", "*", 0, 1)) + local datetime = os.date(' %d-%m-%Y') + local version = vim.version() + local nvim_version_info = ' v' .. version.major .. '.' .. version.minor .. '.' .. version.patch + + return datetime .. nvim_version_info .. ' ' .. total_plugins +end + +local info = { + type = 'text', + val = info_value(), + opts = { + hl = 'DevIconVimrc', + position = 'center', + }, +} + +local message = { + type = 'text', + val = fortune({ max_width = 60 }), + opts = { + position = 'center', + hl = 'SpecialComment', + }, +} + +local header = { + type = 'group', + val = { + logo, + info, + }, +} + +local buttons = { + type = 'group', + val = { + { + type = 'text', + val = 'Actions', + opts = { + hl = 'String', + shrink_margin = false, + position = 'center', + }, + }, + { type = 'padding', val = 1 }, + dashboard.button("f", " " .. " Find file", ":Telescope find_files hidden=true no_ignore=true <CR>"), + dashboard.button("e", " " .. " New file", ":ene <BAR> startinsert <CR>"), + dashboard.button("r", " " .. " Recent files", ":Telescope oldfiles <CR>"), + dashboard.button("t", " " .. " Find text", "<cmd>lua require('telescope.builtin').live_grep({shorten_path=true})<CR>"), + dashboard.button( + 'd', + ' Dotfiles', + "<cmd>lua require('telescope.builtin').find_files({ search_dirs = { os.getenv('HOME') .. '/.config' } })<CR>" + ), + dashboard.button("l", " " .. " Lazy plugins", ":Lazy<CR>"), + dashboard.button("q", " " .. " Quit", ":qa<CR>"), + }, + opts = { + position = 'center', + }, +} + +local config = { + layout = { + { type = 'padding', val = 5 }, + header, + { type = 'padding', val = 2 }, + buttons, + { type = 'padding', val = 1 }, + message, + }, + opts = { + setup = function() + vim.api.nvim_create_autocmd('User', { + pattern = 'AlphaReady', + desc = 'disable status, tabline and cmdline for alpha', + callback = function() + vim.go.laststatus = 0 + vim.opt.showtabline = 0 + vim.opt.cmdheight = 0 + end, + }) + vim.api.nvim_create_autocmd('BufUnload', { + buffer = 0, + desc = 'enable status, tabline and cmdline after alpha', + callback = function() + vim.go.laststatus = 2 + vim.opt.showtabline = 2 + vim.opt.cmdheight = 1 + end, + }) + end, + margin = 5, + }, +} + require("alpha").setup(config) + end, +} diff --git a/.config/nvim/lua/plugins/colorizer.lua b/.config/nvim/lua/plugins/colorizer.lua new file mode 100644 index 0000000..38d8c62 --- /dev/null +++ b/.config/nvim/lua/plugins/colorizer.lua @@ -0,0 +1,10 @@ +return { + "norcalli/nvim-colorizer.lua", + event = { "BufNewFile", "BufReadPost", "BufWritePost" }, + opts = { + css = { css = true }, + "javascript", + "html", + "lua", + }, +} diff --git a/.config/nvim/lua/plugins/comment.lua b/.config/nvim/lua/plugins/comment.lua new file mode 100644 index 0000000..e6b597d --- /dev/null +++ b/.config/nvim/lua/plugins/comment.lua @@ -0,0 +1,7 @@ +return { + 'numToStr/Comment.nvim', + opts = { + -- add any options here + }, + lazy = false, +} diff --git a/.config/nvim/lua/plugins/gruvbox.lua b/.config/nvim/lua/plugins/gruvbox.lua new file mode 100644 index 0000000..5779f5e --- /dev/null +++ b/.config/nvim/lua/plugins/gruvbox.lua @@ -0,0 +1,32 @@ +return { + "ellisonleao/gruvbox.nvim", + lazy = false, + priority = 999, + config = function() + require("gruvbox").setup({ + undercurl = true, + underline = true, + bold = true, + italic = { + strings = true, + emphasis = true, + comments = true, + operators = false, + folds =true, + }, + strikethrough = true, + invert_selection = false, + invert_signs = false, + invert_tabline = false, + invert_intend_guides = false, + inverse = true, -- invert background for search, diffs, statuslines and errors + contrast = "", -- can be "hard", "soft" or empty string + palette_overrides = {}, + overrides = {}, + dim_inactive = false, + transparent_mode = false, + }) + vim.cmd('colorscheme gruvbox') + vim.api.nvim_set_hl(0, "Normal", {guibg = NONE, ctermbg = NONE}) + end +} diff --git a/.config/nvim/lua/plugins/indent-blankline.lua b/.config/nvim/lua/plugins/indent-blankline.lua new file mode 100644 index 0000000..423131f --- /dev/null +++ b/.config/nvim/lua/plugins/indent-blankline.lua @@ -0,0 +1,5 @@ +return { + "lukas-reineke/indent-blankline.nvim", + main = "ibl", + opts = {} +} diff --git a/.config/nvim/lua/plugins/init.lua b/.config/nvim/lua/plugins/init.lua new file mode 100644 index 0000000..cfbdc56 --- /dev/null +++ b/.config/nvim/lua/plugins/init.lua @@ -0,0 +1,4 @@ +return { + { "folke/neoconf.nvim", cmd = "Neoconf" }, + "folke/neodev.nvim", +} diff --git a/.config/nvim/lua/plugins/lualine-nvim.lua b/.config/nvim/lua/plugins/lualine-nvim.lua new file mode 100644 index 0000000..69ebb1c --- /dev/null +++ b/.config/nvim/lua/plugins/lualine-nvim.lua @@ -0,0 +1,62 @@ +local config = function() + require("lualine").setup({ + options = { + icons_enabled = true, + theme = 'powerline', + component_separators = { left = '', right = ''}, + section_separators = { left = '', right = ''}, + disabled_filetypes = { 'Lazy', 'NvimTree', 'alpha', + statusline = {}, + winbar = {}, + }, + ignore_focus = {}, + always_divide_middle = true, + -- always_show_tabline = false, + globalstatus = false, + refresh = { + statusline = 1000, + tabline = 1000, + winbar = 1000, + } + }, + sections = { + lualine_a = {'mode'}, + lualine_b = {'branch', 'diff', 'diagnostics'}, + lualine_c = {'filename'}, + lualine_x = {'encoding', 'fileformat', 'filetype'}, + lualine_y = {'progress'}, + lualine_z = {'location'} + }, + inactive_sections = { + lualine_a = {}, + lualine_b = {}, + lualine_c = {'filename'}, + lualine_x = {'location'}, + lualine_y = {}, + lualine_z = {} + }, + tabline = { + lualine_a = { + { 'buffers', + symbols = { + modified = ' ●', -- Text to show when the buffer is modified + alternate_file = '', -- Text to show to identify the alternate filename + directory = '', -- Text to show when the buffer is a directory + }, + filetype_names = { + NvimTree = 'NvimTree', + }, -- Shows specific buffer name for that filetype ( { `filetype` = `buffer_name`, ... } ) + }, + }, +}, + winbar = {}, + inactive_winbar = {}, + extensions = {}, + }) +end + +return { + "nvim-lualine/lualine.nvim", + lazy = false, + config = config, +} diff --git a/.config/nvim/lua/plugins/mason-lspconfig.lua b/.config/nvim/lua/plugins/mason-lspconfig.lua new file mode 100644 index 0000000..55d3a7e --- /dev/null +++ b/.config/nvim/lua/plugins/mason-lspconfig.lua @@ -0,0 +1,13 @@ +local opts = { + ensure_installed = { + "pyright", + }, + automatic_installation = true, +} + +return { + "williamboman/mason-lspconfig.nvim", + opts = opts, + event = "BufReadPre", + dependencies = "williamboman/mason.nvim", +} diff --git a/.config/nvim/lua/plugins/mason.lua b/.config/nvim/lua/plugins/mason.lua new file mode 100644 index 0000000..73a3004 --- /dev/null +++ b/.config/nvim/lua/plugins/mason.lua @@ -0,0 +1,14 @@ +return { + "williamboman/mason.nvim", + cmd = "Mason", + event = "BufReadPre", + opts = { + ui = { + icons = { + package_installed = "✓", + package_pending = "➜", + package_uninstalled = "✗", + } + } + } +} diff --git a/.config/nvim/lua/plugins/noice.lua b/.config/nvim/lua/plugins/noice.lua new file mode 100644 index 0000000..52cf93b --- /dev/null +++ b/.config/nvim/lua/plugins/noice.lua @@ -0,0 +1,19 @@ +return { + "folke/noice.nvim", + event = "VeryLazy", + opts = { + routes = { + { + view = "notify", + filter = { event = "msg_showmode" }, + }, + }, + }, + dependencies = { + -- if you lazy-load any plugin below, make sure to add proper `module="..."` entries + "MunifTanjim/nui.nvim", + -- OPTIONAL: + -- `nvim-notify` is only needed, if you want to use the notification view. + -- If not available, we use `mini` as the fallback + }, +} diff --git a/.config/nvim/lua/plugins/nvim-cmp.lua b/.config/nvim/lua/plugins/nvim-cmp.lua new file mode 100644 index 0000000..dc06f47 --- /dev/null +++ b/.config/nvim/lua/plugins/nvim-cmp.lua @@ -0,0 +1,54 @@ + return { + "hrsh7th/nvim-cmp", + config = function() + local cmp = require("cmp") + local luasnip = require("luasnip") + local lspkind = require("lspkind") + + require("luasnip/loaders/from_vscode").lazy_load() + + vim.opt.completeopt = "menu,menuone,noselect" + + cmp.setup({ + snippet = { + expand = function(args) + luasnip.lsp_expand(args.body) + end, + }, + mapping = cmp.mapping.preset.insert({ + ["<C-k>"] = cmp.mapping.select_prev_item(), -- previous suggestion + ["<C-j>"] = cmp.mapping.select_next_item(), -- next suggestion + ["<C-b>"] = cmp.mapping.scroll_docs(-4), + ["<C-f>"] = cmp.mapping.scroll_docs(4), + ["<C-Space>"] = cmp.mapping.complete(), -- show completion suggestions + ["<C-e>"] = cmp.mapping.abort(), -- close completion window + ["<CR>"] = cmp.mapping.confirm({ select = false }), + }), + -- sources for autocompletion + sources = cmp.config.sources({ + { name = "nvim_lsp" }, -- lsp + { name = "luasnip" }, -- snippets + { name = "buffer" }, -- text within current buffer + { name = "path" }, -- file system paths + }), + -- configure lspkind for vs-code like icons + formatting = { + format = lspkind.cmp_format({ + maxwidth = 50, + ellipsis_char = "...", + }), + }, + }) + end, + dependencies = { + "onsails/lspkind.nvim", + { + + "L3MON4D3/LuaSnip", + -- follow latest release. + version = "2.*", -- Replace <CurrentMajor> by the latest released major (first number of latest release) + -- install jsregexp (optional!). + build = "make install_jsregexp", + }, + }, +} diff --git a/.config/nvim/lua/plugins/nvim-lspconfig.lua b/.config/nvim/lua/plugins/nvim-lspconfig.lua new file mode 100644 index 0000000..267ecf6 --- /dev/null +++ b/.config/nvim/lua/plugins/nvim-lspconfig.lua @@ -0,0 +1,131 @@ +local config = function() + require("neoconf").setup({}) + local cmp_nvim_lsp = require("cmp_nvim_lsp") + local lspconfig = require("lspconfig") + + local capabilities = cmp_nvim_lsp.default_capabilities() + + -- lua + -- lspconfig.lua_ls.setup({ + -- capabilities = capabilities, + -- on_attach = on_attach, + -- settings = { -- custom settings for lua + -- Lua = { + -- -- make the language server recognize "vim" global + -- diagnostics = { + -- globals = { "vim" }, + -- }, + -- workspace = { + -- -- make language server aware of runtime files + -- library = { + -- [vim.fn.expand("$VIMRUNTIME/lua")] = true, + -- [vim.fn.stdpath("config") .. "/lua"] = true, + -- }, + -- }, + -- }, + -- }, + -- }) + + -- python + lspconfig.pyright.setup({ + capabilities = capabilities, + on_attach = on_attach, + settings = { + pyright = { + disableOrganizeImports = false, + analysis = { + useLibraryCodeForTypes = true, + autoSearchPaths = true, + diagnosticMode = "workspace", + autoImportCompletions = true, + }, + }, + }, + }) + + -- bash + lspconfig.bashls.setup({ + capabilities = capabilities, + on_attach = on_attach, + filetypes = { "sh" }, + }) + + -- docker + lspconfig.dockerls.setup({ + capabilities = capabilities, + on_attach = on_attach, + }) + + -- local luacheck = require("efmls-configs.linters.luacheck") + -- local stylua = require("efmls-configs.formatters.stylua") + -- local flake8 = require("efmls-configs.linters.flake8") + -- local black = require("efmls-configs.formatters.black") + -- local eslint_d = require("efmls-configs.linters.eslint_d") + -- local prettierd = require("efmls-configs.formatters.prettier_d") + -- local fixjson = require("efmls-configs.formatters.fixjson") + -- local shellcheck = require("efmls-configs.linters.shellcheck") + -- local shfmt = require("efmls-configs.formatters.shfmt") + -- local alex = require("efmls-configs.linters.alex") + -- local hadolint = require("efmls-configs.linters.hadolint") + -- local solhint = require("efmls-configs.linters.solhint") + + -- configure efm server +-- lspconfig.efm.setup({ +-- filetypes = { +-- "lua", +-- "python", +-- "json", +-- "jsonc", +-- "sh", +-- "javascript", +-- "javascriptreact", +-- "typescript", +-- "typescriptreact", +-- "svelte", +-- "vue", +-- "markdown", +-- "docker", +-- "solidity", +-- }, +-- init_options = { +-- documentFormatting = true, +-- documentRangeFormatting = true, +-- hover = true, +-- documentSymbol = true, +-- codeAction = true, +-- completion = true, +-- }, +-- settings = { +-- languages = { +-- lua = { luacheck, stylua }, +-- python = { flake8, black }, +-- typescript = { eslint_d, prettierd }, +-- json = { eslint_d, fixjson }, +-- jsonc = { eslint_d, fixjson }, +-- sh = { shellcheck, shfmt }, +-- javascript = { eslint_d, prettierd }, +-- javascriptreact = { eslint_d, prettierd }, +-- typescriptreact = { eslint_d, prettierd }, +-- svelte = { eslint_d, prettierd }, +-- vue = { eslint_d, prettierd }, +-- markdown = { alex, prettierd }, +-- docker = { hadolint, prettierd }, +-- solidity = { solhint }, +-- }, +-- }, +-- }) +end + +return { + "neovim/nvim-lspconfig", + config = config, + lazy = false, + dependencies = { + "windwp/nvim-autopairs", + "williamboman/mason.nvim", + -- "creativenull/efmls-configs-nvim", + "hrsh7th/nvim-cmp", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-nvim-lsp", + }, +} diff --git a/.config/nvim/lua/plugins/nvim-tree.lua b/.config/nvim/lua/plugins/nvim-tree.lua new file mode 100644 index 0000000..af2f4a6 --- /dev/null +++ b/.config/nvim/lua/plugins/nvim-tree.lua @@ -0,0 +1,23 @@ +return { + "nvim-tree/nvim-tree.lua", + lazy = false, + dependencies = { + "nvim-tree/nvim-web-devicons", + }, + config = function() + local autocmd = vim.api.nvim_create_autocmd -- Create autocommand + + -- Close nvim-tree if last window remaining + autocmd('BufEnter', { + pattern = '*', + command = 'if (winnr("$") ==1 && &filetype == "nvimtree") | q | endif' + }) + vim.cmd([[hi NvimTreeNormal guibg=NONE ctermbg=None]]) + -- vim.keymap.set("n", "<leader>nt", ":NvimTreeToggle<CR>", {}) + require("nvim-tree").setup({ + filters = { + dotfiles = false, + }, + }) + end, +} diff --git a/.config/nvim/lua/plugins/nvim-treesitter.lua b/.config/nvim/lua/plugins/nvim-treesitter.lua new file mode 100644 index 0000000..d6b09b6 --- /dev/null +++ b/.config/nvim/lua/plugins/nvim-treesitter.lua @@ -0,0 +1,52 @@ +local config = function() + require("nvim-treesitter.configs").setup({ + build = ":TSUpdate", + indent = { + enable = true, + }, + autotag = { + enable = true, + }, + event = { + "BufReadPre", + "BufNewFile", + }, + ensure_installed = { + "markdown", + "json", + "javascript", + "typescript", + "yaml", + "html", + "css", + "markdown", + "bash", + "lua", + "dockerfile", + "solidity", + "gitignore", + "python", + "vue", + }, + auto_install = true, + highlight = { + enable = true, + additional_vim_regex_highlighting = true, + }, + incremental_selection = { + enable = true, + keymaps = { + init_selection = "<C-s>", + node_incremental = "<C-s>", + scope_incremental = false, + node_decremental = "<BS>", + }, + }, + }) +end + +return { + "nvim-treesitter/nvim-treesitter", + lazy = false, + config = config, +} diff --git a/.config/nvim/lua/plugins/nvim-ts-autotag.lua b/.config/nvim/lua/plugins/nvim-ts-autotag.lua new file mode 100644 index 0000000..e3840e0 --- /dev/null +++ b/.config/nvim/lua/plugins/nvim-ts-autotag.lua @@ -0,0 +1,4 @@ +return { + "windwp/nvim-ts-autotag", + lazy = false, +} diff --git a/.config/nvim/lua/plugins/nvim-web-devicons.lua b/.config/nvim/lua/plugins/nvim-web-devicons.lua new file mode 100644 index 0000000..537b4f5 --- /dev/null +++ b/.config/nvim/lua/plugins/nvim-web-devicons.lua @@ -0,0 +1,3 @@ +return { + 'nvim-tree/nvim-web-devicons' +} diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua new file mode 100644 index 0000000..6922599 --- /dev/null +++ b/.config/nvim/lua/plugins/telescope.lua @@ -0,0 +1,45 @@ +local keymap = vim.keymap + +local config = function() + local telescope = require("telescope") + telescope.setup({ + defaults = { + mappings = { + i = { + ["<C-j>"] = "move_selection_next", + ["<C-k>"] = "move_selection_previous", + }, + }, + }, + pickers = { + find_files = { + theme = "dropdown", + previewer = false, + hidden = true, + }, + live_grep = { + theme = "dropdown", + previewer = false, + }, + buffers = { + theme = "dropdown", + previewer = false, + }, + }, + }) +end + +return { + "nvim-telescope/telescope.nvim", + tag = "0.1.8", + lazy = false, + dependencies = { "nvim-lua/plenary.nvim" }, + config = config, + keys = { + keymap.set("n", "<leader>fk", ":Telescope keymaps<CR>"), + keymap.set("n", "<leader>fh", ":Telescope help_tags<CR>"), + keymap.set("n", "<leader>ff", ":Telescope find_files<CR>"), + keymap.set("n", "<leader>fg", ":Telescope live_grep<CR>"), + keymap.set("n", "<leader>fb", ":Telescope buffers<CR>"), + }, +} diff --git a/.config/nvim/lua/plugins/vim-highlightedyank.lua b/.config/nvim/lua/plugins/vim-highlightedyank.lua new file mode 100644 index 0000000..b2ad788 --- /dev/null +++ b/.config/nvim/lua/plugins/vim-highlightedyank.lua @@ -0,0 +1,4 @@ +return { + "machakann/vim-highlightedyank", + lazy = false +} diff --git a/.config/nvim/lua/plugins/vim-illuminate.lua b/.config/nvim/lua/plugins/vim-illuminate.lua new file mode 100644 index 0000000..7b34f92 --- /dev/null +++ b/.config/nvim/lua/plugins/vim-illuminate.lua @@ -0,0 +1,7 @@ +return { + "RRethy/vim-illuminate", + lazy = false, + config = function() + require('illuminate').configure({}) + end +} diff --git a/.config/nvim/lua/plugins/whichkey.lua b/.config/nvim/lua/plugins/whichkey.lua new file mode 100644 index 0000000..d813580 --- /dev/null +++ b/.config/nvim/lua/plugins/whichkey.lua @@ -0,0 +1,3 @@ +return { + "folke/which-key.nvim", +} |