aboutsummaryrefslogtreecommitdiff
path: root/stow/nvim/.config
diff options
context:
space:
mode:
Diffstat (limited to 'stow/nvim/.config')
-rw-r--r--stow/nvim/.config/nvim/ftplugin/typescript/typescript.vim17
-rw-r--r--stow/nvim/.config/nvim/init.vim3
2 files changed, 20 insertions, 0 deletions
diff --git a/stow/nvim/.config/nvim/ftplugin/typescript/typescript.vim b/stow/nvim/.config/nvim/ftplugin/typescript/typescript.vim
new file mode 100644
index 0000000..9e56582
--- /dev/null
+++ b/stow/nvim/.config/nvim/ftplugin/typescript/typescript.vim
@@ -0,0 +1,17 @@
+let mapleader = " "
+
+nnoremap <buffer> K :lua vim.lsp.buf.hover()<CR>
+nnoremap <buffer><silent> gd :lua vim.lsp.buf.definition()<CR>
+nnoremap <buffer> gr :lua vim.lsp.buf.references()<CR>
+nnoremap <buffer> gR :lua vim.lsp.buf.rename()<CR>
+nnoremap <buffer> <leader>e :lua vim.diagnostic.open_float()<CR>
+nnoremap <buffer> <leader>E :lua vim.diagnostic.setloclist()<CR>
+nnoremap <buffer> [e :lua vim.diagnostic.goto_prev({float=false})<CR>
+nnoremap <buffer> ]e :lua vim.diagnostic.goto_next({float=false})<CR>
+nnoremap <buffer> <leader>a :lua vim.lsp.buf.code_action()<CR>
+nnoremap <buffer> <leader>ds :lua vim.lsp.buf.document_symbol()<CR>
+
+let mapleader = ","
+
+setlocal omnifunc=v:lua.vim.lsp.omnifunc
+setlocal formatexpr=v:lua.vim.lsp.formatexpr()
diff --git a/stow/nvim/.config/nvim/init.vim b/stow/nvim/.config/nvim/init.vim
index f5360b1..1cdeb2c 100644
--- a/stow/nvim/.config/nvim/init.vim
+++ b/stow/nvim/.config/nvim/init.vim
@@ -16,6 +16,8 @@ lua vim.diagnostic.config({
lua require('lspconfig').bashls.setup{}
+lua require('lspconfig').tsserver.setup{}
+
lua require('lspconfig').texlab.setup{}
lua require('lspconfig').pylsp.setup{
@@ -29,3 +31,4 @@ lua require('lspconfig').pylsp.setup{
\}
\}
\}
+