add lspconfig comp treesitter

This commit is contained in:
nganhkhoa 2021-07-11 18:56:45 +00:00
parent b84629bef7
commit fed4931d42
3 changed files with 27 additions and 2 deletions

View File

@ -1,6 +1,5 @@
(module user.config (module user.config
{require {nvim aniseed.nvim {require {nvim aniseed.nvim}})
nu aniseed.nvim.util}})
(defn- noremap [mode from to] (defn- noremap [mode from to]
"Sets a mapping with {:noremap true}." "Sets a mapping with {:noremap true}."
@ -66,3 +65,4 @@
(require "plugins") (require "plugins")
(require "settings") (require "settings")
(require "lsp")

21
fnl/lsp.fnl Normal file
View File

@ -0,0 +1,21 @@
(module user.lsp
{require {nvim aniseed.nvim}})
(global lspconfig (require :lspconfig))
(global treesitter (require :nvim-treesitter.configs))
(nvim.set_keymap "" :gd "<cmd>lua vim.lsp.buf.definition()<CR>" {:silent true :noremap true})
(nvim.set_keymap "" :gh "<cmd>lua vim.lsp.buf.hover()<CR>" {:silent true :noremap true})
(nvim.set_keymap "" :gi "<cmd>lua vim.lsp.buf.implementation()<CR>" {:silent true :noremap true})
(nvim.set_keymap "" :gr "<cmd>lua vim.lsp.buf.references()<CR>" {:silent true :noremap true})
(nvim.set_keymap "" :gs "<cmd>lua vim.lsp.buf.signature_help()<CR>" {:silent true :noremap true})
(lspconfig.rust_analyzer.setup {})
(lspconfig.gopls.setup {})
(lspconfig.denols.setup {})
(treesitter.setup {:ensure_installed ["c" "cpp" "python" "go" "rust" "javascript" "lua"]
:highlight {:enable true}
:indent {:enable true}})
(set nvim.o.completeopt "menuone,noselect")

View File

@ -28,6 +28,10 @@
(use :b3nj5m1n/kommentary) (use :b3nj5m1n/kommentary)
(use :nelstrom/vim-visual-star-search) (use :nelstrom/vim-visual-star-search)
(use {1 :nvim-treesitter/nvim-treesitter :run ":TSUpdate"})
(use :hrsh7th/nvim-compe)
(use :neovim/nvim-lspconfig)
; others ; others
(use :wakatime/vim-wakatime) (use :wakatime/vim-wakatime)
; (use :rescript-lang/vim-rescript) ; (use :rescript-lang/vim-rescript)