aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAriel D'ALessandro <dalessandro.ariel@gmail.com>2021-08-18 07:06:27 +0200
committerAriel D'ALessandro <dalessandro.ariel@gmail.com>2021-08-18 07:06:27 +0200
commit7816050708b589abf4d5765980e5a109d91ada98 (patch)
tree1df04e669ffe0d8d6b3b7f9c76b4705079de4c56
parentf9f6c482a15e9917d5a1d91122321303e001e8b9 (diff)
downloadnvim-conf-7816050708b589abf4d5765980e5a109d91ada98.tar.gz
nvim-conf-7816050708b589abf4d5765980e5a109d91ada98.zip
add treesitter plugins
-rw-r--r--lua/plugins.lua17
-rw-r--r--plugin/lsp.vim20
-rw-r--r--plugin/packer_compiled.lua12
-rw-r--r--plugin/treesitter.vim23
4 files changed, 65 insertions, 7 deletions
diff --git a/lua/plugins.lua b/lua/plugins.lua
index 548b69b..f9b0132 100644
--- a/lua/plugins.lua
+++ b/lua/plugins.lua
@@ -1,6 +1,8 @@
vim.cmd [[packadd packer.nvim]]
return require('packer').startup(function()
+ use 'wbthomason/packer.nvim'
+
use {
'ThePrimeagen/refactoring.nvim',
requires = {
@@ -12,6 +14,19 @@ return require('packer').startup(function()
use { 'nvim-treesitter/nvim-treesitter', run = ':TSUpdate' }
use { 'nvim-treesitter/playground' }
+ use { 'nvim-treesitter/nvim-treesitter-refactor' }
+ use { 'nvim-treesitter/nvim-treesitter-textobjects' }
+
+ use {
+ "folke/twilight.nvim",
+ config = function()
+ require("twilight").setup {
+ -- your configuration comes here
+ -- or leave it empty to use the default settings
+ -- refer to the configuration section below
+ }
+ end
+ }
use { 'tpope/vim-dispatch', opt = true, cmd = {'Dispatch', 'Make', 'Focus', 'Start'}}
@@ -21,7 +36,7 @@ return require('packer').startup(function()
'neovim/nvim-lspconfig',
requires = {
{ 'hrsh7th/nvim-compe' },
- { 'anott03/nvim-lspinstall' }
+ { 'kabouzeid/nvim-lspinstall' }
}
}
diff --git a/plugin/lsp.vim b/plugin/lsp.vim
index 02b57a1..00f9103 100644
--- a/plugin/lsp.vim
+++ b/plugin/lsp.vim
@@ -59,8 +59,20 @@ lua << EOF
local function on_attach()
vim.api.nvim_set_keymap('n', 'K', ':lua vim.lsp.buf.hover()<cr>', {noremap = true})
end
-require'lspconfig'.tsserver.setup{ on_attach=on_attach }
-require'lspconfig'.intelephense.setup{ on_attach=on_attach }
-require'lspconfig'.gopls.setup{ on_attach=on_attach }
-require'lspconfig'.sumneko_lua.setup{ on_attach=on_attach }
+
+local function setup_servers()
+ require'lspinstall'.setup()
+ local servers = require'lspinstall'.installed_servers()
+ for _, server in pairs(servers) do
+ require'lspconfig'[server].setup{ on_attach=on_attach}
+ end
+end
+
+setup_servers()
+
+require'lspinstall'.post_install_hook = function ()
+ setup_servers()
+ vim.cmd("bufdo e")
+end
+
EOF
diff --git a/plugin/packer_compiled.lua b/plugin/packer_compiled.lua
index f3d87e2..e2f302d 100644
--- a/plugin/packer_compiled.lua
+++ b/plugin/packer_compiled.lua
@@ -109,10 +109,18 @@ _G.packer_plugins = {
loaded = true,
path = "/home/alpha/.local/share/nvim/site/pack/packer/start/nvim-treesitter"
},
+ ["nvim-treesitter-refactor"] = {
+ loaded = true,
+ path = "/home/alpha/.local/share/nvim/site/pack/packer/start/nvim-treesitter-refactor"
+ },
["nvim-web-devicons"] = {
loaded = true,
path = "/home/alpha/.local/share/nvim/site/pack/packer/start/nvim-web-devicons"
},
+ ["packer.nvim"] = {
+ loaded = true,
+ path = "/home/alpha/.local/share/nvim/site/pack/packer/start/packer.nvim"
+ },
playground = {
loaded = true,
path = "/home/alpha/.local/share/nvim/site/pack/packer/start/playground"
@@ -178,7 +186,7 @@ _G.packer_plugins = {
["vim-http"] = {
commands = { "Http" },
loaded = false,
- needs_bufread = false,
+ needs_bufread = true,
path = "/home/alpha/.local/share/nvim/site/pack/packer/opt/vim-http"
},
["vim-kitty"] = {
@@ -232,7 +240,7 @@ _G.packer_plugins = {
vimwiki = {
commands = { "VimwikiIndex" },
loaded = false,
- needs_bufread = false,
+ needs_bufread = true,
path = "/home/alpha/.local/share/nvim/site/pack/packer/opt/vimwiki"
}
}
diff --git a/plugin/treesitter.vim b/plugin/treesitter.vim
index 9bf42b2..b6bbd03 100644
--- a/plugin/treesitter.vim
+++ b/plugin/treesitter.vim
@@ -8,6 +8,29 @@ require "nvim-treesitter.configs".setup {
indent = {
enable = true,
},
+ refactor = {
+ highlight_definitions = { enable = true },
+ smart_rename = {
+ enable = true,
+ keymaps = {
+ smart_rename = "grr",
+ },
+ },
+ },
+ textobjects = {
+ select = {
+ enable = true,
+ lookahead = true,
+ keymaps = {
+ ["af"] = "@function.outer",
+ ["if"] = "@function.inner",
+ ["ac"] = "@conditional.outer",
+ ["ic"] = "@conditional.inner",
+ ["al"] = "@loop.outer",
+ ["il"] = "@loop.inner",
+ }
+ }
+ },
playground = {
enable = true,
disable = {},