all repos — dotfiles @ b774603f44ec5870d48edeee61b981ce6d3dd843

my *nix dotfiles

nvim: fix lsp formatting
Anirudh Oppiliappan x@icyphox.sh
Thu, 15 Dec 2022 08:53:25 +0530
commit

b774603f44ec5870d48edeee61b981ce6d3dd843

parent

6b1179415128a15ebcc9fe1816df642fa49479b8

M config/nvim/_init.luaconfig/nvim/_init.lua

@@ -17,6 +17,7 @@ require 'lsp.go'

require 'lsp.lua' require 'lsp.json' require 'lsp.js' +require 'lsp.rust' -- plugins not in nixpkgs require 'packer'.startup(function(use)
M config/nvim/ftplugin/go.vimconfig/nvim/ftplugin/go.vim

@@ -23,8 +23,8 @@ end

end EOF -augroup go_lsp +augroup go_lsp autocmd! - autocmd BufWritePre *.go :silent! lua vim.lsp.buf.formatting() + autocmd BufWritePre *.go :silent! lua vim.lsp.buf.format() autocmd BufWritePre *.go :silent! lua org_imports(3000) augroup END
A config/nvim/lua/lsp/rust.lua

@@ -0,0 +1,1 @@

+require'lspconfig'.rust_analyzer.setup{}
M config/nvim/lua/maps.luaconfig/nvim/lua/maps.lua

@@ -90,7 +90,7 @@ buf_set_keymap('n', ']d', '<cmd>lua vim.diagnostic.goto_next()<CR>', options)

buf_set_keymap('n', '<leader>rn', '<cmd>lua vim.lsp.buf.rename()<CR>', options) if client.server_capabilities.document_formatting then - buf_set_keymap('n', 'ff', '<cmd>lua vim.lsp.buf.formatting()<CR>', options) + buf_set_keymap('n', 'ff', '<cmd>lua vim.lsp.buf.format()<CR>', options) elseif client.server_capabilities.document_range_formatting then buf_set_keymap('n', 'ff', '<cmd>lua vim.lsp.buf.range_formatting()<CR>', options) end