Merge branch 'master' into my-nvim-config
This commit is contained in:
commit
abbbb99da1
|
|
@ -4,4 +4,9 @@ test.sh
|
|||
nvim
|
||||
|
||||
spell/
|
||||
|
||||
# You can uncomment this yourself if you want to lock the lazy-lock.json,
|
||||
# but for kickstart, it makes sense to leave it ignored.
|
||||
lazy-lock.json
|
||||
|
||||
.DS_Store
|
||||
|
|
|
|||
|
|
@ -4,3 +4,4 @@ indent_type = "Spaces"
|
|||
indent_width = 2
|
||||
quote_style = "AutoPreferSingle"
|
||||
call_parentheses = "None"
|
||||
collapse_simple_statement = "Always"
|
||||
|
|
|
|||
85
README.md
85
README.md
|
|
@ -17,7 +17,14 @@ A starting point for Neovim that is:
|
|||
Kickstart.nvim targets *only* the latest
|
||||
['stable'](https://github.com/neovim/neovim/releases/tag/stable) and latest
|
||||
['nightly'](https://github.com/neovim/neovim/releases/tag/nightly) of Neovim.
|
||||
If you are experiencing issues, please make sure you have the latest versions.
|
||||
If you are experiencing issues, please make sure you have at least the latest
|
||||
stable version. Most likely, you want to install neovim via a [package
|
||||
manager](https://github.com/neovim/neovim/blob/master/INSTALL.md#install-from-package).
|
||||
To check your neovim version, run `nvim --version` and make sure it is not
|
||||
below the latest
|
||||
['stable'](https://github.com/neovim/neovim/releases/tag/stable) version. If
|
||||
your chosen install method only gives you an outdated version of neovim, find
|
||||
alternative [installation methods below](#alternative-neovim-installation-methods).
|
||||
|
||||
### Install External Dependencies
|
||||
|
||||
|
|
@ -154,7 +161,7 @@ examples of adding popularly requested plugins.
|
|||
|
||||
Below you can find OS specific install instructions for Neovim and dependencies.
|
||||
|
||||
After installing all the dependencies continue with the [Install Kickstart](#Install-Kickstart) step.
|
||||
After installing all the dependencies continue with the [Install Kickstart](#install-kickstart) step.
|
||||
|
||||
#### Windows Installation
|
||||
|
||||
|
|
@ -239,3 +246,77 @@ sudo pacman -S --noconfirm --needed gcc make git ripgrep fd unzip neovim
|
|||
```
|
||||
</details>
|
||||
|
||||
### Alternative neovim installation methods
|
||||
|
||||
For some systems it is not unexpected that the [package manager installation
|
||||
method](https://github.com/neovim/neovim/blob/master/INSTALL.md#install-from-package)
|
||||
recommended by neovim is significantly behind. If that is the case for you,
|
||||
pick one of the following methods that are known to deliver fresh neovim versions very quickly.
|
||||
They have been picked for their popularity and because they make installing and updating
|
||||
neovim to the latest versions easy. You can also find more detail about the
|
||||
available methods being discussed
|
||||
[here](https://github.com/nvim-lua/kickstart.nvim/issues/1583).
|
||||
|
||||
|
||||
<details><summary>Bob</summary>
|
||||
|
||||
[Bob](https://github.com/MordechaiHadad/bob) is a Neovim version manager for
|
||||
all plattforms. Simply install
|
||||
[rustup](https://rust-lang.github.io/rustup/installation/other.html),
|
||||
and run the following commands:
|
||||
|
||||
```bash
|
||||
rustup default stable
|
||||
rustup update stable
|
||||
cargo install bob-nvim
|
||||
bob use stable
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<details><summary>Homebrew</summary>
|
||||
|
||||
[Homebrew](https://brew.sh) is a package manager popular on Mac and Linux.
|
||||
Simply install using [`brew install`](https://formulae.brew.sh/formula/neovim).
|
||||
|
||||
</details>
|
||||
|
||||
<details><summary>Flatpak</summary>
|
||||
|
||||
Flatpak is a package manager for applications that allows developers to package their applications
|
||||
just once to make it available on all Linux systems. Simply [install flatpak](https://flatpak.org/setup/)
|
||||
and setup [flathub](https://flathub.org/setup) to [install neovim](https://flathub.org/apps/io.neovim.nvim).
|
||||
|
||||
</details>
|
||||
|
||||
<details><summary>asdf and mise-en-place</summary>
|
||||
|
||||
[asdf](https://asdf-vm.com/) and [mise](https://mise.jdx.dev/) are tool version managers,
|
||||
mostly aimed towards project-specific tool versioning. However both support managing tools
|
||||
globally in the user-space as well:
|
||||
|
||||
<details><summary>mise</summary>
|
||||
|
||||
[Install mise](https://mise.jdx.dev/getting-started.html), then run:
|
||||
|
||||
```bash
|
||||
mise plugins install neovim
|
||||
mise use neovim@stable
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<details><summary>asdf</summary>
|
||||
|
||||
[Install asdf](https://asdf-vm.com/guide/getting-started.html), then run:
|
||||
|
||||
```bash
|
||||
asdf plugin add neovim
|
||||
asdf install neovim stable
|
||||
asdf set neovim stable --home
|
||||
asdf reshim neovim
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
</details>
|
||||
|
|
|
|||
73
init.lua
73
init.lua
|
|
@ -33,9 +33,7 @@ vim.o.showmode = false
|
|||
-- Sync clipboard between OS and Neovim.
|
||||
-- Schedule the setting after `UiEnter` because it can increase startup-time.
|
||||
-- See `:help 'clipboard'`
|
||||
vim.schedule(function()
|
||||
vim.o.clipboard = 'unnamedplus'
|
||||
end)
|
||||
vim.schedule(function() vim.o.clipboard = 'unnamedplus' end)
|
||||
|
||||
vim.o.breakindent = true -- Enable break indent
|
||||
vim.o.undofile = true -- Save undo history
|
||||
|
|
@ -64,7 +62,7 @@ vim.o.splitbelow = true
|
|||
-- Notice listchars is set using `vim.opt` instead of `vim.o`.
|
||||
-- It is very similar to `vim.o` but offers an interface for conveniently interacting with tables.
|
||||
-- See `:help lua-options`
|
||||
-- and `:help lua-options-guide`
|
||||
-- and `:help lua-guide-options`
|
||||
vim.o.list = true
|
||||
vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' }
|
||||
|
||||
|
|
@ -96,7 +94,22 @@ vim.o.confirm = true
|
|||
-- See `:help hlsearch`
|
||||
vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')
|
||||
|
||||
-- Diagnostic keymaps
|
||||
-- Diagnostic Config & Keymaps
|
||||
-- See :help vim.diagnostic.Opts
|
||||
vim.diagnostic.config {
|
||||
update_in_insert = false,
|
||||
severity_sort = true,
|
||||
float = { border = 'rounded', source = 'if_many' },
|
||||
underline = { severity = vim.diagnostic.severity.ERROR },
|
||||
|
||||
-- Can switch between these as you prefer
|
||||
virtual_text = true, -- Text shows up at the end of the line
|
||||
virtual_lines = false, -- Teest shows up underneath the line, with virtual lines
|
||||
|
||||
-- Auto open the float, so you can easily read the errors when jumping with `[d` and `]d`
|
||||
jump = { float = true },
|
||||
}
|
||||
|
||||
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' })
|
||||
|
||||
-- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier
|
||||
|
|
@ -139,9 +152,7 @@ vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper win
|
|||
vim.api.nvim_create_autocmd('TextYankPost', {
|
||||
desc = 'Highlight when yanking (copying) text',
|
||||
group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }),
|
||||
callback = function()
|
||||
vim.hl.on_yank()
|
||||
end,
|
||||
callback = function() vim.hl.on_yank() end,
|
||||
})
|
||||
|
||||
-- Terminal auto command
|
||||
|
|
@ -188,9 +199,7 @@ local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
|
|||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||
local lazyrepo = 'https://github.com/folke/lazy.nvim.git'
|
||||
local out = vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath }
|
||||
if vim.v.shell_error ~= 0 then
|
||||
error('Error cloning lazy.nvim:\n' .. out)
|
||||
end
|
||||
if vim.v.shell_error ~= 0 then error('Error cloning lazy.nvim:\n' .. out) end
|
||||
end
|
||||
|
||||
---@type vim.Option
|
||||
|
|
@ -245,51 +254,15 @@ require('lazy').setup({
|
|||
|
||||
{ -- Useful plugin to show you pending keybinds.
|
||||
'folke/which-key.nvim',
|
||||
event = 'VimEnter', -- Sets the loading event to 'VimEnter'
|
||||
event = 'VimEnter',
|
||||
opts = {
|
||||
-- delay between pressing a key and opening which-key (milliseconds)
|
||||
-- this setting is independent of vim.o.timeoutlen
|
||||
delay = 0,
|
||||
icons = {
|
||||
-- set icon mappings to true if you have a Nerd Font
|
||||
mappings = vim.g.have_nerd_font,
|
||||
-- If you are using a Nerd Font: set icons.keys to an empty table which will use the
|
||||
-- default which-key.nvim defined Nerd Font icons, otherwise define a string table
|
||||
keys = vim.g.have_nerd_font and {} or {
|
||||
Up = '<Up> ',
|
||||
Down = '<Down> ',
|
||||
Left = '<Left> ',
|
||||
Right = '<Right> ',
|
||||
C = '<C-…> ',
|
||||
M = '<M-…> ',
|
||||
D = '<D-…> ',
|
||||
S = '<S-…> ',
|
||||
CR = '<CR> ',
|
||||
Esc = '<Esc> ',
|
||||
ScrollWheelDown = '<ScrollWheelDown> ',
|
||||
ScrollWheelUp = '<ScrollWheelUp> ',
|
||||
NL = '<NL> ',
|
||||
BS = '<BS> ',
|
||||
Space = '<Space> ',
|
||||
Tab = '<Tab> ',
|
||||
F1 = '<F1>',
|
||||
F2 = '<F2>',
|
||||
F3 = '<F3>',
|
||||
F4 = '<F4>',
|
||||
F5 = '<F5>',
|
||||
F6 = '<F6>',
|
||||
F7 = '<F7>',
|
||||
F8 = '<F8>',
|
||||
F9 = '<F9>',
|
||||
F10 = '<F10>',
|
||||
F11 = '<F11>',
|
||||
F12 = '<F12>',
|
||||
},
|
||||
},
|
||||
icons = { mappings = vim.g.have_nerd_font },
|
||||
|
||||
-- Document existing key chains
|
||||
spec = {
|
||||
{ '<leader>s', group = '[S]earch' },
|
||||
{ '<leader>s', group = '[S]earch', mode = { 'n', 'v' } },
|
||||
{ '<leader>t', group = '[T]oggle' },
|
||||
{ '<leader>h', group = 'Git [H]unk', mode = { 'n', 'v' } },
|
||||
},
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ local check_version = function()
|
|||
return
|
||||
end
|
||||
|
||||
if vim.version.ge(vim.version(), '0.10-dev') then
|
||||
if vim.version.ge(vim.version(), '0.11') then
|
||||
vim.health.ok(string.format("Neovim version is: '%s'", verstr))
|
||||
else
|
||||
vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", verstr))
|
||||
|
|
|
|||
|
|
@ -28,52 +28,38 @@ return {
|
|||
-- Basic debugging keymaps, feel free to change to your liking!
|
||||
{
|
||||
'<F5>',
|
||||
function()
|
||||
require('dap').continue()
|
||||
end,
|
||||
function() require('dap').continue() end,
|
||||
desc = 'Debug: Start/Continue',
|
||||
},
|
||||
{
|
||||
'<F1>',
|
||||
function()
|
||||
require('dap').step_into()
|
||||
end,
|
||||
function() require('dap').step_into() end,
|
||||
desc = 'Debug: Step Into',
|
||||
},
|
||||
{
|
||||
'<F2>',
|
||||
function()
|
||||
require('dap').step_over()
|
||||
end,
|
||||
function() require('dap').step_over() end,
|
||||
desc = 'Debug: Step Over',
|
||||
},
|
||||
{
|
||||
'<F3>',
|
||||
function()
|
||||
require('dap').step_out()
|
||||
end,
|
||||
function() require('dap').step_out() end,
|
||||
desc = 'Debug: Step Out',
|
||||
},
|
||||
{
|
||||
'<leader>b',
|
||||
function()
|
||||
require('dap').toggle_breakpoint()
|
||||
end,
|
||||
function() require('dap').toggle_breakpoint() end,
|
||||
desc = 'Debug: Toggle Breakpoint',
|
||||
},
|
||||
{
|
||||
'<leader>B',
|
||||
function()
|
||||
require('dap').set_breakpoint(vim.fn.input 'Breakpoint condition: ')
|
||||
end,
|
||||
function() require('dap').set_breakpoint(vim.fn.input 'Breakpoint condition: ') end,
|
||||
desc = 'Debug: Set Breakpoint',
|
||||
},
|
||||
-- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception.
|
||||
{
|
||||
'<F7>',
|
||||
function()
|
||||
require('dapui').toggle()
|
||||
end,
|
||||
function() require('dapui').toggle() end,
|
||||
desc = 'Debug: See last session result.',
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -34,12 +34,8 @@ return {
|
|||
|
||||
-- Actions
|
||||
-- visual mode
|
||||
map('v', '<leader>hs', function()
|
||||
gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' }
|
||||
end, { desc = 'git [s]tage hunk' })
|
||||
map('v', '<leader>hr', function()
|
||||
gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' }
|
||||
end, { desc = 'git [r]eset hunk' })
|
||||
map('v', '<leader>hs', function() gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' } end, { desc = 'git [s]tage hunk' })
|
||||
map('v', '<leader>hr', function() gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' } end, { desc = 'git [r]eset hunk' })
|
||||
-- normal mode
|
||||
map('n', '<leader>hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' })
|
||||
map('n', '<leader>hr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' })
|
||||
|
|
@ -49,9 +45,7 @@ return {
|
|||
map('n', '<leader>hp', gitsigns.preview_hunk, { desc = 'git [p]review hunk' })
|
||||
map('n', '<leader>hb', gitsigns.blame_line, { desc = 'git [b]lame line' })
|
||||
map('n', '<leader>hd', gitsigns.diffthis, { desc = 'git [d]iff against index' })
|
||||
map('n', '<leader>hD', function()
|
||||
gitsigns.diffthis '@'
|
||||
end, { desc = 'git [D]iff against last commit' })
|
||||
map('n', '<leader>hD', function() gitsigns.diffthis '@' end, { desc = 'git [D]iff against last commit' })
|
||||
-- Toggles
|
||||
map('n', '<leader>tb', gitsigns.toggle_current_line_blame, { desc = '[T]oggle git show [b]lame line' })
|
||||
map('n', '<leader>tD', gitsigns.preview_hunk_inline, { desc = '[T]oggle git show [D]eleted' })
|
||||
|
|
|
|||
|
|
@ -50,9 +50,7 @@ return {
|
|||
-- Only run the linter in buffers that you can modify in order to
|
||||
-- avoid superfluous noise, notably within the handy LSP pop-ups that
|
||||
-- describe the hovered symbol using Markdown.
|
||||
if vim.bo.modifiable then
|
||||
lint.try_lint()
|
||||
end
|
||||
if vim.bo.modifiable then lint.try_lint() end
|
||||
end,
|
||||
})
|
||||
end,
|
||||
|
|
|
|||
Loading…
Reference in New Issue