Improve neovim config

This commit is contained in:
Torjus Håkestad 2024-02-28 10:01:01 +01:00
parent f5c7448c8a
commit c5706f1cd8
4 changed files with 75 additions and 0 deletions

View File

@ -14,9 +14,13 @@
lsp-zero-nvim
vim-floaterm
luasnip
lualine-nvim
vim-sleuth
(nvim-treesitter.withPlugins (p: [
p.tree-sitter-yaml
p.tree-sitter-nix
p.tree-sitter-go
p.tree-sitter-lua
p.tree-sitter-vim
p.tree-sitter-bash
p.tree-sitter-json

View File

@ -16,3 +16,7 @@ vim.keymap.set('n', '<leader>?', require('telescope.builtin').oldfiles,
{ desc = '[?] FInd recently opened files' })
vim.keymap.set('n', '<leader>ff', require('telescope.builtin').find_files,
{ desc = '[F]ind [F]iles' })
vim.keymap.set('n', '<leader>ff', require('telescope.builtin').find_files,
{ desc = '[F]ind [F]iles' })
vim.keymap.set('n', '<leader>fg', require('telescope.builtin').live_grep,
{ desc = '[F]ind by [G]rep' })

View File

@ -10,3 +10,4 @@ vim.o.relativenumber = true
vim.o.tabstop = 4
vim.o.shiftwidth = 4
vim.o.expandtab = true

View File

@ -49,3 +49,69 @@ require('telescope').setup({
}
},
})
-- Tresitter stuff
require('nvim-treesitter.configs').setup {
ensure_installed = {},
auto_install = false,
highlight = { enable = true },
indent = { enable = true},
incremental_selection = {
enable = true,
keymaps = {
init_selection = '<c-space>',
node_incremental = '<c-space>',
scope_incremental = '<c-s>',
node_decremental = '<M-space>',
},
},
textobjects = {
select = {
enable = true,
lookahead = true,
keymaps = {
['aa'] = '@parameter.outer',
['ia'] = '@parameter.inner',
['af'] = '@function.outer',
['if'] = '@function.inner',
['ac'] = '@class.outer',
['ic'] = '@class.inner',
}
}
}
}
-- Lualine
require('lualine').setup({
options = {
icons_enabled = false,
component_separators = '|',
disabled_filetypes = {},
always_divide_middle = true,
globalstatus = true,
},
sections = {
lualine_a = { 'mode' },
lualine_b = { 'branch', 'diff', 'diagnostics' },
lualine_c = {
{
'filename',
file_status = true,
newfile_status = true,
path = 3,
shorting_target = 30,
symbols = {
modified = '[+]',
readonly = '[-]',
unnamed = '[No name]',
newfile = '[New]'
}
}
},
lualine_x = {'encoding', 'fileformat', 'filetype'},
lualine_y = { 'progress' },
lualine_z = { 'location' }
}
})