Refactor neovim config (#2)
Changes include: - [x] Use init.lua instead of init.vim - Some keybindings are still to be converted - [x] Use packer as a package manager instead of vim-plug - [ ] Use built-in lsp instead of coc.nvim - [x] Set up language servers - [x] Completion - [x] Formatting (previously coc-prettier, now neoformat) - [ ] Snippets - [ ] Replace fzf with telescope.nvim - [x] Implement treesitter syntax highlighting - More info: https://github.com/nvim-treesitter/nvim-treesitter Note that this requires neovim nightly until 0.5 is released Reviewed-on: #2 Co-authored-by: Marko Korhonen <marko@korhonen.cc> Co-committed-by: Marko Korhonen <marko@korhonen.cc>
This commit is contained in:
parent
80c6f3c9c3
commit
c024a40316
24 changed files with 492 additions and 525 deletions
27
home/.config/nvim/lua/keybinds.lua
Normal file
27
home/.config/nvim/lua/keybinds.lua
Normal file
|
@ -0,0 +1,27 @@
|
|||
local function map(mode, lhs, rhs, opts)
|
||||
local options = {noremap = true}
|
||||
if opts then options = vim.tbl_extend('force', options, opts) end
|
||||
vim.api.nvim_set_keymap(mode, lhs, rhs, options)
|
||||
end
|
||||
|
||||
-- Open/close tree browser
|
||||
map('n', '<C-Tab>', '<cmd>NvimTreeToggle<CR>')
|
||||
|
||||
-- Telescope
|
||||
map('n', '<C-f>', '<cmd>Telescope find_files find_command=fd,-Ht,f<CR>')
|
||||
map('n', '<C-g>', '<cmd>Telescope live_grep<CR>')
|
||||
|
||||
-- Completion
|
||||
-- Navigate completions with tab and shift tab
|
||||
map('i', '<S-Tab>', 'pumvisible() ? "\\<C-p>" : "\\<Tab>"', {expr = true})
|
||||
map('i', '<Tab>', 'pumvisible() ? "\\<C-n>" : "\\<Tab>"', {expr = true})
|
||||
|
||||
-- Navigate between buffers
|
||||
map('n', '<C-N>', ':bn<CR>', {silent = true})
|
||||
map('n', '<C-B>', ':bp<CR>', {silent = true})
|
||||
|
||||
-- Navigate between splits
|
||||
map('n', '<C-H>', '<C-W><C-H>')
|
||||
map('n', '<C-J>', '<C-W><C-J>')
|
||||
map('n', '<C-K>', '<C-W><C-K>')
|
||||
map('n', '<C-L>', '<C-W><C-L>')
|
Loading…
Add table
Add a link
Reference in a new issue