diff --git a/.config/nvim/lua/dln/lsp-config.lua b/.config/nvim/lua/dln/lsp-config.lua index 2f376ef..12dc184 100644 --- a/.config/nvim/lua/dln/lsp-config.lua +++ b/.config/nvim/lua/dln/lsp-config.lua @@ -63,36 +63,36 @@ for _, lsp in ipairs(servers) do end local efm_prettier = { - formatCommand = "prettier --stdin-filepath ${INPUT}", - formatStdin = true + formatCommand = "prettier --stdin-filepath ${INPUT}", + formatStdin = true } lspconfig.sumneko_lua.setup { - cmd = {"lua-language-server", "-E", "/usr/share/lua-language-server/main.lua"}, - settings = { - Lua = { - completion = {kewordSnippet = "Disable"}, - diagnostics = { - enable = true, - globals = {"renoise", "use", "vim"} - }, - runtime = { - version = "LuaJIT", - path = {"?.lua", "?/init.lua", "?/?.lua"} - }, - workspace = { - library = { - [vim.fn.expand("$VIMRUNTIME/lua")] = true, - [vim.fn.expand("$VIMRUNTIME/lua/vim/lsp")] = true, - [vim.fn.stdpath("config") .. "/lua"] = true, - [vim.fn.stdpath("data") .. "/site/pack"] = true - }, - maxPreload = 2000, - preloadFileSize = 1000 - } - } - } + cmd = {"lua-language-server", "-E", "/usr/share/lua-language-server/main.lua"}, + settings = { + Lua = { + completion = {kewordSnippet = "Disable"}, + diagnostics = { + enable = true, + globals = {"renoise", "use", "vim"} + }, + runtime = { + version = "LuaJIT", + path = {"?.lua", "?/init.lua", "?/?.lua"} + }, + workspace = { + library = { + [vim.fn.expand("$VIMRUNTIME/lua")] = true, + [vim.fn.expand("$VIMRUNTIME/lua/vim/lsp")] = true, + [vim.fn.stdpath("config") .. "/lua"] = true, + [vim.fn.stdpath("data") .. "/site/pack"] = true + }, + maxPreload = 2000, + preloadFileSize = 1000 + } + } + } } lspconfig.yamlls.setup { diff --git a/.config/nvim/lua/dln/treesitter.lua b/.config/nvim/lua/dln/treesitter.lua index a5dd9c0..36fdc1e 100644 --- a/.config/nvim/lua/dln/treesitter.lua +++ b/.config/nvim/lua/dln/treesitter.lua @@ -1,73 +1,78 @@ require("nvim-treesitter.configs").setup { - ensure_installed = "maintained", - highlight = {enable = true}, - playground = { - enable = true, - disable = {}, - updatetime = 25, - persist_queries = false - }, + ensure_installed = "maintained", + highlight = { + enable = true, + use_languagetree = true, +}, - incremental_selection = { + + playground = { + enable = true, + disable = {}, + updatetime = 25, + persist_queries = false + }, + + incremental_selection = { + enable = true, + keymaps = { + init_selection = "ss", + node_incremental = "sq", + scope_incremental = "sd", + node_decremental = "sa", + }, + }, + + textobjects = { + move = { + enable = true, + goto_next_start = { + ["]]"] = "@function.outer", + ["]m"] = "@class.outer" + }, + goto_next_end = { + ["]["] = "@function.outer", + ["]M"] = "@class.outer" + }, + goto_previous_start = { + ["[["] = "@function.outer", + ["[m"] = "@class.outer" + }, + goto_previous_end = { + ["[]"] = "@function.outer", + ["[M"] = "@class.outer" + } + }, + select = { enable = true, keymaps = { - init_selection = "ss", - node_incremental = "sq", - scope_incremental = "sd", - node_decremental = "sa", - }, + -- You can use the capture groups defined in textobjects.scm + ["af"] = "@function.outer", + ["if"] = "@function.inner", + ["ac"] = "@class.outer", + ["ic"] = "@class.inner", + -- Or you can define your own textobjects like this + ["iF"] = { + python = "(function_definition) @function", + cpp = "(function_definition) @function", + c = "(function_definition) @function", + java = "(method_declaration) @function" + } + } }, - - textobjects = { - move = { - enable = true, - goto_next_start = { - ["]]"] = "@function.outer", - ["]m"] = "@class.outer" - }, - goto_next_end = { - ["]["] = "@function.outer", - ["]M"] = "@class.outer" - }, - goto_previous_start = { - ["[["] = "@function.outer", - ["[m"] = "@class.outer" - }, - goto_previous_end = { - ["[]"] = "@function.outer", - ["[M"] = "@class.outer" - } - }, - select = { - enable = true, - keymaps = { - -- You can use the capture groups defined in textobjects.scm - ["af"] = "@function.outer", - ["if"] = "@function.inner", - ["ac"] = "@class.outer", - ["ic"] = "@class.inner", - -- Or you can define your own textobjects like this - ["iF"] = { - python = "(function_definition) @function", - cpp = "(function_definition) @function", - c = "(function_definition) @function", - java = "(method_declaration) @function" - } - } - }, - swap = { - enable = true, - swap_next = { - ["l"] = "@parameter.inner" - }, - swap_previous = { - ["h"] = "@parameter.inner" - } - } - }, - --- nvim-ts-autotag --- - autotag = { - enable = true, - filetypes = {"html", "javascriptreact", "xml"} - } + swap = { + enable = true, + swap_next = { + ["l"] = "@parameter.inner" + }, + swap_previous = { + ["h"] = "@parameter.inner" + } + } + }, + --- nvim-ts-autotag --- + autotag = { + enable = true, + filetypes = {"html", "javascriptreact", "xml"} + } } diff --git a/.config/nvim/lua/init.lua b/.config/nvim/lua/init.lua index 35d035d..d9e4227 100644 --- a/.config/nvim/lua/init.lua +++ b/.config/nvim/lua/init.lua @@ -21,9 +21,9 @@ vim.o.listchars = 'extends:›,precedes:‹,nbsp:·,tab:→ ,trail:·' vim.wo.foldlevel = 99 vim.wo.linebreak = true vim.wo.list = true -vim.o.shiftwidth = 4 -vim.o.tabstop = 4 -vim.o.softtabstop = 4 +vim.o.shiftwidth = 2 +vim.o.tabstop = 2 +vim.o.softtabstop = 2 --- Search vim.cmd('set path+=**') diff --git a/.config/nvim/lua/plugins.lua b/.config/nvim/lua/plugins.lua index 9be00b3..31cd533 100644 --- a/.config/nvim/lua/plugins.lua +++ b/.config/nvim/lua/plugins.lua @@ -42,6 +42,7 @@ return require('packer').startup(function() end end + utils.mapx("is", "", "v:lua.complete('', '')") utils.mapx("is", "", "v:lua.complete('', '')") utils.mapx("is", "", "v:lua.complete('', '')") utils.mapx("x", "", "compe:#confirm('