latest and greatest

This commit is contained in:
Ivar Fatland
2024-09-24 19:30:48 +02:00
+43 -20
View File
@@ -19,19 +19,40 @@ vim.opt.scrolloff = 8
vim.api.nvim_set_option("clipboard", "unnamedplus") vim.api.nvim_set_option("clipboard", "unnamedplus")
do do
local navigation_move_to_panel_left = '<c-h>' local move_left = '<c-h>'
local navigation_move_to_panel_down = '<c-j>' local move_down = '<c-j>'
local navigation_move_to_panel_up = '<c-k>' local move_up = '<c-k>'
local navigation_move_to_panel_right = '<c-l>' local move_right = '<c-l>'
vim.api.nvim_set_keymap('n', move_left, '<cmd>wincmd h<CR>', {silent = true})
vim.api.nvim_set_keymap('n', move_down, '<cmd>wincmd j<CR>', {silent = true})
vim.api.nvim_set_keymap('n', move_up, '<cmd>wincmd k<CR>', {silent = true})
vim.api.nvim_set_keymap('n', move_right, '<cmd>wincmd l<CR>', {silent = true})
vim.api.nvim_set_keymap('t', move_left, '<cmd>wincmd h<CR>', {silent = true})
vim.api.nvim_set_keymap('t', move_down, '<cmd>wincmd j<CR>', {silent = true})
vim.api.nvim_set_keymap('t', move_up, '<cmd>wincmd k<CR>', {silent = true})
vim.api.nvim_set_keymap('t', move_right, '<cmd>wincmd l<CR>', {silent = true})
end
do -- building, errors and folder navigation
---comment
---@param key string
---@param command string
local function map(key, command)
local prefix = '<leader>'
vim.api.nvim_set_keymap('n', prefix .. key, '<cmd>'..command..'<CR>', {silent = true})
end
map('co', 'copen')
map('cc', 'cclose')
map('cf', 'cfirst')
map('cl', 'clast')
map('cn', 'cnext')
map('cp', 'cprevious')
map('cd', 'cd %:p:h')
map('m', 'make')
vim.api.nvim_set_keymap('n', navigation_move_to_panel_left, '<cmd>wincmd h<CR>', {silent = true})
vim.api.nvim_set_keymap('n', navigation_move_to_panel_down, '<cmd>wincmd j<CR>', {silent = true})
vim.api.nvim_set_keymap('n', navigation_move_to_panel_up, '<cmd>wincmd k<CR>', {silent = true})
vim.api.nvim_set_keymap('n', navigation_move_to_panel_right, '<cmd>wincmd l<CR>', {silent = true})
vim.api.nvim_set_keymap('t', navigation_move_to_panel_left, '<cmd>wincmd h<CR>', {silent = true})
vim.api.nvim_set_keymap('t', navigation_move_to_panel_down, '<cmd>wincmd j<CR>', {silent = true})
vim.api.nvim_set_keymap('t', navigation_move_to_panel_up, '<cmd>wincmd k<CR>', {silent = true})
vim.api.nvim_set_keymap('t', navigation_move_to_panel_right, '<cmd>wincmd l<CR>', {silent = true})
end end
vim.api.nvim_set_keymap('t', '<esc>', '<C-\\><C-n>', {silent = true}) vim.api.nvim_set_keymap('t', '<esc>', '<C-\\><C-n>', {silent = true})
@@ -327,6 +348,11 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then
end end
vim.opt.rtp:prepend(lazypath) vim.opt.rtp:prepend(lazypath)
--=> This package requires additional configuration for use in editors. Install package
-- 'user-setup', or manually:
-- * for Vim, add this line to ~/.vimrc:
-- set rtp^="/home/ivarfatland/.opam/default/share/ocp-indent/vim"
require('lazy').setup( require('lazy').setup(
{ {
{ 'neovim/nvim-lspconfig', { 'neovim/nvim-lspconfig',
@@ -420,10 +446,6 @@ require('lazy').setup(
require('snippy').setup({ require('snippy').setup({
enable_auto = true, enable_auto = true,
mappings = { mappings = {
-- is = {
-- ['<Tab>'] = 'expand_or_advance',
-- ['<S-Tab>'] = 'previous',
-- },
nx = { nx = {
['<leader>x'] = 'cut_text', ['<leader>x'] = 'cut_text',
}, },
@@ -520,11 +542,12 @@ require('lazy').setup(
map('t', cswrapper(builtin.lsp_type_definitions, omnisharp_extended.telescope_lsp_type_definitions)) map('t', cswrapper(builtin.lsp_type_definitions, omnisharp_extended.telescope_lsp_type_definitions))
map('i', cswrapper(builtin.lsp_implementations, omnisharp_extended.telescope_lsp_implementations)) map('i', cswrapper(builtin.lsp_implementations, omnisharp_extended.telescope_lsp_implementations))
--map('r', omnisharp_extended.lsp_references) -- map('r', builtin.lsp_references)
--map('d', omnisharp_extended.lsp_definitions) -- map('d', builtin.lsp_definitions)
--map('t', omnisharp_extended.lsp_type_definitions) -- map('t', builtin.lsp_type_definitions)
--map('i', omnisharp_extended.lsp_impelentations) -- map('i', builtin.lsp_implementations)
map('s', builtin.lsp_document_symbols)
map('e', builtin.diagnostics) map('e', builtin.diagnostics)
end, end,