Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update from kickstart #1

Merged
merged 39 commits into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
957655d
Make init.lua copy-paste friendly
kdheepak Jul 1, 2023
a73b2e5
docs: Update README.md 📚
kdheepak Jul 1, 2023
93ef2e8
correct typo
andres-lowrie Jul 7, 2023
b5d19fd
Merge pull request #362 from andres-lowrie/patch-1
feoh Jul 7, 2023
55aa0ea
Merge pull request #358 from kdheepak/patch-2
feoh Jul 7, 2023
7a95318
Merge pull request #357 from kdheepak/patch-1
feoh Jul 7, 2023
31f867a
Remove timeout
srcrip Jul 17, 2023
680e085
Merge pull request #367 from sevensidedmarble/remove-timeout
feoh Jul 17, 2023
78ab7ee
Add hint to uncomment line to autodetect plugins
dennisrall Jul 20, 2023
c151235
Remove fixed line number and describe line
dennisrall Jul 20, 2023
7da1058
Merge pull request #369 from Dennis-Rall/patch-2
feoh Jul 22, 2023
29aa5bf
setup more language servers i use + allow customizing filetypes
Numkil Jul 24, 2023
ea028fe
Merge pull request #373 from Numkil/patch-1
feoh Jul 24, 2023
734cc4e
Fix bug when server not explicitely defined in configuration but inst…
Numkil Jul 25, 2023
3dc1c1c
Merge pull request #376 from Numkil/patch-bug
feoh Jul 25, 2023
c2fb482
Fix typo in init.lua
eltociear Jul 30, 2023
9dcf923
Merge pull request #380 from eltociear/patch-1
feoh Jul 30, 2023
b06980a
fix(init): turn telescope-fzf-native into a dependecy
pbnj Aug 6, 2023
8ee4d24
fix: fix brackets
pbnj Aug 6, 2023
5a59fb8
Merge pull request #384 from pbnj/fix/telescope-fzf-native-as-dependency
feoh Aug 6, 2023
a4ec83a
fix: missing comma
daanrongen Aug 6, 2023
f6d67b6
Merge pull request #387 from daanrongen/master
feoh Aug 6, 2023
d0b47ce
Update init.lua
smiggiddy Aug 10, 2023
98ad2ee
Merge pull request #395 from smiggiddy/smiggiddy-patch-1
feoh Aug 10, 2023
555dd8e
Fix typo in README.md
ErikKarlgren Aug 19, 2023
01a1ebe
Merge pull request #402 from ErikKarlgren/fix-readme-typo
feoh Aug 19, 2023
f00ff6f
Use telescope for goto implementation
e-aakash Aug 20, 2023
1283a0b
Update init.lua
feoh Aug 21, 2023
38a0f03
Revert gitsigns keymaps but fix vimdiff and fugitive conflict
gangelop Aug 22, 2023
a347bb4
treesitter: ensure 'javascript' installed along with typescript and tsx
gangelop Aug 27, 2023
1a971cb
Merge pull request #410 from gangelop/TSInstall-javascript
feoh Aug 29, 2023
ac9b167
Add telescope search resume key binding
dilshod Sep 4, 2023
f3f6a59
docs: restructure README
saccarosium Sep 5, 2023
304b244
Merge pull request #419 from dilshod/patch-1
feoh Sep 5, 2023
c010cc7
Merge pull request #406 from gangelop/git-keymaps
feoh Sep 6, 2023
6453352
Merge pull request #404 from e-aakash/lsp-goto-implementation
feoh Sep 7, 2023
c80a774
Merge pull request #420 from saccarosium/master
feoh Sep 7, 2023
24885f2
docs: remove archive installation
saccarosium Sep 7, 2023
4b31f8e
Merge pull request #422 from saccarosium/master
feoh Sep 13, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 38 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# kickstart.nvim

https://github.com/kdheepak/kickstart.nvim/assets/1813121/f3ff9a2b-c31f-44df-a4fa-8a0d7b17cf7b

### Introduction

A starting point for Neovim that is:
Expand All @@ -9,7 +11,7 @@ A starting point for Neovim that is:
* Documented
* Modular

This repo is meant to be used as by **YOU** to begin your Neovim journey; remove the things you don't use and add what you miss.
This repo is meant to be used by **YOU** to begin your Neovim journey; remove the things you don't use and add what you miss.

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.

Expand All @@ -18,42 +20,52 @@ Distribution Alternatives:

### Installation

* Backup your previous configuration (if any exists)
> **NOTE**
> [Backup](#FAQ) your previous configuration (if any exists)

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`

Neovim's configurations are located under the following paths, depending on your OS:

### 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.
| OS | PATH |
| :- | :--- |
| Linux | `$XDG_CONFIG_HOME/nvim`, `~/.config/nvim` |
| MacOS | `$XDG_CONFIG_HOME/nvim`, '~/.config/nvim` |
| Windows | `%userprofile%\AppData\Local\nvim\` |

### Git Clone Installation
* From a terminal cd/dir to:
`~/.config/nvim` (Linux)
`~/.config/nvim` (MacOS)
`%userprofile%\AppData\Local\nvim\` (Windows)
Clone kickstart.nvim:

```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
```

* 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!**
### Recommended Steps

* (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
[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.

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`
> **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.

Expand Down
68 changes: 46 additions & 22 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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`
Expand All @@ -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,
},
},
Expand Down Expand Up @@ -167,19 +180,24 @@ require('lazy').setup({
{ 'numToStr/Comment.nvim', opts = {} },

-- Fuzzy Finder (files, lsp, etc)
{ '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.
{
'nvim-telescope/telescope-fzf-native.nvim',
-- NOTE: If you are having trouble with this installation,
-- refer to the README for telescope-fzf-native for more instructions.
build = 'make',
cond = function()
return vim.fn.executable 'make' == 1
end,
'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.
{
'nvim-telescope/telescope-fzf-native.nvim',
-- NOTE: If you are having trouble with this installation,
-- refer to the README for telescope-fzf-native for more instructions.
build = 'make',
cond = function()
return vim.fn.executable 'make' == 1
end,
},
},
},

{
Expand All @@ -197,12 +215,13 @@ require('lazy').setup({
-- require 'kickstart.plugins.autoformat',
-- require 'kickstart.plugins.debug',

-- NOTE: The import below automatically adds your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
-- You can use this folder to prevent any conflicts with this init.lua if you're interested in keeping
-- up-to-date with whatever is in the kickstart repo.
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
--
-- For additional information see: https://github.com/folke/lazy.nvim#-structuring-your-plugins
{ import = 'custom.plugins' },
-- { import = 'custom.plugins' },
}, {})

-- [[ Setting options ]]
Expand Down Expand Up @@ -238,7 +257,6 @@ vim.wo.signcolumn = 'yes'

-- Decrease update time
vim.o.updatetime = 250
vim.o.timeout = true
vim.o.timeoutlen = 300

-- Set completeopt to have a better completion experience
Expand Down Expand Up @@ -301,12 +319,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]resume' })

-- [[ Configure Treesitter ]]
-- See `:help nvim-treesitter`
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', 'typescript', 'vimdoc', 'vim' },
ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'javascript', 'typescript', 'vimdoc', 'vim' },

-- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!)
auto_install = false,
Expand Down Expand Up @@ -396,7 +415,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')
Expand Down Expand Up @@ -424,12 +443,16 @@ end
--
-- 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 = {
Expand Down Expand Up @@ -459,8 +482,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 ]]
Expand Down