main #2
			
				
			
		
		
		
	|  | @ -0,0 +1,18 @@ | ||||||
|  | # Check Lua Formatting | ||||||
|  | name: Check Lua Formatting | ||||||
|  | on: pull_request | ||||||
|  | 
 | ||||||
|  | jobs: | ||||||
|  |   stylua-check: | ||||||
|  |     name: Stylua Check | ||||||
|  |     runs-on: ubuntu-latest | ||||||
|  |     steps: | ||||||
|  |       - name: Checkout Code | ||||||
|  |         uses: actions/checkout@v2 | ||||||
|  |       - name: Stylua Check | ||||||
|  |         uses: JohnnyMorganz/stylua-action@v3 | ||||||
|  |         with: | ||||||
|  |           token: ${{ secrets.GITHUB_TOKEN }} | ||||||
|  |           version: latest | ||||||
|  |           args: --check . | ||||||
|  | 
 | ||||||
							
								
								
									
										40
									
								
								README.md
								
								
								
								
							
							
						
						
									
										40
									
								
								README.md
								
								
								
								
							|  | @ -34,24 +34,38 @@ Neovim's configurations are located under the following paths, depending on your | ||||||
| | :- | :--- | | | :- | :--- | | ||||||
| | Linux | `$XDG_CONFIG_HOME/nvim`, `~/.config/nvim` | | | Linux | `$XDG_CONFIG_HOME/nvim`, `~/.config/nvim` | | ||||||
| | MacOS | `$XDG_CONFIG_HOME/nvim`, `~/.config/nvim` | | | MacOS | `$XDG_CONFIG_HOME/nvim`, `~/.config/nvim` | | ||||||
| | Windows | `%userprofile%\AppData\Local\nvim\` | | | Windows (cmd)| `%userprofile%\AppData\Local\nvim\` | | ||||||
|  | | Windows (powershell)| `$env:USERPROFILE\AppData\Local\nvim\` | | ||||||
| 
 | 
 | ||||||
| Clone kickstart.nvim: | Clone kickstart.nvim: | ||||||
| 
 | 
 | ||||||
|  | - on Linux and Mac | ||||||
| ```sh | ```sh | ||||||
| # on Linux and Mac |  | ||||||
| git clone https://github.com/nvim-lua/kickstart.nvim.git "${XDG_CONFIG_HOME:-$HOME/.config}"/nvim | git clone https://github.com/nvim-lua/kickstart.nvim.git "${XDG_CONFIG_HOME:-$HOME/.config}"/nvim | ||||||
| ``` | ``` | ||||||
| 
 | 
 | ||||||
| 
 | - on Windows (cmd) | ||||||
| ``` | ``` | ||||||
| # on Windows |  | ||||||
| git clone https://github.com/nvim-lua/kickstart.nvim.git %userprofile%\AppData\Local\nvim\  | git clone https://github.com/nvim-lua/kickstart.nvim.git %userprofile%\AppData\Local\nvim\  | ||||||
| ``` | ``` | ||||||
| 
 | 
 | ||||||
|  | - on Windows (powershell) | ||||||
|  | ``` | ||||||
|  | git clone https://github.com/nvim-lua/kickstart.nvim.git $env:USERPROFILE\AppData\Local\nvim\  | ||||||
|  | ``` | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
| ### Post Installation | ### Post Installation | ||||||
| 
 | 
 | ||||||
| Run the following command and then **you are ready to go**! | Start Neovim | ||||||
|  | 
 | ||||||
|  | ```sh | ||||||
|  | nvim | ||||||
|  | ``` | ||||||
|  | 
 | ||||||
|  | The `Lazy` plugin manager will start automatically on the first run and install the configured plugins - as can be seen in the introduction video. After the installation is complete you can press `q` to close the `Lazy` UI and **you are ready to go**! Next time you run nvim `Lazy` will no longer show up. | ||||||
|  | 
 | ||||||
|  | If you would prefer to hide this step and run the plugin sync from the command line, you can use: | ||||||
| 
 | 
 | ||||||
| ```sh | ```sh | ||||||
| nvim --headless "+Lazy! sync" +qa | nvim --headless "+Lazy! sync" +qa | ||||||
|  | @ -141,11 +155,27 @@ Each PR, especially those which increase the line count, should have a descripti | ||||||
|   * You should back it up, then delete all files associated with it. |   * You should back it up, then delete all files associated with it. | ||||||
|   * This includes your existing init.lua and the neovim files in `~/.local` which can be deleted with `rm -rf ~/.local/share/nvim/` |   * This includes your existing init.lua and the neovim files in `~/.local` which can be deleted with `rm -rf ~/.local/share/nvim/` | ||||||
|   * You may also want to look at the [migration guide for lazy.nvim](https://github.com/folke/lazy.nvim#-migration-guide) |   * You may also want to look at the [migration guide for lazy.nvim](https://github.com/folke/lazy.nvim#-migration-guide) | ||||||
|  | * Can I keep my existing configuration in parallel to kickstart? | ||||||
|  |   * Yes! You can use [NVIM_APPNAME](https://neovim.io/doc/user/starting.html#%24NVIM_APPNAME)`=nvim-NAME` to maintain multiple configurations. For example you can install the kickstart configuration in `~/.config/nvim-kickstart` and create an alias: | ||||||
|  |     ``` | ||||||
|  |     alias nvim-kickstart='NVIM_APPNAME="nvim-kickstart" nvim' | ||||||
|  |     ``` | ||||||
|  |     When you run Neovim using `nvim-kickstart` alias it will use the alternative config directory and the matching local directory `~/.local/share/nvim-kickstart`. You can apply this approach to any Neovim distribution that you would like to try out. | ||||||
| * What if I want to "uninstall" this configuration: | * What if I want to "uninstall" this configuration: | ||||||
|   * See [lazy.nvim uninstall](https://github.com/folke/lazy.nvim#-uninstalling) information |   * See [lazy.nvim uninstall](https://github.com/folke/lazy.nvim#-uninstalling) information | ||||||
| * Are there any cool videos about this plugin? | * Are there any cool videos about this plugin? | ||||||
|   * Current iteration of kickstart (coming soon) |   * Current iteration of kickstart (coming soon) | ||||||
|   * Here is one about the previous iteration of kickstart: [video introduction to Kickstart.nvim](https://youtu.be/stqUbv-5u2s). Note the install via init.lua no longer works as specified. Please follow the install instructions in this file instead as they're up to date. |   * Here is one about the previous iteration of kickstart: [video introduction to Kickstart.nvim](https://youtu.be/stqUbv-5u2s). Note the install via init.lua no longer works as specified. Please follow the install instructions in this file instead as they're up to date. | ||||||
|  | * Why is the kickstart `init.lua` a single file? Wouldn't it make sense to split it into multiple files? | ||||||
|  |   * The main purpose of kickstart is to serve as a teaching tool and a reference | ||||||
|  |     configuration that someone can easily `git clone` as a basis for their own. | ||||||
|  |     As you progress in learning Neovim and Lua, you might consider splitting `init.lua` | ||||||
|  |     into smaller parts. A fork of kickstart that does this while maintaining the exact | ||||||
|  |     same functionality is available here: | ||||||
|  |     * [kickstart-modular.nvim](https://github.com/dam9000/kickstart-modular.nvim) | ||||||
|  |   * Discussions on this topic can be found here: | ||||||
|  |     * [Restructure the configuration](https://github.com/nvim-lua/kickstart.nvim/issues/218) | ||||||
|  |     * [Reorganize init.lua into a multi-file setup](https://github.com/nvim-lua/kickstart.nvim/pull/473) | ||||||
| 
 | 
 | ||||||
| ### Windows Installation | ### Windows Installation | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
							
								
								
									
										137
									
								
								init.lua
								
								
								
								
							
							
						
						
									
										137
									
								
								init.lua
								
								
								
								
							|  | @ -37,13 +37,14 @@ I hope you enjoy your Neovim journey, | ||||||
| 
 | 
 | ||||||
| P.S. You can delete this when you're done too. It's your config now :) | P.S. You can delete this when you're done too. It's your config now :) | ||||||
| --]] | --]] | ||||||
|  | 
 | ||||||
| -- Set <space> as the leader key | -- Set <space> as the leader key | ||||||
| -- See `:help mapleader` | -- See `:help mapleader` | ||||||
| --  NOTE: Must happen before plugins are required (otherwise wrong leader will be used) | --  NOTE: Must happen before plugins are required (otherwise wrong leader will be used) | ||||||
| vim.g.mapleader = ' ' | vim.g.mapleader = ' ' | ||||||
| vim.g.maplocalleader = ' ' | vim.g.maplocalleader = ' ' | ||||||
| 
 | 
 | ||||||
| -- Install package manager | -- [[ Install `lazy.nvim` plugin manager ]] | ||||||
| --    https://github.com/folke/lazy.nvim | --    https://github.com/folke/lazy.nvim | ||||||
| --    `:help lazy.nvim.txt` for more info | --    `:help lazy.nvim.txt` for more info | ||||||
| local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim' | local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim' | ||||||
|  | @ -59,6 +60,7 @@ if not vim.loop.fs_stat(lazypath) then | ||||||
| end | end | ||||||
| vim.opt.rtp:prepend(lazypath) | vim.opt.rtp:prepend(lazypath) | ||||||
| 
 | 
 | ||||||
|  | -- [[ Configure plugins ]] | ||||||
| -- NOTE: Here is where you install your plugins. | -- NOTE: Here is where you install your plugins. | ||||||
| --  You can configure plugins using the `config` key. | --  You can configure plugins using the `config` key. | ||||||
| -- | -- | ||||||
|  | @ -81,12 +83,12 @@ require('lazy').setup({ | ||||||
|     'neovim/nvim-lspconfig', |     'neovim/nvim-lspconfig', | ||||||
|     dependencies = { |     dependencies = { | ||||||
|       -- Automatically install LSPs to stdpath for neovim |       -- Automatically install LSPs to stdpath for neovim | ||||||
|       'williamboman/mason.nvim', |       { 'williamboman/mason.nvim', config = true }, | ||||||
|       'williamboman/mason-lspconfig.nvim', |       'williamboman/mason-lspconfig.nvim', | ||||||
| 
 | 
 | ||||||
|       -- Useful status updates for LSP |       -- Useful status updates for LSP | ||||||
|       -- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})` |       -- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})` | ||||||
|       { 'j-hui/fidget.nvim', tag = 'legacy', opts = {} }, |       { 'j-hui/fidget.nvim', opts = {} }, | ||||||
| 
 | 
 | ||||||
|       -- Additional lua configuration, makes nvim stuff amazing! |       -- Additional lua configuration, makes nvim stuff amazing! | ||||||
|       'folke/neodev.nvim', |       'folke/neodev.nvim', | ||||||
|  | @ -103,6 +105,7 @@ require('lazy').setup({ | ||||||
| 
 | 
 | ||||||
|       -- Adds LSP completion capabilities |       -- Adds LSP completion capabilities | ||||||
|       'hrsh7th/cmp-nvim-lsp', |       'hrsh7th/cmp-nvim-lsp', | ||||||
|  |       'hrsh7th/cmp-path', | ||||||
| 
 | 
 | ||||||
|       -- Adds a number of user-friendly snippets |       -- Adds a number of user-friendly snippets | ||||||
|       'rafamadriz/friendly-snippets', |       'rafamadriz/friendly-snippets', | ||||||
|  | @ -131,7 +134,15 @@ require('lazy').setup({ | ||||||
| 
 | 
 | ||||||
|         -- don't override the built-in and fugitive keymaps |         -- don't override the built-in and fugitive keymaps | ||||||
|         local gs = package.loaded.gitsigns |         local gs = package.loaded.gitsigns | ||||||
|         vim.keymap.set({ 'n', 'v' }, ']c', function() | 
 | ||||||
|  |         local function map(mode, l, r, opts) | ||||||
|  |           opts = opts or {} | ||||||
|  |           opts.buffer = bufnr | ||||||
|  |           vim.keymap.set(mode, l, r, opts) | ||||||
|  |         end | ||||||
|  | 
 | ||||||
|  |         -- Navigation | ||||||
|  |         map({ 'n', 'v' }, ']c', function() | ||||||
|           if vim.wo.diff then |           if vim.wo.diff then | ||||||
|             return ']c' |             return ']c' | ||||||
|           end |           end | ||||||
|  | @ -139,8 +150,9 @@ require('lazy').setup({ | ||||||
|             gs.next_hunk() |             gs.next_hunk() | ||||||
|           end) |           end) | ||||||
|           return '<Ignore>' |           return '<Ignore>' | ||||||
|         end, { expr = true, buffer = bufnr, desc = 'Jump to next hunk' }) |         end, { expr = true, desc = 'Jump to next hunk' }) | ||||||
|         vim.keymap.set({ 'n', 'v' }, '[c', function() | 
 | ||||||
|  |         map({ 'n', 'v' }, '[c', function() | ||||||
|           if vim.wo.diff then |           if vim.wo.diff then | ||||||
|             return '[c' |             return '[c' | ||||||
|           end |           end | ||||||
|  | @ -148,7 +160,37 @@ require('lazy').setup({ | ||||||
|             gs.prev_hunk() |             gs.prev_hunk() | ||||||
|           end) |           end) | ||||||
|           return '<Ignore>' |           return '<Ignore>' | ||||||
|         end, { expr = true, buffer = bufnr, desc = 'Jump to previous hunk' }) |         end, { expr = true, desc = 'Jump to previous hunk' }) | ||||||
|  | 
 | ||||||
|  |         -- Actions | ||||||
|  |         -- visual mode | ||||||
|  |         map('v', '<leader>hs', function() | ||||||
|  |           gs.stage_hunk { vim.fn.line '.', vim.fn.line 'v' } | ||||||
|  |         end, { desc = 'stage git hunk' }) | ||||||
|  |         map('v', '<leader>hr', function() | ||||||
|  |           gs.reset_hunk { vim.fn.line '.', vim.fn.line 'v' } | ||||||
|  |         end, { desc = 'reset git hunk' }) | ||||||
|  |         -- normal mode | ||||||
|  |         map('n', '<leader>hs', gs.stage_hunk, { desc = 'git stage hunk' }) | ||||||
|  |         map('n', '<leader>hr', gs.reset_hunk, { desc = 'git reset hunk' }) | ||||||
|  |         map('n', '<leader>hS', gs.stage_buffer, { desc = 'git Stage buffer' }) | ||||||
|  |         map('n', '<leader>hu', gs.undo_stage_hunk, { desc = 'undo stage hunk' }) | ||||||
|  |         map('n', '<leader>hR', gs.reset_buffer, { desc = 'git Reset buffer' }) | ||||||
|  |         map('n', '<leader>hp', gs.preview_hunk, { desc = 'preview git hunk' }) | ||||||
|  |         map('n', '<leader>hb', function() | ||||||
|  |           gs.blame_line { full = false } | ||||||
|  |         end, { desc = 'git blame line' }) | ||||||
|  |         map('n', '<leader>hd', gs.diffthis, { desc = 'git diff against index' }) | ||||||
|  |         map('n', '<leader>hD', function() | ||||||
|  |           gs.diffthis '~' | ||||||
|  |         end, { desc = 'git diff against last commit' }) | ||||||
|  | 
 | ||||||
|  |         -- Toggles | ||||||
|  |         map('n', '<leader>tb', gs.toggle_current_line_blame, { desc = 'toggle git blame line' }) | ||||||
|  |         map('n', '<leader>td', gs.toggle_deleted, { desc = 'toggle git show deleted' }) | ||||||
|  | 
 | ||||||
|  |         -- Text object | ||||||
|  |         map({ 'o', 'x' }, 'ih', ':<C-U>Gitsigns select_hunk<CR>', { desc = 'select git hunk' }) | ||||||
|       end, |       end, | ||||||
|     }, |     }, | ||||||
|   }, |   }, | ||||||
|  | @ -352,6 +394,12 @@ vim.keymap.set({ 'n', 'v' }, '<Space>', '<Nop>', { silent = true }) | ||||||
| vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true }) | vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true }) | ||||||
| vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true }) | vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true }) | ||||||
| 
 | 
 | ||||||
|  | -- Diagnostic keymaps | ||||||
|  | vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous diagnostic message' }) | ||||||
|  | vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next diagnostic message' }) | ||||||
|  | vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, { desc = 'Open floating diagnostic message' }) | ||||||
|  | vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostics list' }) | ||||||
|  | 
 | ||||||
| -- [[ Highlight on yank ]] | -- [[ Highlight on yank ]] | ||||||
| -- See `:help vim.highlight.on_yank()` | -- See `:help vim.highlight.on_yank()` | ||||||
| local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true }) | local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true }) | ||||||
|  | @ -386,6 +434,42 @@ require('telescope').setup { | ||||||
| -- Enable telescope fzf native, if installed | -- Enable telescope fzf native, if installed | ||||||
| pcall(require('telescope').load_extension, 'fzf') | pcall(require('telescope').load_extension, 'fzf') | ||||||
| 
 | 
 | ||||||
|  | -- Telescope live_grep in git root | ||||||
|  | -- Function to find the git root directory based on the current buffer's path | ||||||
|  | local function find_git_root() | ||||||
|  |   -- Use the current buffer's path as the starting point for the git search | ||||||
|  |   local current_file = vim.api.nvim_buf_get_name(0) | ||||||
|  |   local current_dir | ||||||
|  |   local cwd = vim.fn.getcwd() | ||||||
|  |   -- If the buffer is not associated with a file, return nil | ||||||
|  |   if current_file == '' then | ||||||
|  |     current_dir = cwd | ||||||
|  |   else | ||||||
|  |     -- Extract the directory from the current file's path | ||||||
|  |     current_dir = vim.fn.fnamemodify(current_file, ':h') | ||||||
|  |   end | ||||||
|  | 
 | ||||||
|  |   -- Find the Git root directory from the current file's path | ||||||
|  |   local git_root = vim.fn.systemlist('git -C ' .. vim.fn.escape(current_dir, ' ') .. ' rev-parse --show-toplevel')[1] | ||||||
|  |   if vim.v.shell_error ~= 0 then | ||||||
|  |     print 'Not a git repository. Searching on current working directory' | ||||||
|  |     return cwd | ||||||
|  |   end | ||||||
|  |   return git_root | ||||||
|  | end | ||||||
|  | 
 | ||||||
|  | -- Custom live_grep function to search in git root | ||||||
|  | local function live_grep_git_root() | ||||||
|  |   local git_root = find_git_root() | ||||||
|  |   if git_root then | ||||||
|  |     require('telescope.builtin').live_grep { | ||||||
|  |       search_dirs = { git_root }, | ||||||
|  |     } | ||||||
|  |   end | ||||||
|  | end | ||||||
|  | 
 | ||||||
|  | vim.api.nvim_create_user_command('LiveGrepGitRoot', live_grep_git_root, {}) | ||||||
|  | 
 | ||||||
| -- See `:help telescope.builtin` | -- See `:help telescope.builtin` | ||||||
| vim.keymap.set('n', '<leader>?', require('telescope.builtin').oldfiles, { desc = '[?] Find recently opened files' }) | vim.keymap.set('n', '<leader>?', require('telescope.builtin').oldfiles, { desc = '[?] Find recently opened files' }) | ||||||
| vim.keymap.set('n', '<leader><space>', require('telescope.builtin').buffers, { desc = '[ ] Find existing buffers' }) | vim.keymap.set('n', '<leader><space>', require('telescope.builtin').buffers, { desc = '[ ] Find existing buffers' }) | ||||||
|  | @ -397,10 +481,19 @@ vim.keymap.set('n', '<leader>/', function() | ||||||
|   }) |   }) | ||||||
| end, { desc = '[/] Fuzzily search in current buffer' }) | end, { desc = '[/] Fuzzily search in current buffer' }) | ||||||
| 
 | 
 | ||||||
|  | local function telescope_live_grep_open_files() | ||||||
|  |   require('telescope.builtin').live_grep { | ||||||
|  |     grep_open_files = true, | ||||||
|  |     prompt_title = 'Live Grep in Open Files', | ||||||
|  |   } | ||||||
|  | end | ||||||
|  | vim.keymap.set('n', '<leader>s/', telescope_live_grep_open_files, { desc = '[S]earch [/] in Open Files' }) | ||||||
|  | vim.keymap.set('n', '<leader>ss', require('telescope.builtin').builtin, { desc = '[S]earch [S]elect Telescope' }) | ||||||
| vim.keymap.set('n', '<leader>gf', require('telescope.builtin').git_files, { desc = 'Search [G]it [F]iles' }) | vim.keymap.set('n', '<leader>gf', require('telescope.builtin').git_files, { desc = 'Search [G]it [F]iles' }) | ||||||
| vim.keymap.set('n', '<leader>sh', require('telescope.builtin').help_tags, { desc = '[S]earch [H]elp' }) | vim.keymap.set('n', '<leader>sh', require('telescope.builtin').help_tags, { desc = '[S]earch [H]elp' }) | ||||||
| vim.keymap.set('n', '<leader>sw', require('telescope.builtin').grep_string, { desc = '[S]earch current [W]ord' }) | vim.keymap.set('n', '<leader>sw', require('telescope.builtin').grep_string, { desc = '[S]earch current [W]ord' }) | ||||||
| vim.keymap.set('n', '<leader>sg', require('telescope.builtin').live_grep, { desc = '[S]earch by [G]rep' }) | vim.keymap.set('n', '<leader>sg', require('telescope.builtin').live_grep, { desc = '[S]earch by [G]rep' }) | ||||||
|  | vim.keymap.set('n', '<leader>sG', ':LiveGrepGitRoot<cr>', { desc = '[S]earch by [G]rep on Git Root' }) | ||||||
| vim.keymap.set('n', '<leader>sd', require('telescope.builtin').diagnostics, { desc = '[S]earch [D]iagnostics' }) | vim.keymap.set('n', '<leader>sd', require('telescope.builtin').diagnostics, { desc = '[S]earch [D]iagnostics' }) | ||||||
| vim.keymap.set('n', '<leader>sr', require('telescope.builtin').resume, { desc = '[S]earch [R]esume' }) | vim.keymap.set('n', '<leader>sr', require('telescope.builtin').resume, { desc = '[S]earch [R]esume' }) | ||||||
| vim.keymap.set('n', '<leader>sfn', require('telescope.builtin').find_files, { desc = '[S]earch [F]iles [N]o Hidden' }) | vim.keymap.set('n', '<leader>sfn', require('telescope.builtin').find_files, { desc = '[S]earch [F]iles [N]o Hidden' }) | ||||||
|  | @ -475,12 +568,6 @@ vim.defer_fn(function() | ||||||
|   } |   } | ||||||
| end, 0) | end, 0) | ||||||
| 
 | 
 | ||||||
| -- Diagnostic keymaps |  | ||||||
| vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous diagnostic message' }) |  | ||||||
| vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next diagnostic message' }) |  | ||||||
| vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, { desc = 'Open floating diagnostic message' }) |  | ||||||
| vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostics list' }) |  | ||||||
| 
 |  | ||||||
| -- [[ Configure LSP ]] | -- [[ Configure LSP ]] | ||||||
| --  This function gets run when an LSP connects to a particular buffer. | --  This function gets run when an LSP connects to a particular buffer. | ||||||
| local on_attach = function(_, bufnr) | local on_attach = function(_, bufnr) | ||||||
|  | @ -531,11 +618,18 @@ require('which-key').register { | ||||||
|   ['<leader>c'] = { name = '[C]ode', _ = 'which_key_ignore' }, |   ['<leader>c'] = { name = '[C]ode', _ = 'which_key_ignore' }, | ||||||
|   ['<leader>d'] = { name = '[D]ocument', _ = 'which_key_ignore' }, |   ['<leader>d'] = { name = '[D]ocument', _ = 'which_key_ignore' }, | ||||||
|   ['<leader>g'] = { name = '[G]it', _ = 'which_key_ignore' }, |   ['<leader>g'] = { name = '[G]it', _ = 'which_key_ignore' }, | ||||||
|   ['<leader>h'] = { name = 'More git', _ = 'which_key_ignore' }, |   ['<leader>h'] = { name = 'Git [H]unk', _ = 'which_key_ignore' }, | ||||||
|   ['<leader>r'] = { name = '[R]ename', _ = 'which_key_ignore' }, |   ['<leader>r'] = { name = '[R]ename', _ = 'which_key_ignore' }, | ||||||
|   ['<leader>s'] = { name = '[S]earch', _ = 'which_key_ignore' }, |   ['<leader>s'] = { name = '[S]earch', _ = 'which_key_ignore' }, | ||||||
|  |   ['<leader>t'] = { name = '[T]oggle', _ = 'which_key_ignore' }, | ||||||
|   ['<leader>w'] = { name = '[W]orkspace', _ = 'which_key_ignore' }, |   ['<leader>w'] = { name = '[W]orkspace', _ = 'which_key_ignore' }, | ||||||
| } | } | ||||||
|  | -- register which-key VISUAL mode | ||||||
|  | -- required for visual <leader>hs (hunk stage) to work | ||||||
|  | require('which-key').register({ | ||||||
|  |   ['<leader>'] = { name = 'VISUAL <leader>' }, | ||||||
|  |   ['<leader>h'] = { 'Git [H]unk' }, | ||||||
|  | }, { mode = 'v' }) | ||||||
| 
 | 
 | ||||||
| -- mason-lspconfig requires that these setup functions are called in this order | -- mason-lspconfig requires that these setup functions are called in this order | ||||||
| -- before setting up the servers. | -- before setting up the servers. | ||||||
|  | @ -562,6 +656,8 @@ local servers = { | ||||||
|     Lua = { |     Lua = { | ||||||
|       workspace = { checkThirdParty = false }, |       workspace = { checkThirdParty = false }, | ||||||
|       telemetry = { enable = false }, |       telemetry = { enable = false }, | ||||||
|  |       -- NOTE: toggle below to ignore Lua_LS's noisy `missing-fields` warnings | ||||||
|  |       -- diagnostics = { disable = { 'missing-fields' } }, | ||||||
|     }, |     }, | ||||||
|   }, |   }, | ||||||
| } | } | ||||||
|  | @ -604,10 +700,13 @@ cmp.setup { | ||||||
|       luasnip.lsp_expand(args.body) |       luasnip.lsp_expand(args.body) | ||||||
|     end, |     end, | ||||||
|   }, |   }, | ||||||
|  |   completion = { | ||||||
|  |     completeopt = 'menu,menuone,noinsert', | ||||||
|  |   }, | ||||||
|   mapping = cmp.mapping.preset.insert { |   mapping = cmp.mapping.preset.insert { | ||||||
|     ['<C-n>'] = cmp.mapping.select_next_item(), |     ['<C-n>'] = cmp.mapping.select_next_item(), | ||||||
|     ['<C-p>'] = cmp.mapping.select_prev_item(), |     ['<C-p>'] = cmp.mapping.select_prev_item(), | ||||||
|     ['<C-d>'] = cmp.mapping.scroll_docs(-4), |     ['<C-b>'] = cmp.mapping.scroll_docs(-4), | ||||||
|     ['<C-f>'] = cmp.mapping.scroll_docs(4), |     ['<C-f>'] = cmp.mapping.scroll_docs(4), | ||||||
|     ['<C-Space>'] = cmp.mapping.complete {}, |     ['<C-Space>'] = cmp.mapping.complete {}, | ||||||
|     ['<CR>'] = cmp.mapping.confirm { |     ['<CR>'] = cmp.mapping.confirm { | ||||||
|  | @ -636,7 +735,7 @@ cmp.setup { | ||||||
|   sources = { |   sources = { | ||||||
|     { name = 'nvim_lsp' }, |     { name = 'nvim_lsp' }, | ||||||
|     { name = 'luasnip' }, |     { name = 'luasnip' }, | ||||||
|     { name = 'vim-dadbod-completion' }, |     { name = 'path' }, | ||||||
|   }, |   }, | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | @ -693,3 +792,9 @@ vim.keymap.set('n', '<C-s>', function () ui.nav_file(4) end, { desc = 'Harpoon f | ||||||
| 
 | 
 | ||||||
| -- undotree | -- undotree | ||||||
| vim.keymap.set('n', '<leader>u', vim.cmd.UndotreeToggle , { desc = 'Toggle Undotree'}) | vim.keymap.set('n', '<leader>u', vim.cmd.UndotreeToggle , { desc = 'Toggle Undotree'}) | ||||||
|  | 
 | ||||||
|  | -- copilot disabled by default, enable it by typing :let b:copilot_enabled = 1 | ||||||
|  | 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', {}) | ||||||
|  | 
 | ||||||
|  |  | ||||||
|  | @ -1,39 +1,44 @@ | ||||||
| { | { | ||||||
|   "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, |   "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, | ||||||
|   "LuaSnip": { "branch": "master", "commit": "cdbf6f41381e5ee4810b4b09284b603d8f18365d" }, |   "LuaSnip": { "branch": "master", "commit": "2463d687fe704b76eb0aa3bb34e95f69a5bb0362" }, | ||||||
|   "bufferline.nvim": { "branch": "main", "commit": "6ecd37e0fa8b156099daedd2191130e083fb1490" }, |   "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, | ||||||
|   "cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" }, |   "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, | ||||||
|   "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, |   "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, | ||||||
|   "fidget.nvim": { "branch": "main", "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" }, |   "copilot.vim": { "branch": "release", "commit": "5b19fb001d7f31c4c7c5556d7a97b243bd29f45f" }, | ||||||
|   "friendly-snippets": { "branch": "main", "commit": "43727c2ff84240e55d4069ec3e6158d74cb534b6" }, |   "fidget.nvim": { "branch": "main", "commit": "a4a7edfea37e557dbff5509ee374ffb57051bba9" }, | ||||||
|   "gitsigns.nvim": { "branch": "main", "commit": "ff01d34daaed72f271a8ffa088a7e839a60c640f" }, |   "friendly-snippets": { "branch": "main", "commit": "53d3df271d031c405255e99410628c26a8f0d2b0" }, | ||||||
|   "indent-blankline.nvim": { "branch": "master", "commit": "1bee85e1789f61e5ee54e5a18f8fa193099dca99" }, |   "gitsigns.nvim": { "branch": "main", "commit": "d195f0c35ced5174d3ecce1c4c8ebb3b5bc23fa9" }, | ||||||
|   "lazy.nvim": { "branch": "main", "commit": "73fbf5ccabd0233653bdeb4bb2b07fcfa97b57e0" }, |   "harpoon": { "branch": "master", "commit": "ccae1b9bec717ae284906b0bf83d720e59d12b91" }, | ||||||
|   "lualine.nvim": { "branch": "master", "commit": "45e27ca739c7be6c49e5496d14fcf45a303c3a63" }, |   "indent-blankline.nvim": { "branch": "master", "commit": "5da5546947f3125dfd6aa85ab21074dc83f776d5" }, | ||||||
|   "markdown-preview.nvim": { "branch": "master", "commit": "02cc3874738bc0f86e4b91f09b8a0ac88aef8e96" }, |   "lazy.nvim": { "branch": "main", "commit": "96584866b9c5e998cbae300594d0ccfd0c464627" }, | ||||||
|   "mason-lspconfig.nvim": { "branch": "main", "commit": "ddefe5ab051e7ca6a7b374754f0920c44668b54f" }, |   "lualine.nvim": { "branch": "master", "commit": "566b7036f717f3d676362742630518a47f132fff" }, | ||||||
|   "mason.nvim": { "branch": "main", "commit": "cd7835b15f5a4204fc37e0aa739347472121a54c" }, |   "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, | ||||||
|   "neo-tree.nvim": { "branch": "main", "commit": "6f8c49956c89e9fefae6acdfe1d57c6293b0a03d" }, |   "mason-lspconfig.nvim": { "branch": "main", "commit": "56e435e09f8729af2d41973e81a0db440f8fe9c9" }, | ||||||
|   "neodev.nvim": { "branch": "main", "commit": "a4b6e7ca11ff5be2264d5c169fcedd97d8699ec4" }, |   "mason.nvim": { "branch": "main", "commit": "a09da6ac634926a299dd439da08bdb547a8ca011" }, | ||||||
|   "noice.nvim": { "branch": "main", "commit": "fcd01710ff6918d4d3ef90c8e36f3addacba13bf" }, |   "neo-tree.nvim": { "branch": "main", "commit": "77d9f484b88fd380386b46ed9206e5374d69d9d8" }, | ||||||
|   "nui.nvim": { "branch": "main", "commit": "c0c8e347ceac53030f5c1ece1c5a5b6a17a25b32" }, |   "neodev.nvim": { "branch": "main", "commit": "7cb4f7f29c6bf6f1d21a37f6dd6d12ba64266b09" }, | ||||||
|   "nvim-cmp": { "branch": "main", "commit": "5dce1b778b85c717f6614e3f4da45e9f19f54435" }, |   "noice.nvim": { "branch": "main", "commit": "92433164e2f7118d4122c7674c3834d9511722ba" }, | ||||||
|   "nvim-lspconfig": { "branch": "master", "commit": "2b361e043810d5587d9af0787f8ce40da92ec5e9" }, |   "nui.nvim": { "branch": "main", "commit": "80445d015d2b5f9af0d9e8bce63d303bc86eda8a" }, | ||||||
|   "nvim-notify": { "branch": "master", "commit": "e4a2022f4fec2d5ebc79afa612f96d8b11c627b3" }, |   "nvim-cmp": { "branch": "main", "commit": "538e37ba87284942c1d76ed38dd497e54e65b891" }, | ||||||
|   "nvim-treesitter": { "branch": "master", "commit": "e5198778dbefa14823099dd6d8fba3819a5e7b8a" }, |   "nvim-lspconfig": { "branch": "master", "commit": "9bedcfed749755e43fc8bed46f85ce2044fe3b77" }, | ||||||
|   "nvim-treesitter-textobjects": { "branch": "master", "commit": "76c7a89b41de77a4f83fb77fa072c5ad7605fe3b" }, |   "nvim-notify": { "branch": "master", "commit": "ebcdd8219e2a2cbc0a4bef68002f6867f1fde269" }, | ||||||
|   "nvim-web-devicons": { "branch": "master", "commit": "a1e6268779411048a87f767a27380089362a0ce2" }, |   "nvim-treesitter": { "branch": "master", "commit": "e49f1e8ef3e8450a8446cb1f2bbb53c919f60b6d" }, | ||||||
|   "onedark.nvim": { "branch": "master", "commit": "826fb77e9ca92d3c0f3d937328663d4a6dc7fee1" }, |   "nvim-treesitter-textobjects": { "branch": "master", "commit": "0e2d5bd4cbe75849a013901555d436a48c6680cb" }, | ||||||
|   "plenary.nvim": { "branch": "master", "commit": "9ce85b0f7dcfe5358c0be937ad23e456907d410b" }, |   "nvim-web-devicons": { "branch": "master", "commit": "808627b8d412b2a6b6fc6eed816fec3557198b01" }, | ||||||
|  |   "onedark.nvim": { "branch": "master", "commit": "c5476a091b0f1b4e853db91c91ff941f848a1cdd" }, | ||||||
|  |   "plenary.nvim": { "branch": "master", "commit": "55d9fe89e33efd26f532ef20223e5f9430c8b0c0" }, | ||||||
|   "telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" }, |   "telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" }, | ||||||
|   "telescope.nvim": { "branch": "0.1.x", "commit": "7011eaae0ac1afe036e30c95cf80200b8dc3f21a" }, |   "telescope.nvim": { "branch": "0.1.x", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" }, | ||||||
|   "vim-dadbod": { "branch": "master", "commit": "ee7e3bb5377d43cb31a101718dd0cfc09bb87d4b" }, |   "undotree": { "branch": "master", "commit": "36ff7abb6b60980338344982ad4cdf03f7961ecd" }, | ||||||
|   "vim-dadbod-completion": { "branch": "master", "commit": "fc7321a17f4c55db11fae89a884ddf4724020bae" }, |   "vim-commentary": { "branch": "master", "commit": "e87cd90dc09c2a203e13af9704bd0ef79303d755" }, | ||||||
|   "vim-dadbod-ui": { "branch": "master", "commit": "95fd22469507e86b78aa55d868c14108adee2881" }, |   "vim-dadbod": { "branch": "master", "commit": "738cfc2ea6a1510fe23cba9006fef9291be70f7b" }, | ||||||
|   "vim-fugitive": { "branch": "master", "commit": "cbe9dfa162c178946afa689dd3f42d4ea8bf89c1" }, |   "vim-dadbod-completion": { "branch": "master", "commit": "c920cb0ba3dff4b1b0ed373e1c0b3007dec696c2" }, | ||||||
|  |   "vim-dadbod-ui": { "branch": "master", "commit": "9ddb0623e69d696b7a8355b93e3950a8dc6e00a0" }, | ||||||
|  |   "vim-fugitive": { "branch": "master", "commit": "59659093581aad2afacedc81f009ed6a4bfad275" }, | ||||||
|   "vim-rhubarb": { "branch": "master", "commit": "ee69335de176d9325267b0fd2597a22901d927b1" }, |   "vim-rhubarb": { "branch": "master", "commit": "ee69335de176d9325267b0fd2597a22901d927b1" }, | ||||||
|   "vim-sleuth": { "branch": "master", "commit": "1cc4557420f215d02c4d2645a748a816c220e99b" }, |   "vim-sleuth": { "branch": "master", "commit": "1cc4557420f215d02c4d2645a748a816c220e99b" }, | ||||||
|   "vim-tmux-navigator": { "branch": "master", "commit": "7db70e08ea03b3e4d91f63713d76134512e28d7e" }, |   "vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, | ||||||
|   "which-key.nvim": { "branch": "main", "commit": "7ccf476ebe0445a741b64e36c78a682c1c6118b7" }, |   "vim-tmux-navigator": { "branch": "master", "commit": "38b1d0402c4600543281dc85b3f51884205674b6" }, | ||||||
|  |   "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" }, | ||||||
|   "wilder.nvim": { "branch": "master", "commit": "679f348dc90d80ff9ba0e7c470c40a4d038dcecf" } |   "wilder.nvim": { "branch": "master", "commit": "679f348dc90d80ff9ba0e7c470c40a4d038dcecf" } | ||||||
| } | } | ||||||
		Loading…
	
		Reference in New Issue