Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
2ca9c621df
|
@ -2,4 +2,3 @@ tags
|
|||
test.sh
|
||||
.luarc.json
|
||||
nvim
|
||||
lazy-lock.json
|
||||
|
|
64
README.md
64
README.md
|
@ -20,42 +20,56 @@ Distribution Alternatives:
|
|||
|
||||
### Installation
|
||||
|
||||
* Backup your previous configuration (if any exists)
|
||||
> **NOTE**
|
||||
> [Backup](#FAQ) your previous configuration (if any exists)
|
||||
|
||||
### Archive Installation
|
||||
* On the home/landing page for the project find the blue "<> CODE" button click it and select Local > Download ZIP.
|
||||
* Extract the archive to:
|
||||
`~/.config/nvim` (Linux)
|
||||
`~/.config/nvim` (MacOS)
|
||||
`%userprofile%\AppData\Local\nvim\` (Windows)
|
||||
* Ensure your extraction method did not extract with a parent folder. For example in ~/.config/nvim you should have init.lua not another folder called kickstart.nvim.
|
||||
Requirements:
|
||||
* Make sure to review the readmes of the plugins if you are experiencing errors. In particular:
|
||||
* [ripgrep](https://github.com/BurntSushi/ripgrep#installation) is required for multiple [telescope](https://github.com/nvim-telescope/telescope.nvim#suggested-dependencies) pickers.
|
||||
* See [Windows Installation](#Windows-Installation) if you have trouble with `telescope-fzf-native`
|
||||
|
||||
### Git Clone Installation
|
||||
* From a terminal cd/dir to:
|
||||
`~/.config/nvim` (Linux)
|
||||
`~/.config/nvim` (MacOS)
|
||||
`%userprofile%\AppData\Local\nvim\` (Windows)
|
||||
Neovim's configurations are located under the following paths, depending on your OS:
|
||||
|
||||
* run: `git clone https://github.com/nvim-lua/kickstart.nvim.git ~/.config/nvim` OR: `gh repo clone nvim-lua/kickstart.nvim`
|
||||
* Run Neovim (from terminal or shortcut) and allow lazy.nvim to download files and set up the basics.
|
||||
* Once the setup is complete, restart Neovim.
|
||||
* **You're ready to go!**
|
||||
| OS | PATH |
|
||||
| :- | :--- |
|
||||
| Linux | `$XDG_CONFIG_HOME/nvim`, `~/.config/nvim` |
|
||||
| MacOS | `$XDG_CONFIG_HOME/nvim`, '~/.config/nvim` |
|
||||
| Windows | `%userprofile%\AppData\Local\nvim\` |
|
||||
|
||||
* (Recommended/Optional) Fork this repo (so that you have your own copy that you can modify).
|
||||
* Clone the kickstart repo into `$HOME/.config/nvim/` (Linux/Mac) or `%userprofile%\AppData\Local\nvim\` (Windows)
|
||||
* If you don't want to include it as a git repo, you can just clone it and then move the files to this location
|
||||
Clone kickstart.nvim:
|
||||
|
||||
Additional system requirements:
|
||||
- Make sure to review the readmes of the plugins if you are experiencing errors. In particular:
|
||||
- [ripgrep](https://github.com/BurntSushi/ripgrep#installation) is required for multiple [telescope](https://github.com/nvim-telescope/telescope.nvim#suggested-dependencies) pickers.
|
||||
- See [Windows Installation](#Windows-Installation) if you have trouble with `telescope-fzf-native`
|
||||
```sh
|
||||
# on Linux and Mac
|
||||
git clone https://github.com/nvim-lua/kickstart.nvim.git "${XDG_CONFIG_HOME:-$HOME/.config}"/nvim
|
||||
```
|
||||
|
||||
|
||||
```
|
||||
# on Windows
|
||||
git clone https://github.com/nvim-lua/kickstart.nvim.git %userprofile%\AppData\Local\nvim\
|
||||
```
|
||||
|
||||
### Post Installation
|
||||
|
||||
Run the following command and then **you are ready to go**!
|
||||
|
||||
```sh
|
||||
nvim --headless "+Lazy! sync" +qa
|
||||
```
|
||||
|
||||
### Recommended Steps
|
||||
|
||||
[Fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo) this repo (so that you have your own copy that you can modify) and then installing you can install to your machine using the methods above.
|
||||
|
||||
> **NOTE**
|
||||
> Your fork's url will be something like this: `https://github.com/<your_github_username>/kickstart.nvim.git`
|
||||
|
||||
### Configuration And Extension
|
||||
|
||||
* Inside of your copy, feel free to modify any file you like! It's your copy!
|
||||
* Feel free to change any of the default options in `init.lua` to better suit your needs.
|
||||
* For adding plugins, there are 3 primary options:
|
||||
* Add new configuration in `lua/custom/plugins/*` files, which will be auto sourced using `lazy.nvim`
|
||||
* Add new configuration in `lua/custom/plugins/*` files, which will be auto sourced using `lazy.nvim` (uncomment the line importing the `custom/plugins` directory in the `init.lua` file to enable this)
|
||||
* Modify `init.lua` with additional plugins.
|
||||
* Include the `lua/kickstart/plugins/*` files in your configuration.
|
||||
|
||||
|
|
64
init.lua
64
init.lua
|
@ -17,7 +17,9 @@ Kickstart.nvim is a template for your own configuration.
|
|||
a guide. One possible example:
|
||||
- https://learnxinyminutes.com/docs/lua/
|
||||
|
||||
|
||||
And then you can explore or search through `:help lua-guide`
|
||||
- https://neovim.io/doc/user/lua-guide.html
|
||||
|
||||
|
||||
Kickstart Guide:
|
||||
|
@ -110,7 +112,7 @@ require('lazy').setup({
|
|||
-- Useful plugin to show you pending keybinds.
|
||||
{ 'folke/which-key.nvim', opts = {} },
|
||||
{
|
||||
-- Adds git releated signs to the gutter, as well as utilities for managing changes
|
||||
-- Adds git related signs to the gutter, as well as utilities for managing changes
|
||||
'lewis6991/gitsigns.nvim',
|
||||
opts = {
|
||||
-- See `:help gitsigns.txt`
|
||||
|
@ -122,9 +124,20 @@ require('lazy').setup({
|
|||
changedelete = { text = '~' },
|
||||
},
|
||||
on_attach = function(bufnr)
|
||||
vim.keymap.set('n', '<leader>gp', require('gitsigns').prev_hunk, { buffer = bufnr, desc = '[G]o to [P]revious Hunk' })
|
||||
vim.keymap.set('n', '<leader>gn', require('gitsigns').next_hunk, { buffer = bufnr, desc = '[G]o to [N]ext Hunk' })
|
||||
vim.keymap.set('n', '<leader>ph', require('gitsigns').preview_hunk, { buffer = bufnr, desc = '[P]review [H]unk' })
|
||||
vim.keymap.set('n', '<leader>hp', require('gitsigns').preview_hunk, { buffer = bufnr, desc = 'Preview git hunk' })
|
||||
|
||||
-- don't override the built-in and fugitive keymaps
|
||||
local gs = package.loaded.gitsigns
|
||||
vim.keymap.set({'n', 'v'}, ']c', function()
|
||||
if vim.wo.diff then return ']c' end
|
||||
vim.schedule(function() gs.next_hunk() end)
|
||||
return '<Ignore>'
|
||||
end, {expr=true, buffer = bufnr, desc = "Jump to next hunk"})
|
||||
vim.keymap.set({'n', 'v'}, '[c', function()
|
||||
if vim.wo.diff then return '[c' end
|
||||
vim.schedule(function() gs.prev_hunk() end)
|
||||
return '<Ignore>'
|
||||
end, {expr=true, buffer = bufnr, desc = "Jump to previous hunk"})
|
||||
end,
|
||||
},
|
||||
},
|
||||
|
@ -175,18 +188,19 @@ require('lazy').setup({
|
|||
'lukas-reineke/indent-blankline.nvim',
|
||||
-- Enable `lukas-reineke/indent-blankline.nvim`
|
||||
-- See `:help indent_blankline.txt`
|
||||
opts = {
|
||||
char = '┊',
|
||||
show_trailing_blankline_indent = false,
|
||||
},
|
||||
main = "ibl",
|
||||
opts = {},
|
||||
},
|
||||
|
||||
-- "gc" to comment visual regions/lines
|
||||
{ 'numToStr/Comment.nvim', opts = {} },
|
||||
|
||||
-- Fuzzy Finder (files, lsp, etc)
|
||||
{ 'nvim-telescope/telescope.nvim', branch = '0.1.x', dependencies = { 'nvim-lua/plenary.nvim' } },
|
||||
|
||||
{
|
||||
'nvim-telescope/telescope.nvim',
|
||||
branch = '0.1.x',
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
-- Fuzzy Finder Algorithm which requires local dependencies to be built.
|
||||
-- Only load if `make` is available. Make sure you have the system
|
||||
-- requirements installed.
|
||||
|
@ -199,6 +213,8 @@ require('lazy').setup({
|
|||
return vim.fn.executable 'make' == 1
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
-- Highlight, edit, and navigate code
|
||||
|
@ -319,10 +335,13 @@ vim.keymap.set('n', '<leader>sh', require('telescope.builtin').help_tags, { desc
|
|||
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>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' })
|
||||
|
||||
-- [[ Configure Treesitter ]]
|
||||
-- See `:help nvim-treesitter`
|
||||
require('nvim-treesitter.configs').setup {
|
||||
-- Defer Treesitter setup after first render to improve startup time of 'nvim {filename}'
|
||||
vim.defer_fn(function()
|
||||
require('nvim-treesitter.configs').setup {
|
||||
-- Add languages to be installed here that you want installed for treesitter
|
||||
ensure_installed = { 'c', 'lua', 'python', 'rust', 'vimdoc', 'vim' },
|
||||
|
||||
|
@ -384,7 +403,8 @@ require('nvim-treesitter.configs').setup {
|
|||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
end, 0)
|
||||
|
||||
-- Diagnostic keymaps
|
||||
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = "Go to previous diagnostic message" })
|
||||
|
@ -418,7 +438,7 @@ local on_attach = function(_, bufnr)
|
|||
|
||||
nmap('gd', vim.lsp.buf.definition, '[G]oto [D]efinition')
|
||||
nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
|
||||
nmap('gI', vim.lsp.buf.implementation, '[G]oto [I]mplementation')
|
||||
nmap('gI', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation')
|
||||
nmap('<leader>D', vim.lsp.buf.type_definition, 'Type [D]efinition')
|
||||
nmap('<leader>ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols')
|
||||
nmap('<leader>ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols')
|
||||
|
@ -441,17 +461,32 @@ local on_attach = function(_, bufnr)
|
|||
end, { desc = 'Format current buffer with LSP' })
|
||||
end
|
||||
|
||||
-- document existing key chains
|
||||
require('which-key').register({
|
||||
['<leader>c'] = { name = '[C]ode', _ = 'which_key_ignore' },
|
||||
['<leader>d'] = { name = '[D]ocument', _ = 'which_key_ignore' },
|
||||
['<leader>g'] = { name = '[G]it', _ = 'which_key_ignore' },
|
||||
['<leader>h'] = { name = 'More git', _ = 'which_key_ignore' },
|
||||
['<leader>r'] = { name = '[R]ename', _ = 'which_key_ignore' },
|
||||
['<leader>s'] = { name = '[S]earch', _ = 'which_key_ignore' },
|
||||
['<leader>w'] = { name = '[W]orkspace', _ = 'which_key_ignore' },
|
||||
})
|
||||
|
||||
-- Enable the following language servers
|
||||
-- Feel free to add/remove any LSPs that you want here. They will automatically be installed.
|
||||
--
|
||||
-- Add any additional override configuration in the following tables. They will be passed to
|
||||
-- the `settings` field of the server config. You must look up that documentation yourself.
|
||||
--
|
||||
-- If you want to override the default filetypes that your language server will attach to you can
|
||||
-- define the property 'filetypes' to the map in question.
|
||||
local servers = {
|
||||
clangd = {},
|
||||
-- gopls = {},
|
||||
-- pyright = {},
|
||||
-- rust_analyzer = {},
|
||||
-- tsserver = {},
|
||||
-- html = { filetypes = { 'html', 'twig', 'hbs'} },
|
||||
|
||||
lua_ls = {
|
||||
Lua = {
|
||||
|
@ -481,8 +516,9 @@ mason_lspconfig.setup_handlers {
|
|||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
settings = servers[server_name],
|
||||
filetypes = (servers[server_name] or {}).filetypes,
|
||||
}
|
||||
end,
|
||||
end
|
||||
}
|
||||
|
||||
-- [[ Configure nvim-cmp ]]
|
||||
|
|
Loading…
Reference in New Issue