Compare commits

...

3 commits

2 changed files with 26 additions and 28 deletions

View file

@ -44,6 +44,7 @@ function KEYBINDS:set_global_keys(opts)
vim.keymap.set('n', '<M-t>', ':tabnew<CR>', opts) -- fallback for windows vim.keymap.set('n', '<M-t>', ':tabnew<CR>', opts) -- fallback for windows
vim.keymap.set('n', '<C-t>', ':Neotree toggle<CR>', {noremap=true}) vim.keymap.set('n', '<C-t>', ':Neotree toggle<CR>', {noremap=true})
vim.keymap.set('n', '<C-S-t>', ':Neotree toggle source=symbolmap right<CR>', {noremap=true}) vim.keymap.set('n', '<C-S-t>', ':Neotree toggle source=symbolmap right<CR>', {noremap=true})
vim.keymap.set('n', '<M-S-t>', ':Neotree toggle source=symbolmap right<CR>', {noremap=true})
vim.keymap.set('n', '<C-PageUp>', ':Neotree toggle source=diagnostics bottom<CR>', opts) vim.keymap.set('n', '<C-PageUp>', ':Neotree toggle source=diagnostics bottom<CR>', opts)
-- vim.keymap.set('n', '<C-h>', vim.cmd.UndotreeToggle, {noremap=true}) -- vim.keymap.set('n', '<C-h>', vim.cmd.UndotreeToggle, {noremap=true})
-- Esc goes back to normal mode in terminal -- Esc goes back to normal mode in terminal
@ -84,6 +85,7 @@ function KEYBINDS:set_lsp_keys(opts)
vim.keymap.set('n', '<leader>r', vim.lsp.buf.references, opts) vim.keymap.set('n', '<leader>r', vim.lsp.buf.references, opts)
vim.keymap.set('n', '<leader>h', vim.lsp.buf.hover, opts) vim.keymap.set('n', '<leader>h', vim.lsp.buf.hover, opts)
vim.keymap.set('n', '<leader>f', vim.lsp.buf.signature_help, opts) vim.keymap.set('n', '<leader>f', vim.lsp.buf.signature_help, opts)
vim.keymap.set('n', '<M-q>', vim.lsp.buf.signature_help, opts)
vim.keymap.set('n', '<C-Space>', vim.lsp.buf.hover, opts) vim.keymap.set('n', '<C-Space>', vim.lsp.buf.hover, opts)
vim.keymap.set('n', '<C-x>', vim.lsp.buf.hover, opts) vim.keymap.set('n', '<C-x>', vim.lsp.buf.hover, opts)
vim.keymap.set('n', '<leader>H', function() vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled()) end) vim.keymap.set('n', '<leader>H', function() vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled()) end)
@ -116,43 +118,28 @@ end
function KEYBINDS:set_telescope_keys(opts) function KEYBINDS:set_telescope_keys(opts)
local telescope = require('telescope.builtin') local telescope = require('telescope.builtin')
local theme = require('telescope.themes') local theme = require('telescope.themes')
-- File navigation
vim.keymap.set('n', '<leader><leader>p', wrap(telescope.oldfiles, {layout_strategy = 'vertical' }), opts)
vim.keymap.set('n', '<leader>p', telescope.find_files, opts) vim.keymap.set('n', '<leader>p', telescope.find_files, opts)
vim.keymap.set('n', '<M-f>', telescope.find_files, opts) -- fallback for windows vim.keymap.set('n', '<leader>', wrap(telescope.lsp_dynamic_workspace_symbols, {layout_strategy = 'vertical'}), opts)
vim.keymap.set('n', '<C-,>', wrap(telescope.live_grep, {layout_strategy = 'vertical'}), opts) vim.keymap.set('n', '<leader>/', wrap(telescope.live_grep, {layout_strategy = 'vertical'}), opts)
vim.keymap.set('n', '<M-,>', wrap(telescope.live_grep, {layout_strategy = 'vertical'}), opts) -- fallback for windows vim.keymap.set('n', '<leader>]', wrap(telescope.lsp_references, theme.get_dropdown()), opts)
vim.keymap.set('n', '<M-]>', wrap(telescope.lsp_references, theme.get_cursor()), opts) vim.keymap.set('n', '<leader>r', wrap(telescope.lsp_references, theme.get_dropdown()), opts) -- overrule lsp bind
vim.keymap.set('n', '<M-[>', wrap(telescope.jumplist, theme.get_dropdown()), opts) vim.keymap.set('n', '<leader>;', telescope.git_bcommits, opts)
vim.keymap.set('n', '<C-;>', telescope.git_bcommits, opts)
vim.keymap.set('n', '<M-;>', telescope.git_bcommits, opts) -- fallback for windows
vim.keymap.set('n', '<M-=>', wrap(telescope.registers, theme.get_dropdown()), opts) -- fallback for windows
-- Marks and buffers with telescope
vim.keymap.set('n', '<C-End>', telescope.buffers, opts)
vim.keymap.set('n', '<C-\'>', wrap(telescope.marks, theme.get_dropdown()), opts)
vim.keymap.set('n', '<M-\'>', wrap(telescope.marks, theme.get_dropdown()), opts) -- fallback for windows
vim.keymap.set('n', '<C-/>', wrap(telescope.current_buffer_fuzzy_find, {layout_strategy = 'vertical'}), opts)
vim.keymap.set('n', '<M-/>', wrap(telescope.current_buffer_fuzzy_find, {layout_strategy = 'vertical'}), opts) -- fallback for windows
-- Symbols with telescope
vim.keymap.set('n', '<C-\\>', telescope.lsp_document_symbols, opts)
vim.keymap.set('n', '<leader>/', telescope.lsp_document_symbols, opts)
vim.keymap.set('n', '<leader>s', wrap(telescope.lsp_dynamic_workspace_symbols, {layout_strategy = 'vertical'}), opts)
vim.keymap.set('n', '<C-|>', wrap(telescope.lsp_dynamic_workspace_symbols, {layout_strategy = 'vertical'}), opts)
vim.keymap.set('n', '<M-|>', wrap(telescope.lsp_dynamic_workspace_symbols, {layout_strategy = 'vertical'}), opts)
-- Resule last
vim.keymap.set('n', '<C-CR>', telescope.resume, opts)
vim.keymap.set('n', '<M-CR>', telescope.resume, opts)
-- Error list with telescope
vim.keymap.set('n', '<C-PageDown>', wrap(telescope.diagnostics, theme.get_ivy({bufnr=0})), opts)
if not vim.g.disable_legacy_keybinds then if not vim.g.disable_legacy_keybinds then
-- File navigation -- File navigation
vim.keymap.set('n', '<leader>|', wrap(telescope.oldfiles, {layout_strategy = 'vertical' }), opts)
vim.keymap.set('n', '<C-ESC>', wrap(telescope.oldfiles, {layout_strategy = 'vertical' }), opts) vim.keymap.set('n', '<C-ESC>', wrap(telescope.oldfiles, {layout_strategy = 'vertical' }), opts)
vim.keymap.set('n', '<M-!>', wrap(telescope.oldfiles, {layout_strategy = 'vertical' }), opts) -- fallback for windows... even <M-Esc> is used vim.keymap.set('n', '<M-!>', wrap(telescope.oldfiles, {layout_strategy = 'vertical' }), opts) -- fallback for windows... even <M-Esc> is used
vim.keymap.set('n', '<C-f>', telescope.find_files, opts) vim.keymap.set('n', '<C-f>', telescope.find_files, opts)
vim.keymap.set('n', '<M-f>', telescope.find_files, opts) -- fallback for windows vim.keymap.set('n', '<M-f>', telescope.find_files, opts) -- fallback for windows
vim.keymap.set('n', '<C-,>', wrap(telescope.live_grep, {layout_strategy = 'vertical'}), opts) vim.keymap.set('n', '<C-,>', wrap(telescope.live_grep, {layout_strategy = 'vertical'}), opts)
vim.keymap.set('n', '<M-,>', wrap(telescope.live_grep, {layout_strategy = 'vertical'}), opts) -- fallback for windows vim.keymap.set('n', '<M-,>', wrap(telescope.live_grep, {layout_strategy = 'vertical'}), opts) -- fallback for windows
vim.keymap.set('n', '<M-]>', wrap(telescope.lsp_references, theme.get_cursor()), opts) vim.keymap.set('n', '<M-]>', wrap(telescope.lsp_references, theme.get_cursor()), opts)
vim.keymap.set('n', '<M-[>', wrap(telescope.jumplist, theme.get_dropdown()), opts) vim.keymap.set('n', '<M-[>', wrap(telescope.jumplist, theme.get_dropdown()), opts)
vim.keymap.set('n', '<C-;>', telescope.git_bcommits, opts) vim.keymap.set('n', '<C-;>', telescope.git_bcommits, opts)
vim.keymap.set('n', '<M-;>', telescope.git_bcommits, opts) -- fallback for windows vim.keymap.set('n', '<M-;>', telescope.git_bcommits, opts) -- fallback for windows

View file

@ -77,12 +77,23 @@ return {
config = function() config = function()
require('nvim-treesitter.configs').setup({ require('nvim-treesitter.configs').setup({
highlight = { enable = true }, highlight = { enable = true },
indent = { enable = true },
}) })
vim.opt.foldmethod = "expr" vim.opt.foldmethod = "expr"
vim.opt.foldexpr = "nvim_treesitter#foldexpr()" vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
end end
}, },
{
'nvim-treesitter/nvim-treesitter',
config = function ()
require('treesitter-context').setup({
multiwindow = true,
min_window_height = 10,
})
end
},
{ {
"nvim-neo-tree/neo-tree.nvim", "nvim-neo-tree/neo-tree.nvim",
branch = "v3.x", branch = "v3.x",