~keving/dotfiles

278a16041ad747f4dbb93878e2fa7711a087dcfd — Kevin Guillaumond 1 year, 1 month ago 32f11f4
Use gitsigns instead of vim-gitgutter + add pylint back + add clangd
2 files changed, 12 insertions(+), 8 deletions(-)

M .config/nvim/init.lua
M .config/nvim/lua/plugin_configs/nvim-lspconfig.lua
M .config/nvim/init.lua => .config/nvim/init.lua +8 -6
@@ 5,7 5,7 @@ local g = vim.g      -- a table to access global variables
-- b: Buffers
-- e: Edit file (init.lua, etc)
-- g: Go (code completion)
-- h: Hunks (gitgutter)
-- h: Git Hunks
-- r: Refactor
-- s: Spell checker, Source file (init.lua, etc), Sideways plugin
-- t: Tabs, Tests


@@ 40,7 40,7 @@ paq 'tpope/vim-repeat'         -- Repeat certain commands such as surround
paq 'tpope/vim-commentary'     -- Comment/uncomment code
paq 'janko/vim-test'           -- Run tests
paq 'tpope/vim-fugitive'       -- git integration
paq 'airblade/vim-gitgutter'   -- Shows git diff in the 'gutter' (sign column)
paq 'lewis6991/gitsigns.nvim'  -- Shows git diff in the 'gutter' (sign column)
paq 'neovim/nvim-lspconfig'    -- Code navigation
paq 'hrsh7th/nvim-compe'       -- Code completion
paq 'knsh14/vim-github-link'   -- Generate shareable file permalinks


@@ 53,6 53,8 @@ paq 'nvie/vim-flake8'          -- Python style checker
require 'plugin_configs/nvim-lspconfig'
require 'plugin_configs/nvim-compe_config'  -- TODO figure out why just 'nvim-compe' doesn't work

require('gitsigns').setup()


-- Plugin configs



@@ 83,15 85,12 @@ g['syntastic_auto_loc_list'] = 1
g['syntastic_check_on_open'] = 1
g['syntastic_check_on_wq'] = 0

cmd "let g:syntastic_python_checkers = ['flake8']"  -- TODO bring pylint back
cmd "let g:syntastic_python_checkers = ['flake8', 'pylint']"

-- Show all levels of pylint messages
cmd 'let g:syntastic_quiet_messages = { "level": [] }'
cmd 'let g:syntastic_python_pylint_quiet_messages = { "level" : [] }'

-- Don't lint on buffer write (makes opening python files super slow)
vim.b['syntastic_mode'] = 'passive'

-- TODO probably need something better, but might just disappear if I find a way
-- to run pylint and flake8 asynchronously.
utils.map('n', '<leader>l', ':SyntasticCheck<CR>', {silent = true})


@@ 186,6 185,9 @@ vim.o.matchtime = 2
-- Time in milliseconds to wait for a mapped sequence to complete.
vim.o.timeoutlen = 500

-- Update frequency for the sign column
vim.o.updatetime = 250

-- Add a bit extra margin to the left
vim.o.foldcolumn = '1'


M .config/nvim/lua/plugin_configs/nvim-lspconfig.lua => .config/nvim/lua/plugin_configs/nvim-lspconfig.lua +4 -2
@@ 2,8 2,10 @@ local cmd = vim.cmd

local utils = require('utils')

-- Set up pyright
require'lspconfig'.pyright.setup{}
-- Set up language servers
require'lspconfig'.clangd.setup{}  -- C / C++
require'lspconfig'.pyright.setup{}  -- Python


utils.map('n', '<leader>rr', '<cmd>lua vim.lsp.buf.rename()<CR>', {silent = true})
utils.map('n', 'gd', '<cmd>lua vim.lsp.buf.definition()<CR>', {silent = true})