From a64cddd5c853c15d8d47a06319c2be662851887c Mon Sep 17 00:00:00 2001 From: Julian Raufelder Date: Sun, 6 Aug 2023 23:56:19 +0200 Subject: [PATCH 01/12] Add my customisations --- init.lua | 32 +++++++++++++++++++++++-- lazy-lock.json | 42 +++++++++++++++++++++++++++++++++ lua/custom/plugins/filetree.lua | 14 +++++++++++ 3 files changed, 86 insertions(+), 2 deletions(-) create mode 100644 lazy-lock.json create mode 100644 lua/custom/plugins/filetree.lua diff --git a/init.lua b/init.lua index ee1f390..87e06e1 100644 --- a/init.lua +++ b/init.lua @@ -235,11 +235,35 @@ require('lazy').setup({ -- NOTE: You can change these options as you wish! -- Set highlight on search -vim.o.hlsearch = false +vim.o.hlsearch = true -- Make line numbers default vim.wo.number = true +-- Toggle line numbers depending on the vim mode +local augroup = vim.api.nvim_create_augroup("numbertoggle", {}) + +vim.api.nvim_create_autocmd({ "BufEnter", "FocusGained", "InsertLeave", "CmdlineLeave", "WinEnter" }, { + pattern = "*", + group = augroup, + callback = function() + if vim.o.nu and vim.api.nvim_get_mode().mode ~= "i" then + vim.opt.relativenumber = true + end + end, +}) + +vim.api.nvim_create_autocmd({ "BufLeave", "FocusLost", "InsertEnter", "CmdlineEnter", "WinLeave" }, { + pattern = "*", + group = augroup, + callback = function() + if vim.o.nu then + vim.opt.relativenumber = false + vim.cmd "redraw" + end + end, +}) + -- Enable mouse mode vim.o.mouse = 'a' @@ -333,7 +357,7 @@ vim.keymap.set('n', 'sr', require('telescope.builtin').resume, { desc = vim.defer_fn(function() require('nvim-treesitter.configs').setup { -- Add languages to be installed here that you want installed for treesitter - ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'javascript', 'typescript', 'vimdoc', 'vim', 'bash' }, + ensure_installed = { 'lua', 'python', 'tsx', 'javascript', 'typescript', 'vimdoc', 'vim', 'bash', 'css', 'dockerfile', 'html', 'java', 'kotlin', 'json', 'markdown_inline', 'ruby', 'sql', 'toml', 'vue', 'yam' }, -- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!) auto_install = false, @@ -562,3 +586,7 @@ cmp.setup { -- The line beneath this is called `modeline`. See `:help modeline` -- vim: ts=2 sts=2 sw=2 et +-- + +vim.keymap.set('i', 'jj', '', { desc = 'Closes insert mode' }) + diff --git a/lazy-lock.json b/lazy-lock.json new file mode 100644 index 0000000..6faf46a --- /dev/null +++ b/lazy-lock.json @@ -0,0 +1,42 @@ +{ + "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, + "LuaSnip": { "branch": "master", "commit": "cdbf6f41381e5ee4810b4b09284b603d8f18365d" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" }, + "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, + "fidget.nvim": { "branch": "main", "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" }, + "friendly-snippets": { "branch": "main", "commit": "43727c2ff84240e55d4069ec3e6158d74cb534b6" }, + "gitsigns.nvim": { "branch": "main", "commit": "ff01d34daaed72f271a8ffa088a7e839a60c640f" }, + "harpoon": { "branch": "master", "commit": "c1aebbad9e3d13f20bedb8f2ce8b3a94e39e424a" }, + "indent-blankline.nvim": { "branch": "master", "commit": "1bee85e1789f61e5ee54e5a18f8fa193099dca99" }, + "lazy.nvim": { "branch": "main", "commit": "73fbf5ccabd0233653bdeb4bb2b07fcfa97b57e0" }, + "lualine.nvim": { "branch": "master", "commit": "45e27ca739c7be6c49e5496d14fcf45a303c3a63" }, + "markdown-preview.nvim": { "branch": "master", "commit": "02cc3874738bc0f86e4b91f09b8a0ac88aef8e96" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "ddefe5ab051e7ca6a7b374754f0920c44668b54f" }, + "mason.nvim": { "branch": "main", "commit": "cd7835b15f5a4204fc37e0aa739347472121a54c" }, + "neo-tree.nvim": { "branch": "main", "commit": "6f8c49956c89e9fefae6acdfe1d57c6293b0a03d" }, + "neodev.nvim": { "branch": "main", "commit": "a4b6e7ca11ff5be2264d5c169fcedd97d8699ec4" }, + "noice.nvim": { "branch": "main", "commit": "fcd01710ff6918d4d3ef90c8e36f3addacba13bf" }, + "nui.nvim": { "branch": "main", "commit": "c0c8e347ceac53030f5c1ece1c5a5b6a17a25b32" }, + "nvim-cmp": { "branch": "main", "commit": "5dce1b778b85c717f6614e3f4da45e9f19f54435" }, + "nvim-lspconfig": { "branch": "master", "commit": "2b361e043810d5587d9af0787f8ce40da92ec5e9" }, + "nvim-notify": { "branch": "master", "commit": "e4a2022f4fec2d5ebc79afa612f96d8b11c627b3" }, + "nvim-treesitter": { "branch": "master", "commit": "e5198778dbefa14823099dd6d8fba3819a5e7b8a" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "76c7a89b41de77a4f83fb77fa072c5ad7605fe3b" }, + "nvim-web-devicons": { "branch": "master", "commit": "a1e6268779411048a87f767a27380089362a0ce2" }, + "onedark.nvim": { "branch": "master", "commit": "826fb77e9ca92d3c0f3d937328663d4a6dc7fee1" }, + "plenary.nvim": { "branch": "master", "commit": "9ce85b0f7dcfe5358c0be937ad23e456907d410b" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" }, + "telescope.nvim": { "branch": "0.1.x", "commit": "7011eaae0ac1afe036e30c95cf80200b8dc3f21a" }, + "undotree": { "branch": "master", "commit": "0e11ba7325efbbb3f3bebe06213afa3e7ec75131" }, + "vim-commentary": { "branch": "master", "commit": "e87cd90dc09c2a203e13af9704bd0ef79303d755" }, + "vim-dadbod": { "branch": "master", "commit": "ee7e3bb5377d43cb31a101718dd0cfc09bb87d4b" }, + "vim-dadbod-completion": { "branch": "master", "commit": "fc7321a17f4c55db11fae89a884ddf4724020bae" }, + "vim-dadbod-ui": { "branch": "master", "commit": "95fd22469507e86b78aa55d868c14108adee2881" }, + "vim-fugitive": { "branch": "master", "commit": "cbe9dfa162c178946afa689dd3f42d4ea8bf89c1" }, + "vim-rhubarb": { "branch": "master", "commit": "ee69335de176d9325267b0fd2597a22901d927b1" }, + "vim-sleuth": { "branch": "master", "commit": "1cc4557420f215d02c4d2645a748a816c220e99b" }, + "vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, + "vim-tmux-navigator": { "branch": "master", "commit": "7db70e08ea03b3e4d91f63713d76134512e28d7e" }, + "which-key.nvim": { "branch": "main", "commit": "7ccf476ebe0445a741b64e36c78a682c1c6118b7" }, + "wilder.nvim": { "branch": "master", "commit": "679f348dc90d80ff9ba0e7c470c40a4d038dcecf" } +} \ No newline at end of file diff --git a/lua/custom/plugins/filetree.lua b/lua/custom/plugins/filetree.lua new file mode 100644 index 0000000..80ef6d7 --- /dev/null +++ b/lua/custom/plugins/filetree.lua @@ -0,0 +1,14 @@ +vim.cmd([[ let g:neo_tree_remove_legacy_commands = 1 ]]) + +return { + "nvim-neo-tree/neo-tree.nvim", + version = "*", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-tree/nvim-web-devicons", -- not strictly required, but recommended + "MunifTanjim/nui.nvim", + }, + config = function () + require('neo-tree').setup {} + end, +} -- 2.40.1 From d77d8054959ab62cf4f08ba6bb2c98f389f07d37 Mon Sep 17 00:00:00 2001 From: Julian Raufelder Date: Tue, 8 Aug 2023 10:12:00 +0200 Subject: [PATCH 02/12] Further improvements --- init.lua | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 87e06e1..75bc10f 100644 --- a/init.lua +++ b/init.lua @@ -215,7 +215,32 @@ require('lazy').setup({ build = ':TSUpdate', }, - -- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart + -- Bufferline shows tab + {'akinsho/bufferline.nvim', version = "*", dependencies = 'nvim-tree/nvim-web-devicons'}, + -- List entered commands + {'gelguy/wilder.nvim', version = "*", config = function() end }, + -- File browser + { + "nvim-neo-tree/neo-tree.nvim", + version = "*", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-tree/nvim-web-devicons", -- not strictly required, but recommended + "MunifTanjim/nui.nvim", + }, + config = function () + require('neo-tree').setup {} + end, + }, + -- Markdown preview + {'iamcco/markdown-preview.nvim', + ft = "markdown", + -- build = "cd app && yarn install", -- after removing Joplin one day + build = "cd app && npm install", + init = function() vim.g.mkdp_filetypes = { "markdown" } end, + }, + + -- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart -- These are some example plugins that I've included in the kickstart repository. -- Uncomment any of the lines below to enable them. -- require 'kickstart.plugins.autoformat', @@ -589,4 +614,17 @@ cmp.setup { -- vim.keymap.set('i', 'jj', '', { desc = 'Closes insert mode' }) +vim.keymap.set('n', 'ec', ':', { desc = 'Execute command' }) + +-- bufferline +vim.opt.termguicolors = true +require("bufferline").setup{} + +-- wilder +local wilder = require('wilder') +wilder.setup({modes = {':', '/', '?'}}) + +-- filetree +-- Unless you are still migrating, remove the deprecated commands from v1.x +vim.cmd([[ let g:neo_tree_remove_legacy_commands = 1 ]]) -- 2.40.1 From c705d03a4ba684a0d67457f4505fb4f57a4b6154 Mon Sep 17 00:00:00 2001 From: Julian Raufelder Date: Thu, 31 Aug 2023 16:35:55 +0200 Subject: [PATCH 03/12] Add vim-tmux-plugin --- init.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/init.lua b/init.lua index 75bc10f..697860c 100644 --- a/init.lua +++ b/init.lua @@ -239,6 +239,7 @@ require('lazy').setup({ build = "cd app && npm install", init = function() vim.g.mkdp_filetypes = { "markdown" } end, }, + 'christoomey/vim-tmux-navigator', -- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart -- These are some example plugins that I've included in the kickstart repository. -- 2.40.1 From 4230158ff5664fff22ef5992f35a92f0a09db57d Mon Sep 17 00:00:00 2001 From: Julian Raufelder Date: Sat, 2 Sep 2023 20:14:14 +0200 Subject: [PATCH 04/12] Add further customizations --- init.lua | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 697860c..eea6469 100644 --- a/init.lua +++ b/init.lua @@ -239,7 +239,27 @@ require('lazy').setup({ build = "cd app && npm install", init = function() vim.g.mkdp_filetypes = { "markdown" } end, }, + -- show notifications etc in a nice area + {'folke/noice.nvim', + event = 'VeryLazy', + opts = { + -- add any options here + }, + dependencies = { + -- if you lazy-load any plugin below, make sure to add proper `module="..."` entries + 'MunifTanjim/nui.nvim', + -- OPTIONAL: + -- `nvim-notify` is only needed, if you want to use the notification view. + -- If not available, we use `mini` as the fallback + 'rcarriga/nvim-notify', + } + }, + -- tmux vim keybindings 'christoomey/vim-tmux-navigator', + -- databse connections from within vim using DBGUI and DB + 'tpope/vim-dadbod', + 'kristijanhusak/vim-dadbod-ui', + 'kristijanhusak/vim-dadbod-completion', -- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart -- These are some example plugins that I've included in the kickstart repository. @@ -353,6 +373,13 @@ require('telescope').setup { }, }, }, + pickers = { + live_grep = { + additional_args = function(opts) + return {"--hidden"} + end + }, + }, } -- Enable telescope fzf native, if installed @@ -370,12 +397,13 @@ vim.keymap.set('n', '/', function() end, { desc = '[/] Fuzzily search in current buffer' }) vim.keymap.set('n', 'gf', require('telescope.builtin').git_files, { desc = 'Search [G]it [F]iles' }) -vim.keymap.set('n', 'sf', require('telescope.builtin').find_files, { desc = '[S]earch [F]iles' }) vim.keymap.set('n', 'sh', require('telescope.builtin').help_tags, { desc = '[S]earch [H]elp' }) vim.keymap.set('n', 'sw', require('telescope.builtin').grep_string, { desc = '[S]earch current [W]ord' }) vim.keymap.set('n', 'sg', require('telescope.builtin').live_grep, { desc = '[S]earch by [G]rep' }) vim.keymap.set('n', 'sd', require('telescope.builtin').diagnostics, { desc = '[S]earch [D]iagnostics' }) vim.keymap.set('n', 'sr', require('telescope.builtin').resume, { desc = '[S]earch [R]esume' }) +vim.keymap.set('n', 'sfn', require('telescope.builtin').find_files, { desc = '[S]earch [F]iles [N]o Hidden' }) +vim.keymap.set('n', 'sfh', 'Telescope find_files hidden=true no_ignore=true', { desc = '[S]earch [F]iles [H]idden' }) -- [[ Configure Treesitter ]] -- See `:help nvim-treesitter` @@ -607,6 +635,7 @@ cmp.setup { sources = { { name = 'nvim_lsp' }, { name = 'luasnip' }, + { name = 'vim-dadbod-completion' }, }, } @@ -629,3 +658,11 @@ wilder.setup({modes = {':', '/', '?'}}) -- Unless you are still migrating, remove the deprecated commands from v1.x vim.cmd([[ let g:neo_tree_remove_legacy_commands = 1 ]]) +-- neo_tree +vim.keymap.set('n', 'f', 'Neotree toggle', { desc = 'Toggle NeoTree' }) + +-- database +vim.keymap.set('n', 'nu', 'DBUIToggle', { desc = 'Toggle UI' }) +vim.keymap.set('n', 'nf', 'DBUIFindBuffer', { desc = 'Find buffer' }) +vim.keymap.set('n', 'nr', 'DBUIRenameBuffer', { desc = 'Rename buffer' }) +vim.keymap.set('n', 'nq', 'DBUILastQueryInfo', { desc = 'Last query info' }) -- 2.40.1 From 9682dda16597d15d8c26ffe8213b6de4fe648c68 Mon Sep 17 00:00:00 2001 From: Julian Raufelder Date: Sat, 2 Sep 2023 21:08:05 +0200 Subject: [PATCH 05/12] Add some further keybindinds --- init.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/init.lua b/init.lua index eea6469..7f1163f 100644 --- a/init.lua +++ b/init.lua @@ -646,6 +646,10 @@ cmp.setup { vim.keymap.set('i', 'jj', '', { desc = 'Closes insert mode' }) vim.keymap.set('n', 'ec', ':', { desc = 'Execute command' }) +-- map capital b and e to end/start line, should be default? +vim.keymap.set('n', 'B', '_', { desc = 'Jump to line [B]eginning' }) +vim.keymap.set('n', 'E', '$', { desc = 'Jump to line [E]nding' }) + -- bufferline vim.opt.termguicolors = true require("bufferline").setup{} -- 2.40.1 From 235b9c5f4987398a8bc8f0fd5fcb30b475c106a3 Mon Sep 17 00:00:00 2001 From: Julian Raufelder Date: Sun, 3 Sep 2023 00:41:35 +0200 Subject: [PATCH 06/12] Add some further keybindinds and plugins --- init.lua | 41 +++++++++++++++++++++++++++++++++++------ 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/init.lua b/init.lua index 7f1163f..ba1affd 100644 --- a/init.lua +++ b/init.lua @@ -260,6 +260,14 @@ require('lazy').setup({ 'tpope/vim-dadbod', 'kristijanhusak/vim-dadbod-ui', 'kristijanhusak/vim-dadbod-completion', + { + -- Highlight, edit, and navigate code + 'ThePrimeagen/harpoon', + dependencies = { + 'nvim-lua/plenary.nvim', + }, + }, + 'mbbill/undotree', -- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart -- These are some example plugins that I've included in the kickstart repository. @@ -281,7 +289,7 @@ require('lazy').setup({ -- NOTE: You can change these options as you wish! -- Set highlight on search -vim.o.hlsearch = true +vim.o.hlsearch = false -- Make line numbers default vim.wo.number = true @@ -313,11 +321,6 @@ vim.api.nvim_create_autocmd({ "BufLeave", "FocusLost", "InsertEnter", "CmdlineEn -- Enable mouse mode vim.o.mouse = 'a' --- Sync clipboard between OS and Neovim. --- Remove this option if you want your OS clipboard to remain independent. --- See `:help 'clipboard'` -vim.o.clipboard = 'unnamedplus' - -- Enable break indent vim.o.breakindent = true @@ -646,6 +649,17 @@ cmp.setup { vim.keymap.set('i', 'jj', '', { desc = 'Closes insert mode' }) vim.keymap.set('n', 'ec', ':', { desc = 'Execute command' }) +vim.keymap.set('v', 'J', ":m '>+1gv=gv", { desc = 'Move line down' }) +vim.keymap.set('v', 'K', ":m '<-2gv=gv", { desc = 'Move line up' }) + +vim.keymap.set('x', 'p', "\"_dP", { desc = '[P]aste with previous still in buffer' }) + +vim.keymap.set('n', 'y', "\"+y", { desc = '[Y]ank to system clipboard' }) +vim.keymap.set('v', 'y', "\"+y", { desc = '[Y]ank to system clipboard' }) +vim.keymap.set('n', 'Y', "\"+Y", { desc = '[Y]ank to system clipboard' }) + +vim.keymap.set('n', 'rr', [[:%s/\<\>//gI]], { desc = '[R]ename by [R]egex pattern' }) + -- map capital b and e to end/start line, should be default? vim.keymap.set('n', 'B', '_', { desc = 'Jump to line [B]eginning' }) vim.keymap.set('n', 'E', '$', { desc = 'Jump to line [E]nding' }) @@ -670,3 +684,18 @@ vim.keymap.set('n', 'nu', 'DBUIToggle', { desc = 'Toggle UI' }) vim.keymap.set('n', 'nf', 'DBUIFindBuffer', { desc = 'Find buffer' }) vim.keymap.set('n', 'nr', 'DBUIRenameBuffer', { desc = 'Rename buffer' }) vim.keymap.set('n', 'nq', 'DBUILastQueryInfo', { desc = 'Last query info' }) + +-- harpoon +local mark = require('harpoon.mark') +local ui = require('harpoon.ui') + +vim.keymap.set('n', 'h', mark.add_file, { desc = 'Add file to harpoon'}) +vim.keymap.set('n', '', ui.toggle_quick_menu, { desc = 'Toggle harpoon quick menu'}) + +vim.keymap.set('n', '', function () ui.nav_file(1) end, { desc = 'Harpoon file 1'}) +vim.keymap.set('n', '', function () ui.nav_file(2) end, { desc = 'Harpoon file 2'}) +vim.keymap.set('n', '', function () ui.nav_file(3) end, { desc = 'Harpoon file 3'}) +vim.keymap.set('n', '', function () ui.nav_file(4) end, { desc = 'Harpoon file 4'}) + +-- undotree +vim.keymap.set('n', 'u', vim.cmd.UndotreeToggle , { desc = 'Toggle Undotree'}) -- 2.40.1 From b09370df8374b83e3e4609e50532913db977d3b4 Mon Sep 17 00:00:00 2001 From: Julian Raufelder Date: Tue, 12 Sep 2023 23:50:18 +0200 Subject: [PATCH 07/12] Remove bufferline and add vim-surround and vim-commentary --- init.lua | 14 ++------------ lazy-lock.json | 5 +---- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/init.lua b/init.lua index ba1affd..8645134 100644 --- a/init.lua +++ b/init.lua @@ -215,9 +215,6 @@ require('lazy').setup({ build = ':TSUpdate', }, - -- Bufferline shows tab - {'akinsho/bufferline.nvim', version = "*", dependencies = 'nvim-tree/nvim-web-devicons'}, - -- List entered commands {'gelguy/wilder.nvim', version = "*", config = function() end }, -- File browser { @@ -243,14 +240,9 @@ require('lazy').setup({ {'folke/noice.nvim', event = 'VeryLazy', opts = { - -- add any options here }, dependencies = { - -- if you lazy-load any plugin below, make sure to add proper `module="..."` entries 'MunifTanjim/nui.nvim', - -- OPTIONAL: - -- `nvim-notify` is only needed, if you want to use the notification view. - -- If not available, we use `mini` as the fallback 'rcarriga/nvim-notify', } }, @@ -268,6 +260,8 @@ require('lazy').setup({ }, }, 'mbbill/undotree', + 'tpope/vim-surround', + 'tpope/vim-commentary', -- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart -- These are some example plugins that I've included in the kickstart repository. @@ -664,10 +658,6 @@ vim.keymap.set('n', 'rr', [[:%s/\<\>//gI vim.keymap.set('n', 'B', '_', { desc = 'Jump to line [B]eginning' }) vim.keymap.set('n', 'E', '$', { desc = 'Jump to line [E]nding' }) --- bufferline -vim.opt.termguicolors = true -require("bufferline").setup{} - -- wilder local wilder = require('wilder') wilder.setup({modes = {':', '/', '?'}}) diff --git a/lazy-lock.json b/lazy-lock.json index 6faf46a..3063636 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,12 +1,12 @@ { "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, "LuaSnip": { "branch": "master", "commit": "cdbf6f41381e5ee4810b4b09284b603d8f18365d" }, + "bufferline.nvim": { "branch": "main", "commit": "6ecd37e0fa8b156099daedd2191130e083fb1490" }, "cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, "fidget.nvim": { "branch": "main", "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" }, "friendly-snippets": { "branch": "main", "commit": "43727c2ff84240e55d4069ec3e6158d74cb534b6" }, "gitsigns.nvim": { "branch": "main", "commit": "ff01d34daaed72f271a8ffa088a7e839a60c640f" }, - "harpoon": { "branch": "master", "commit": "c1aebbad9e3d13f20bedb8f2ce8b3a94e39e424a" }, "indent-blankline.nvim": { "branch": "master", "commit": "1bee85e1789f61e5ee54e5a18f8fa193099dca99" }, "lazy.nvim": { "branch": "main", "commit": "73fbf5ccabd0233653bdeb4bb2b07fcfa97b57e0" }, "lualine.nvim": { "branch": "master", "commit": "45e27ca739c7be6c49e5496d14fcf45a303c3a63" }, @@ -27,15 +27,12 @@ "plenary.nvim": { "branch": "master", "commit": "9ce85b0f7dcfe5358c0be937ad23e456907d410b" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" }, "telescope.nvim": { "branch": "0.1.x", "commit": "7011eaae0ac1afe036e30c95cf80200b8dc3f21a" }, - "undotree": { "branch": "master", "commit": "0e11ba7325efbbb3f3bebe06213afa3e7ec75131" }, - "vim-commentary": { "branch": "master", "commit": "e87cd90dc09c2a203e13af9704bd0ef79303d755" }, "vim-dadbod": { "branch": "master", "commit": "ee7e3bb5377d43cb31a101718dd0cfc09bb87d4b" }, "vim-dadbod-completion": { "branch": "master", "commit": "fc7321a17f4c55db11fae89a884ddf4724020bae" }, "vim-dadbod-ui": { "branch": "master", "commit": "95fd22469507e86b78aa55d868c14108adee2881" }, "vim-fugitive": { "branch": "master", "commit": "cbe9dfa162c178946afa689dd3f42d4ea8bf89c1" }, "vim-rhubarb": { "branch": "master", "commit": "ee69335de176d9325267b0fd2597a22901d927b1" }, "vim-sleuth": { "branch": "master", "commit": "1cc4557420f215d02c4d2645a748a816c220e99b" }, - "vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, "vim-tmux-navigator": { "branch": "master", "commit": "7db70e08ea03b3e4d91f63713d76134512e28d7e" }, "which-key.nvim": { "branch": "main", "commit": "7ccf476ebe0445a741b64e36c78a682c1c6118b7" }, "wilder.nvim": { "branch": "master", "commit": "679f348dc90d80ff9ba0e7c470c40a4d038dcecf" } -- 2.40.1 From c53c42350d89e9ceb97c7cf65bc7e508fbf6c6d5 Mon Sep 17 00:00:00 2001 From: Julian Raufelder Date: Wed, 11 Oct 2023 11:19:13 +0200 Subject: [PATCH 08/12] Change keybindings --- init.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 8645134..ac6689f 100644 --- a/init.lua +++ b/init.lua @@ -125,6 +125,9 @@ require('lazy').setup({ }, on_attach = function(bufnr) vim.keymap.set('n', 'hp', require('gitsigns').preview_hunk, { buffer = bufnr, desc = 'Preview git hunk' }) + vim.keymap.set('n', 'gp', require('gitsigns').prev_hunk, { buffer = bufnr, desc = '[G]o to [P]revious Hunk' }) + vim.keymap.set('n', 'gn', require('gitsigns').next_hunk, { buffer = bufnr, desc = '[G]o to [N]ext Hunk' }) + vim.keymap.set('n', 'ph', require('gitsigns').preview_hunk, { buffer = bufnr, desc = '[P]review [H]unk' }) -- don't override the built-in and fugitive keymaps local gs = package.loaded.gitsigns @@ -679,10 +682,10 @@ vim.keymap.set('n', 'nq', 'DBUILastQueryInfo', { desc = 'Last q local mark = require('harpoon.mark') local ui = require('harpoon.ui') -vim.keymap.set('n', 'h', mark.add_file, { desc = 'Add file to harpoon'}) +vim.keymap.set('n', 'hh', mark.add_file, { desc = 'Add file to harpoon'}) vim.keymap.set('n', '', ui.toggle_quick_menu, { desc = 'Toggle harpoon quick menu'}) -vim.keymap.set('n', '', function () ui.nav_file(1) end, { desc = 'Harpoon file 1'}) +-- vim.keymap.set('n', '', function () ui.nav_file(1) end, { desc = 'Harpoon file 1'}) vim.keymap.set('n', '', function () ui.nav_file(2) end, { desc = 'Harpoon file 2'}) vim.keymap.set('n', '', function () ui.nav_file(3) end, { desc = 'Harpoon file 3'}) vim.keymap.set('n', '', function () ui.nav_file(4) end, { desc = 'Harpoon file 4'}) -- 2.40.1 From 8171e1dd91fe5ff3a504399682288c95793f341a Mon Sep 17 00:00:00 2001 From: Julian Raufelder Date: Sat, 14 Oct 2023 14:09:44 +0200 Subject: [PATCH 09/12] Fix typo --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index ac6689f..33ffc5e 100644 --- a/init.lua +++ b/init.lua @@ -411,7 +411,7 @@ vim.keymap.set('n', 'sfh', 'Telescope find_files hidden=true no_ign vim.defer_fn(function() require('nvim-treesitter.configs').setup { -- Add languages to be installed here that you want installed for treesitter - ensure_installed = { 'lua', 'python', 'tsx', 'javascript', 'typescript', 'vimdoc', 'vim', 'bash', 'css', 'dockerfile', 'html', 'java', 'kotlin', 'json', 'markdown_inline', 'ruby', 'sql', 'toml', 'vue', 'yam' }, + ensure_installed = { 'lua', 'python', 'tsx', 'javascript', 'typescript', 'vimdoc', 'vim', 'bash', 'css', 'dockerfile', 'html', 'java', 'kotlin', 'json', 'markdown_inline', 'ruby', 'sql', 'toml', 'vue', 'yaml' }, -- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!) auto_install = false, -- 2.40.1 From ca3c4010c223de033d45780592a5012208fe9191 Mon Sep 17 00:00:00 2001 From: Julian Raufelder Date: Sun, 31 Dec 2023 03:29:04 +0100 Subject: [PATCH 10/12] Add copilot --- init.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/init.lua b/init.lua index 1a64836..5de24a3 100644 --- a/init.lua +++ b/init.lua @@ -265,6 +265,7 @@ require('lazy').setup({ 'mbbill/undotree', 'tpope/vim-surround', 'tpope/vim-commentary', + 'github/copilot.vim', -- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart -- These are some example plugins that I've included in the kickstart repository. -- 2.40.1 From 94463cb021ebb0f901fbea81dd65768d13f9aee7 Mon Sep 17 00:00:00 2001 From: Julian Raufelder Date: Sun, 4 Feb 2024 00:48:46 +0100 Subject: [PATCH 11/12] Further enhancements --- ftplugin/java.lua | 5 +++++ init.lua | 29 +++++++++++++++++++---------- lazy-lock.json | 43 ++++++++++++++++++++++--------------------- 3 files changed, 46 insertions(+), 31 deletions(-) create mode 100644 ftplugin/java.lua diff --git a/ftplugin/java.lua b/ftplugin/java.lua new file mode 100644 index 0000000..4c7dcfe --- /dev/null +++ b/ftplugin/java.lua @@ -0,0 +1,5 @@ +local config = { + cmd = {'/usr/bin/jdtls'}, + root_dir = vim.fs.dirname(vim.fs.find({'gradlew', '.git', 'mvnw'}, { upward = true })[1]), +} +require('jdtls').start_or_attach(config) diff --git a/init.lua b/init.lua index 0fd7f5e..a232f40 100644 --- a/init.lua +++ b/init.lua @@ -308,6 +308,7 @@ require('lazy').setup({ 'tpope/vim-surround', 'tpope/vim-commentary', 'github/copilot.vim', + 'mfussenegger/nvim-jdtls', -- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart -- These are some example plugins that I've included in the kickstart repository. @@ -487,6 +488,15 @@ local function telescope_live_grep_open_files() prompt_title = 'Live Grep in Open Files', } end + +local function telescope_find_files_in_current_directory() + local opts = { + hidden = true, + cwd = vim.fn.expand('%:p:h') + } + require('telescope.builtin').find_files(opts) +end + vim.keymap.set('n', 's/', telescope_live_grep_open_files, { desc = '[S]earch [/] in Open Files' }) vim.keymap.set('n', 'ss', require('telescope.builtin').builtin, { desc = '[S]earch [S]elect Telescope' }) vim.keymap.set('n', 'gf', require('telescope.builtin').git_files, { desc = 'Search [G]it [F]iles' }) @@ -496,8 +506,10 @@ vim.keymap.set('n', 'sg', require('telescope.builtin').live_grep, { desc vim.keymap.set('n', 'sG', ':LiveGrepGitRoot', { desc = '[S]earch by [G]rep on Git Root' }) vim.keymap.set('n', 'sd', require('telescope.builtin').diagnostics, { desc = '[S]earch [D]iagnostics' }) vim.keymap.set('n', 'sr', require('telescope.builtin').resume, { desc = '[S]earch [R]esume' }) -vim.keymap.set('n', 'sfn', require('telescope.builtin').find_files, { desc = '[S]earch [F]iles [N]o Hidden' }) -vim.keymap.set('n', 'sfh', 'Telescope find_files hidden=true no_ignore=true', { desc = '[S]earch [F]iles [H]idden' }) + +vim.keymap.set('n', 'ff', require('telescope.builtin').find_files, { desc = '[F]ind [F]iles no Hidden' }) +vim.keymap.set('n', 'fh', 'Telescope find_files hidden=true no_ignore=true', { desc = '[F]ind files [H]idden' }) +vim.keymap.set('n', 'fc', telescope_find_files_in_current_directory, { desc = '[F]ind files in [C]urrent directory' }) -- [[ Configure Treesitter ]] -- See `:help nvim-treesitter` @@ -597,7 +609,7 @@ local on_attach = function(_, bufnr) -- See `:help K` for why this keymap nmap('K', vim.lsp.buf.hover, 'Hover Documentation') - nmap('', vim.lsp.buf.signature_help, 'Signature Documentation') + -- nmap('', vim.lsp.buf.signature_help, 'Signature Documentation') this breaks jumping between buffers in split view -- Lesser used LSP functionality nmap('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration') @@ -617,6 +629,7 @@ end require('which-key').register { ['c'] = { name = '[C]ode', _ = 'which_key_ignore' }, ['d'] = { name = '[D]ocument', _ = 'which_key_ignore' }, + ['f'] = { name = '[F]ind', _ = 'which_key_ignore' }, ['g'] = { name = '[G]it', _ = 'which_key_ignore' }, ['h'] = { name = 'Git [H]unk', _ = 'which_key_ignore' }, ['r'] = { name = '[R]ename', _ = 'which_key_ignore' }, @@ -770,13 +783,8 @@ wilder.setup({modes = {':', '/', '?'}}) vim.cmd([[ let g:neo_tree_remove_legacy_commands = 1 ]]) -- neo_tree -vim.keymap.set('n', 'f', 'Neotree toggle', { desc = 'Toggle NeoTree' }) +vim.keymap.set('n', 'n', 'Neotree toggle', { desc = 'Toggle [N]eoTree' }) --- database -vim.keymap.set('n', 'nu', 'DBUIToggle', { desc = 'Toggle UI' }) -vim.keymap.set('n', 'nf', 'DBUIFindBuffer', { desc = 'Find buffer' }) -vim.keymap.set('n', 'nr', 'DBUIRenameBuffer', { desc = 'Rename buffer' }) -vim.keymap.set('n', 'nq', 'DBUILastQueryInfo', { desc = 'Last query info' }) -- harpoon local mark = require('harpoon.mark') @@ -793,8 +801,9 @@ vim.keymap.set('n', '', function () ui.nav_file(4) end, { desc = 'Harpoon f -- undotree vim.keymap.set('n', 'u', vim.cmd.UndotreeToggle , { desc = 'Toggle Undotree'}) --- copilot disabled by default, enable it by typing :let b:copilot_enabled = 1 +-- copilot disabled by default, enable it by typing :let b:copilot_enabled = 1 or executing ThisIsYourCaptainSpeaking vim.g.copilot_assume_mapped = true vim.api.nvim_exec([[ au BufNewFile,BufRead * let b:copilot_enabled = 0 ]], false) vim.api.nvim_create_user_command('ThisIsYourCaptainSpeaking', 'let b:copilot_enabled = 1', {}) + diff --git a/lazy-lock.json b/lazy-lock.json index ee3545d..0e5a4c9 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,40 +1,41 @@ { "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, - "LuaSnip": { "branch": "master", "commit": "2463d687fe704b76eb0aa3bb34e95f69a5bb0362" }, + "LuaSnip": { "branch": "master", "commit": "2dbef19461198630b3d7c39f414d09fb07d1fdd2" }, "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, - "copilot.vim": { "branch": "release", "commit": "5b19fb001d7f31c4c7c5556d7a97b243bd29f45f" }, - "fidget.nvim": { "branch": "main", "commit": "a4a7edfea37e557dbff5509ee374ffb57051bba9" }, - "friendly-snippets": { "branch": "main", "commit": "53d3df271d031c405255e99410628c26a8f0d2b0" }, - "gitsigns.nvim": { "branch": "main", "commit": "d195f0c35ced5174d3ecce1c4c8ebb3b5bc23fa9" }, + "copilot.vim": { "branch": "release", "commit": "49e0348bfb913fae63ca5ddb987a8bccd193da86" }, + "fidget.nvim": { "branch": "main", "commit": "3a93300c076109d86c7ce35ec67a8034ae6ba9db" }, + "friendly-snippets": { "branch": "main", "commit": "69a2c1675b66e002799f5eef803b87a12f593049" }, + "gitsigns.nvim": { "branch": "main", "commit": "4aaacbf5e5e2218fd05eb75703fe9e0f85335803" }, "harpoon": { "branch": "master", "commit": "ccae1b9bec717ae284906b0bf83d720e59d12b91" }, - "indent-blankline.nvim": { "branch": "master", "commit": "5da5546947f3125dfd6aa85ab21074dc83f776d5" }, - "lazy.nvim": { "branch": "main", "commit": "96584866b9c5e998cbae300594d0ccfd0c464627" }, + "indent-blankline.nvim": { "branch": "master", "commit": "12e92044d313c54c438bd786d11684c88f6f78cd" }, + "lazy.nvim": { "branch": "main", "commit": "747bb955c5bfb2dc5d51280132f00a56a53f9f6d" }, "lualine.nvim": { "branch": "master", "commit": "566b7036f717f3d676362742630518a47f132fff" }, "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "56e435e09f8729af2d41973e81a0db440f8fe9c9" }, - "mason.nvim": { "branch": "main", "commit": "a09da6ac634926a299dd439da08bdb547a8ca011" }, - "neo-tree.nvim": { "branch": "main", "commit": "77d9f484b88fd380386b46ed9206e5374d69d9d8" }, - "neodev.nvim": { "branch": "main", "commit": "7cb4f7f29c6bf6f1d21a37f6dd6d12ba64266b09" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "3ba1b92b771f33256b4969d696b82c8ae7075364" }, + "mason.nvim": { "branch": "main", "commit": "e110bc3be1a7309617cecd77bfe4bf86ba1b8134" }, + "neo-tree.nvim": { "branch": "main", "commit": "2f2d08894bbc679d4d181604c16bb7079f646384" }, + "neodev.nvim": { "branch": "main", "commit": "aaeb44589cab39c2545a328661af355622d68479" }, "noice.nvim": { "branch": "main", "commit": "92433164e2f7118d4122c7674c3834d9511722ba" }, - "nui.nvim": { "branch": "main", "commit": "80445d015d2b5f9af0d9e8bce63d303bc86eda8a" }, + "nui.nvim": { "branch": "main", "commit": "35da9ca1de0fc4dda96c2e214d93d363c145f418" }, "nvim-cmp": { "branch": "main", "commit": "538e37ba87284942c1d76ed38dd497e54e65b891" }, - "nvim-lspconfig": { "branch": "master", "commit": "9bedcfed749755e43fc8bed46f85ce2044fe3b77" }, - "nvim-notify": { "branch": "master", "commit": "ebcdd8219e2a2cbc0a4bef68002f6867f1fde269" }, - "nvim-treesitter": { "branch": "master", "commit": "e49f1e8ef3e8450a8446cb1f2bbb53c919f60b6d" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "0e2d5bd4cbe75849a013901555d436a48c6680cb" }, - "nvim-web-devicons": { "branch": "master", "commit": "808627b8d412b2a6b6fc6eed816fec3557198b01" }, - "onedark.nvim": { "branch": "master", "commit": "c5476a091b0f1b4e853db91c91ff941f848a1cdd" }, + "nvim-jdtls": { "branch": "master", "commit": "66b5ace68a5d1c45fdfb1afa8d847e87af2aa1f8" }, + "nvim-lspconfig": { "branch": "master", "commit": "042aa6b27b8b8d4f4e1bd42de2037c83d676a8a0" }, + "nvim-notify": { "branch": "master", "commit": "80b67b265530632505193553d05127ae7fe09ddd" }, + "nvim-treesitter": { "branch": "master", "commit": "f5a839d1e87fd1782849a98342fd6931c9066c9a" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "19a91a38b02c1c28c14e0ba468d20ae1423c39b2" }, + "nvim-web-devicons": { "branch": "master", "commit": "140edfcf25093e8b321d13e154cbce89ee868ca0" }, + "onedark.nvim": { "branch": "master", "commit": "dc3bad0121298f89b50aaff8599d1946e07eb4c2" }, "plenary.nvim": { "branch": "master", "commit": "55d9fe89e33efd26f532ef20223e5f9430c8b0c0" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" }, "telescope.nvim": { "branch": "0.1.x", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" }, "undotree": { "branch": "master", "commit": "36ff7abb6b60980338344982ad4cdf03f7961ecd" }, - "vim-commentary": { "branch": "master", "commit": "e87cd90dc09c2a203e13af9704bd0ef79303d755" }, + "vim-commentary": { "branch": "master", "commit": "f67e3e67ea516755005e6cccb178bc8439c6d402" }, "vim-dadbod": { "branch": "master", "commit": "738cfc2ea6a1510fe23cba9006fef9291be70f7b" }, "vim-dadbod-completion": { "branch": "master", "commit": "c920cb0ba3dff4b1b0ed373e1c0b3007dec696c2" }, - "vim-dadbod-ui": { "branch": "master", "commit": "9ddb0623e69d696b7a8355b93e3950a8dc6e00a0" }, - "vim-fugitive": { "branch": "master", "commit": "59659093581aad2afacedc81f009ed6a4bfad275" }, + "vim-dadbod-ui": { "branch": "master", "commit": "e99dcfd5162d9b9b4b24a5d035cf114315f1aeec" }, + "vim-fugitive": { "branch": "master", "commit": "854a8df0d06b8d3fcb30fa7f2b08c62b553eee3b" }, "vim-rhubarb": { "branch": "master", "commit": "ee69335de176d9325267b0fd2597a22901d927b1" }, "vim-sleuth": { "branch": "master", "commit": "1cc4557420f215d02c4d2645a748a816c220e99b" }, "vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, -- 2.40.1 From 11dd83e10b3f10640a7436c46ddad5ebc8ef9828 Mon Sep 17 00:00:00 2001 From: Julian Raufelder Date: Sun, 3 Mar 2024 14:15:21 +0100 Subject: [PATCH 12/12] Minor changes --- init.lua | 42 +++++++++++++++++++++++++++++--------- lazy-lock.json | 55 +++++++++++++++++++++++++------------------------- 2 files changed, 60 insertions(+), 37 deletions(-) diff --git a/init.lua b/init.lua index f27886d..dbf5054 100644 --- a/init.lua +++ b/init.lua @@ -314,6 +314,7 @@ require('lazy').setup({ 'tpope/vim-commentary', 'github/copilot.vim', 'mfussenegger/nvim-jdtls', + 'AckslD/nvim-neoclip.lua', -- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart -- These are some example plugins that I've included in the kickstart repository. @@ -494,10 +495,19 @@ local function telescope_live_grep_open_files() } end -local function telescope_find_files_in_current_directory() +local function telescope_find_files_in_home() local opts = { hidden = true, - cwd = vim.fn.expand('%:p:h') + cwd = "/home/julian" + } + require('telescope.builtin').find_files(opts) +end + + +local function telescope_find_files_in_home_hidden() + local opts = { + hidden = true, + cwd = "/home/julian" } require('telescope.builtin').find_files(opts) end @@ -512,9 +522,11 @@ vim.keymap.set('n', 'sG', ':LiveGrepGitRoot', { desc = '[S]earch by vim.keymap.set('n', 'sd', require('telescope.builtin').diagnostics, { desc = '[S]earch [D]iagnostics' }) vim.keymap.set('n', 'sr', require('telescope.builtin').resume, { desc = '[S]earch [R]esume' }) -vim.keymap.set('n', 'ff', require('telescope.builtin').find_files, { desc = '[F]ind [F]iles no Hidden' }) -vim.keymap.set('n', 'fh', 'Telescope find_files hidden=true no_ignore=true', { desc = '[F]ind files [H]idden' }) -vim.keymap.set('n', 'fc', telescope_find_files_in_current_directory, { desc = '[F]ind files in [C]urrent directory' }) +vim.keymap.set('n', 'ff', require('telescope.builtin').find_files, { desc = '[F]ind [F]iles no Hidden in current dir' }) +vim.keymap.set('n', 'fh', 'Telescope find_files hidden=true no_ignore=true', { desc = '[F]ind files [H]idden in current dir' }) +vim.keymap.set('n', 'fg', require('telescope.builtin').git_files, { desc = '[Find] files in [G]it [F]iles' }) +vim.keymap.set('n', 'fr', telescope_find_files_in_home, { desc = '[F]ind files starting in home, hidden' }) +vim.keymap.set('n', 'fs', telescope_find_files_in_home_hidden, { desc = '[F]ind files starting in home, no hidden' }) -- [[ Configure Treesitter ]] -- See `:help nvim-treesitter` @@ -795,8 +807,10 @@ wilder.setup({modes = {':', '/', '?'}}) vim.cmd([[ let g:neo_tree_remove_legacy_commands = 1 ]]) -- neo_tree -vim.keymap.set('n', 'n', 'Neotree toggle', { desc = 'Toggle [N]eoTree' }) +vim.keymap.set('n', 'n', 'Neotree toggle ', { desc = 'Toggle [N]eoTree' }) +vim.keymap.set('n', 'm', 'Neotree float dir=%:p:h:h reveal_file=%:p ', { desc = '[M]odify File NeoTree' }) +vim.keymap.set('n', '', ':Telescope find_files', { desc = 'Toggle [N]eoTree' }) -- harpoon local mark = require('harpoon.mark') @@ -805,10 +819,16 @@ local ui = require('harpoon.ui') vim.keymap.set('n', 'hh', mark.add_file, { desc = 'Add file to harpoon'}) vim.keymap.set('n', '', ui.toggle_quick_menu, { desc = 'Toggle harpoon quick menu'}) --- vim.keymap.set('n', '', function () ui.nav_file(1) end, { desc = 'Harpoon file 1'}) -vim.keymap.set('n', '', function () ui.nav_file(2) end, { desc = 'Harpoon file 2'}) -vim.keymap.set('n', '', function () ui.nav_file(3) end, { desc = 'Harpoon file 3'}) -vim.keymap.set('n', '', function () ui.nav_file(4) end, { desc = 'Harpoon file 4'}) +vim.keymap.set('n', '', function () ui.nav_file(1) end, { desc = 'Harpoon file 1'}) +vim.keymap.set('n', '', function () ui.nav_file(2) end, { desc = 'Harpoon file 2'}) + +-- ctrl+s write +vim.api.nvim_set_keymap('n', '', ':w', {noremap = true, silent = true}) +vim.api.nvim_set_keymap('i', '', ':wi', {noremap = true, silent = true}) + +--- ctrl+q quit +vim.api.nvim_set_keymap('n', '', ':q', {noremap = true, silent = true}) +vim.api.nvim_set_keymap('i', '', ':q', {noremap = true, silent = true}) -- undotree vim.keymap.set('n', 'u', vim.cmd.UndotreeToggle , { desc = 'Toggle Undotree'}) @@ -818,4 +838,6 @@ vim.g.copilot_assume_mapped = true vim.api.nvim_exec([[ au BufNewFile,BufRead * let b:copilot_enabled = 0 ]], false) vim.api.nvim_create_user_command('ThisIsYourCaptainSpeaking', 'let b:copilot_enabled = 1', {}) +require('neoclip').setup() +vim.api.nvim_set_keymap('n', 'cc', ':Telescope neoclip', {noremap = true, silent = true}) diff --git a/lazy-lock.json b/lazy-lock.json index 0e5a4c9..b704eea 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,41 +1,42 @@ { "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, - "LuaSnip": { "branch": "master", "commit": "2dbef19461198630b3d7c39f414d09fb07d1fdd2" }, + "LuaSnip": { "branch": "master", "commit": "f3b3d3446bcbfa62d638b1903ff00a78b2b730a1" }, "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, - "copilot.vim": { "branch": "release", "commit": "49e0348bfb913fae63ca5ddb987a8bccd193da86" }, - "fidget.nvim": { "branch": "main", "commit": "3a93300c076109d86c7ce35ec67a8034ae6ba9db" }, - "friendly-snippets": { "branch": "main", "commit": "69a2c1675b66e002799f5eef803b87a12f593049" }, - "gitsigns.nvim": { "branch": "main", "commit": "4aaacbf5e5e2218fd05eb75703fe9e0f85335803" }, + "copilot.vim": { "branch": "release", "commit": "57a0115908895f465eb3476f03a0aaa7096e8fe1" }, + "fidget.nvim": { "branch": "main", "commit": "60404ba67044c6ab01894dd5bf77bd64ea5e09aa" }, + "friendly-snippets": { "branch": "main", "commit": "dcd4a586439a1c81357d5b9d26319ae218cc9479" }, + "gitsigns.nvim": { "branch": "main", "commit": "2c2463dbd82eddd7dbab881c3a62cfbfbe3c67ae" }, "harpoon": { "branch": "master", "commit": "ccae1b9bec717ae284906b0bf83d720e59d12b91" }, - "indent-blankline.nvim": { "branch": "master", "commit": "12e92044d313c54c438bd786d11684c88f6f78cd" }, - "lazy.nvim": { "branch": "main", "commit": "747bb955c5bfb2dc5d51280132f00a56a53f9f6d" }, - "lualine.nvim": { "branch": "master", "commit": "566b7036f717f3d676362742630518a47f132fff" }, + "indent-blankline.nvim": { "branch": "master", "commit": "821a7acd88587d966f7e464b0b3031dfe7f5680c" }, + "lazy.nvim": { "branch": "main", "commit": "aedcd79811d491b60d0a6577a9c1701063c2a609" }, + "lualine.nvim": { "branch": "master", "commit": "7d131a8d3ba5016229e8a1d08bf8782acea98852" }, "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "3ba1b92b771f33256b4969d696b82c8ae7075364" }, - "mason.nvim": { "branch": "main", "commit": "e110bc3be1a7309617cecd77bfe4bf86ba1b8134" }, - "neo-tree.nvim": { "branch": "main", "commit": "2f2d08894bbc679d4d181604c16bb7079f646384" }, - "neodev.nvim": { "branch": "main", "commit": "aaeb44589cab39c2545a328661af355622d68479" }, - "noice.nvim": { "branch": "main", "commit": "92433164e2f7118d4122c7674c3834d9511722ba" }, - "nui.nvim": { "branch": "main", "commit": "35da9ca1de0fc4dda96c2e214d93d363c145f418" }, - "nvim-cmp": { "branch": "main", "commit": "538e37ba87284942c1d76ed38dd497e54e65b891" }, - "nvim-jdtls": { "branch": "master", "commit": "66b5ace68a5d1c45fdfb1afa8d847e87af2aa1f8" }, - "nvim-lspconfig": { "branch": "master", "commit": "042aa6b27b8b8d4f4e1bd42de2037c83d676a8a0" }, - "nvim-notify": { "branch": "master", "commit": "80b67b265530632505193553d05127ae7fe09ddd" }, - "nvim-treesitter": { "branch": "master", "commit": "f5a839d1e87fd1782849a98342fd6931c9066c9a" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "19a91a38b02c1c28c14e0ba468d20ae1423c39b2" }, - "nvim-web-devicons": { "branch": "master", "commit": "140edfcf25093e8b321d13e154cbce89ee868ca0" }, - "onedark.nvim": { "branch": "master", "commit": "dc3bad0121298f89b50aaff8599d1946e07eb4c2" }, - "plenary.nvim": { "branch": "master", "commit": "55d9fe89e33efd26f532ef20223e5f9430c8b0c0" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "21d33d69a81f6351e5a5f49078b2e4f0075c8e73" }, + "mason.nvim": { "branch": "main", "commit": "3b5068f0fc565f337d67a2d315d935f574848ee7" }, + "neo-tree.nvim": { "branch": "main", "commit": "f3941c57ec85d7bdb44fa53fd858fd80f159018f" }, + "neodev.nvim": { "branch": "main", "commit": "84e0290f5600e8b89c0dfcafc864f45496a53400" }, + "noice.nvim": { "branch": "main", "commit": "bf67d70bd7265d075191e7812d8eb42b9791f737" }, + "nui.nvim": { "branch": "main", "commit": "b81333d12f824dbed5eb231c8a4409a290fdd848" }, + "nvim-cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" }, + "nvim-jdtls": { "branch": "master", "commit": "382b9f625861f47d95876bcfb4c261f3b96077cb" }, + "nvim-lspconfig": { "branch": "master", "commit": "9553725789be682ecd945a527ec552e489ea8534" }, + "nvim-neoclip.lua": { "branch": "main", "commit": "798cd0592a81c185465db3a091a0ff8a21af60fd" }, + "nvim-notify": { "branch": "master", "commit": "5371f4bfc1f6d3adf4fe9d62cd3a9d44356bfd15" }, + "nvim-treesitter": { "branch": "master", "commit": "e3e5ff4ebddcbfa8f5798253ebd1f9b449e8ee69" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "95933e762e28f9d38b572d65e7e4da9d2f4d90cb" }, + "nvim-web-devicons": { "branch": "master", "commit": "4adea17610d140a99c313e3f79a9dc01825d59ae" }, + "onedark.nvim": { "branch": "master", "commit": "1230aaf2a427b2c5b73aba6e4a9a5881d3e69429" }, + "plenary.nvim": { "branch": "master", "commit": "4f71c0c4a196ceb656c824a70792f3df3ce6bb6d" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" }, "telescope.nvim": { "branch": "0.1.x", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" }, - "undotree": { "branch": "master", "commit": "36ff7abb6b60980338344982ad4cdf03f7961ecd" }, + "undotree": { "branch": "master", "commit": "9dbbf3b7d19dda0d22ceca461818e4739ad8154d" }, "vim-commentary": { "branch": "master", "commit": "f67e3e67ea516755005e6cccb178bc8439c6d402" }, - "vim-dadbod": { "branch": "master", "commit": "738cfc2ea6a1510fe23cba9006fef9291be70f7b" }, + "vim-dadbod": { "branch": "master", "commit": "acb78e078dc4fe1e997ebf006be17aa3766d2ef4" }, "vim-dadbod-completion": { "branch": "master", "commit": "c920cb0ba3dff4b1b0ed373e1c0b3007dec696c2" }, - "vim-dadbod-ui": { "branch": "master", "commit": "e99dcfd5162d9b9b4b24a5d035cf114315f1aeec" }, - "vim-fugitive": { "branch": "master", "commit": "854a8df0d06b8d3fcb30fa7f2b08c62b553eee3b" }, + "vim-dadbod-ui": { "branch": "master", "commit": "165699c573469e6a95b48d35052f848c340c5911" }, + "vim-fugitive": { "branch": "master", "commit": "840ce4a9d9087cf9c321917dd6dd050ec6c9c49c" }, "vim-rhubarb": { "branch": "master", "commit": "ee69335de176d9325267b0fd2597a22901d927b1" }, "vim-sleuth": { "branch": "master", "commit": "1cc4557420f215d02c4d2645a748a816c220e99b" }, "vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, -- 2.40.1