From 04b401ea5b9afc4a1f33d28fee379306183658e7 Mon Sep 17 00:00:00 2001 From: Piotr Anisko Date: Wed, 13 Nov 2024 10:01:21 +0100 Subject: [PATCH] added own setup --- init.lua | 60 +++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 44 insertions(+), 16 deletions(-) diff --git a/init.lua b/init.lua index 4ce35f4b..2ac4bddc 100644 --- a/init.lua +++ b/init.lua @@ -1,5 +1,6 @@ --[[ + ===================================================================== ==================== READ THIS BEFORE CONTINUING ==================== ===================================================================== @@ -176,10 +177,10 @@ vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagn vim.keymap.set('t', '', '', { desc = 'Exit terminal mode' }) -- TIP: Disable arrow keys in normal mode --- vim.keymap.set('n', '', 'echo "Use h to move!!"') --- vim.keymap.set('n', '', 'echo "Use l to move!!"') --- vim.keymap.set('n', '', 'echo "Use k to move!!"') --- vim.keymap.set('n', '', 'echo "Use j to move!!"') +vim.keymap.set('n', '', 'echo "Use h to move!!"') +vim.keymap.set('n', '', 'echo "Use l to move!!"') +vim.keymap.set('n', '', 'echo "Use k to move!!"') +vim.keymap.set('n', '', 'echo "Use j to move!!"') -- Keybinds to make split navigation easier. -- Use CTRL+ to switch between windows @@ -255,7 +256,33 @@ require('lazy').setup({ }, }, }, - + -- MY CONFIG + { 'mbbill/undotree' }, + { + 'christoomey/vim-tmux-navigator', + cmd = { + 'TmuxNavigateLeft', + 'TmuxNavigateDown', + 'TmuxNavigateUp', + 'TmuxNavigateRight', + 'TmuxNavigatePrevious', + }, + keys = { + { '', 'TmuxNavigateLeft' }, + { '', 'TmuxNavigateDown' }, + { '', 'TmuxNavigateUp' }, + { '', 'TmuxNavigateRight' }, + { '', 'TmuxNavigatePrevious' }, + }, + }, + { + 'cuducos/yaml.nvim', + ft = { 'yaml' }, -- optional + dependencies = { + 'nvim-treesitter/nvim-treesitter', + 'nvim-telescope/telescope.nvim', -- optional + }, + }, -- NOTE: Plugins can also be configured to run Lua code when they are loaded. -- -- This is often very useful to both group configuration, as well as handle @@ -271,6 +298,7 @@ require('lazy').setup({ -- after the plugin has been loaded: -- config = function() ... end + -- PLUGIN CONFIG { -- Useful plugin to show you pending keybinds. 'folke/which-key.nvim', event = 'VimEnter', -- Sets the loading event to 'VimEnter' @@ -331,7 +359,7 @@ require('lazy').setup({ -- you do for a plugin at the top level, you can do for a dependency. -- -- Use the `dependencies` key to specify the dependencies of a particular plugin - + { vim.keymap.set('n', '', vim.cmd.UndotreeToggle, { desc = 'Undo tree toggle' }) }, { -- Fuzzy Finder (files, lsp, etc) 'nvim-telescope/telescope.nvim', event = 'VimEnter', @@ -589,13 +617,13 @@ require('lazy').setup({ }) -- Change diagnostic symbols in the sign column (gutter) - -- if vim.g.have_nerd_font then - -- local signs = { Error = '', Warn = '', Hint = '', Info = '' } - -- for type, icon in pairs(signs) do - -- local hl = 'DiagnosticSign' .. type - -- vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl }) - -- end - -- end + if vim.g.have_nerd_font then + local signs = { Error = '', Warn = '', Hint = '', Info = '' } + for type, icon in pairs(signs) do + local hl = 'DiagnosticSign' .. type + vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl }) + end + end -- LSP servers and clients are able to communicate to each other what features they support. -- By default, Neovim doesn't support everything that is in the LSP specification. @@ -784,11 +812,11 @@ require('lazy').setup({ -- Accept ([y]es) the completion. -- This will auto-import if your LSP supports it. -- This will expand snippets if the LSP sent a snippet. - [''] = cmp.mapping.confirm { select = true }, + --[''] = cmp.mapping.confirm { select = true }, -- If you prefer more traditional completion keymaps, -- you can uncomment the following lines - --[''] = cmp.mapping.confirm { select = true }, + [''] = cmp.mapping.confirm { select = true }, --[''] = cmp.mapping.select_next_item(), --[''] = cmp.mapping.select_prev_item(), @@ -897,7 +925,7 @@ require('lazy').setup({ main = 'nvim-treesitter.configs', -- Sets main module to use for opts -- [[ Configure Treesitter ]] See `:help nvim-treesitter` opts = { - ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' }, + ensure_installed = { 'python', 'sql', 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc', 'java' }, -- Autoinstall languages that are not installed auto_install = true, highlight = {