Compare commits

..

26 Commits

Author SHA1 Message Date
3b09dcae3c abort complete using <C-n> for [n]o 2024-03-17 14:35:15 +01:00
58635733cb use arrow keys for auto complete options 2024-03-17 14:34:59 +01:00
1f144bb7fe Merge remote-tracking branch 'modular/master' 2024-03-17 14:34:39 +01:00
7c92c14124 neotree show hidden files 2024-03-17 13:31:16 +01:00
Damjan 9000
1ac2734841 Merge 'upstream' conform: disable autoformat on save for specified filetypes 2024-03-15 22:10:28 +01:00
Damjan 9000
ea4335f5af
conform: disable autoformat on save for specified filetypes (#694)
Provide a method to disable autoformat on save lsp fallback for
specified filetypes. By default disable for C/C++ as an example,
because it does not have a well standardized coding style.

Based on conform recipe:
https://github.com/stevearc/conform.nvim/blob/master/doc/recipes.md
2024-03-15 16:53:33 -04:00
stgpepper
da1271db4d
Update README.md (#763)
Added file text to code block for consistency since the other plugin had file also inside code block.
2024-03-15 16:51:41 -04:00
Damjan 9000
55008e9c68 Merge 'upstream' timeoutlen, cmp scroll, friendly snippets, luasnip, ruby
Merged:
- fix: disable ts indenting for Ruby
- doc: add note about advanced luasnip features
- Move friendly snippets to dependencies of LuaSnip (#759)
- Add <C-b>/<C-f> cmp mapping to scroll cmp docs (#750)
- doc: add info about timeoutlen (#691)
2024-03-15 18:18:21 +01:00
TJ DeVries
7892c0c354 fix: disable ts indenting for Ruby
Tree-sitter indenting for ruby is pretty terrible.
But the fix requires a few steps, so showed those
and documented how you could do that for other languages
as well (with the tricky part being the
additional_vim_regex_highlighting trick)
2024-03-15 11:35:07 -04:00
TJ DeVries
5ac4b58f85 doc: add note about advanced luasnip features 2024-03-15 11:18:43 -04:00
Vladislav Grechannik
2f494e59ca
Move friendly snippets to dependencies of LuaSnip (#759)
Co-authored-by: TJ DeVries <devries.timothyj@gmail.com>
2024-03-15 10:35:42 -04:00
Rafael Zasas
452e3a73cf
Add <C-b>/<C-f> cmp mapping to scroll cmp docs (#750) 2024-03-15 10:12:41 -04:00
TLW
7715b7c2ee
doc: add info about timeoutlen (#691)
Add separate comment for `timeoutlen` option
`timeoutlen` option was under unrelated comment with `updatetime` option.
2024-03-15 09:54:49 -04:00
Damjan 9000
f02070e076 Merge 'upstream' Added folke/neodev.nvim for proper nvim api completion and annotation 2024-03-12 23:40:44 +01:00
Chris Patti
b529bc3359
Revert "Use cmp-nvim-lua as nvim-cmp source for neovim Lua API (#696)" (#755)
This reverts commit d8a1dbc4b4.
2024-03-12 18:09:47 -04:00
James Karefylakis
d8a1dbc4b4
Use cmp-nvim-lua as nvim-cmp source for neovim Lua API (#696)
* Use cmp-nvim-lua as nvim-cmp source for neovim Lua API

* Move the dependency to a more suitable place
2024-03-12 17:12:35 -04:00
Damjan 9000
000a5c42b0
Added folke/neodev.nvim for proper nvim api completion and annotation (#754)
Fixes nvim-lua/kickstart.nvim#692

`neodev` configures Lua LSP for your Neovim config, runtime and plugins
used for completion, annotations and signatures of Neovim apis

With neodev, there's no more need to manually set lua_ls workspace
settings which don't seem to work properly anyway as currently nvim
api completion does not work.
2024-03-12 17:06:12 -04:00
Damjan 9000
7da09adddb Merge 'upstream' rename <C-t>, use opts for treesitter
- chore: rename <C-T> to <C-t> for consistency

- feat: allow treesitter defaults to be overwritten from custom directory
2024-03-12 01:13:38 +01:00
Chiller Dragon
cb1f16b8ca
chore: rename <C-T> to <C-t> for consistency (#719) 2024-03-11 19:20:39 -04:00
Ryan Baumgardner
c0d6f98924
feat: allow treesitter defaults to be overwritten from custom directory (#732) 2024-03-11 19:18:45 -04:00
Damjan 9000
2238a5d191 Merge 'upstream' README.md: update neo-tree example - remove legacy setting 2024-03-11 23:01:01 +01:00
Damjan 9000
8de494fff2
README.md: update neo-tree example - remove legacy setting (#744) 2024-03-11 17:52:18 -04:00
Damjan 9000
8f85ac8a74 Merge 'upstream' use init for colorscheme 2024-03-10 11:35:10 +01:00
name.tar.xz
3cfccc01be
use init for colorscheme (#715) 2024-03-09 15:25:08 -05:00
Damjan 9000
3b0a5bb641 Merge 'upstream/master' Fix typos and whatnot 2024-03-08 22:13:35 +01:00
Nora Ayesha
8fae6798b9
Fix typos and whatnot (#731) 2024-03-08 15:26:32 -05:00
9 changed files with 121 additions and 100 deletions

View File

@ -83,10 +83,10 @@ current plugin status.
### FAQ ### FAQ
* What should I do if I already have a pre-existing neovim configuration? * What should I do if I already have a pre-existing neovim configuration?
* You should back it up, then delete all files associated with it. * You should back it up and then delete all associated files.
* This includes your existing init.lua and the neovim files in `~/.local` which can be deleted with `rm -rf ~/.local/share/nvim/` or their windows counterparts in `AppData\Local\nvim-data` * This includes your existing init.lua and the neovim files in `~/.local` which can be deleted with `rm -rf ~/.local/share/nvim/` or their windows counterparts in `AppData\Local\nvim-data`
* Can I keep my existing configuration in parallel to kickstart? * 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: * 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:
```sh ```sh
alias nvim-kickstart='NVIM_APPNAME="nvim-kickstart" nvim' alias nvim-kickstart='NVIM_APPNAME="nvim-kickstart" nvim'
``` ```
@ -111,7 +111,7 @@ winget install --accept-source-agreements chocolatey.chocolatey
``` ```
2. install all requirements using choco, exit previous cmd and 2. install all requirements using choco, exit previous cmd and
open a new one so that choco path is set, run in cmd as **admin**: open a new one so that choco path is set, and run in cmd as **admin**:
``` ```
choco install -y neovim git ripgrep wget fd unzip gzip mingw make choco install -y neovim git ripgrep wget fd unzip gzip mingw make
``` ```

View File

@ -13,6 +13,22 @@ return {
'MunifTanjim/nui.nvim', 'MunifTanjim/nui.nvim',
}, },
config = function() config = function()
require('neo-tree').setup {} require('neo-tree').setup {
filesystem = {
filtered_items = {
visible = true,
hide_dotfiles = false,
hide_gitignored = false,
hide_by_name = {
'node_modules',
'.svelte-kit',
'target',
'.git',
'bin',
'obj',
},
},
},
}
end, end,
} }

View File

@ -15,6 +15,7 @@ return {
end end
return 'make install_jsregexp' return 'make install_jsregexp'
end)(), end)(),
dependencies = {},
}, },
'saadparwaiz1/cmp_luasnip', 'saadparwaiz1/cmp_luasnip',
@ -49,15 +50,15 @@ return {
-- --
-- No, but seriously. Please read `:help ins-completion`, it is really good! -- No, but seriously. Please read `:help ins-completion`, it is really good!
mapping = cmp.mapping.preset.insert { mapping = cmp.mapping.preset.insert {
-- Select the [n]ext item -- scroll the documentation window [b]ack / [f]orward
['<C-n>'] = cmp.mapping.select_next_item(), ['<C-b>'] = cmp.mapping.scroll_docs(-4),
-- Select the [p]revious item ['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-p>'] = cmp.mapping.select_prev_item(),
-- Accept ([y]es) the completion. -- Accept ([y]es/[n]o) the completion.
-- This will auto-import if your LSP supports it. -- This will auto-import if your LSP supports it.
-- This will expand snippets if the LSP sent a snippet. -- This will expand snippets if the LSP sent a snippet.
['<C-y>'] = cmp.mapping.confirm { select = true }, ['<C-y>'] = cmp.mapping.confirm { select = true },
['<C-n>'] = cmp.mapping.abort(),
['<C-b>'] = 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),
@ -108,6 +109,9 @@ return {
luasnip.jump(-1) luasnip.jump(-1)
end end
end, { 'i', 's' }), end, { 'i', 's' }),
-- For more advanced luasnip keymaps (e.g. selecting choice nodes, expansion) see:
-- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps
}, },
sources = { sources = {
{ name = 'nvim_lsp' }, { name = 'nvim_lsp' },

View File

@ -3,10 +3,16 @@ return {
'stevearc/conform.nvim', 'stevearc/conform.nvim',
opts = { opts = {
notify_on_error = false, notify_on_error = false,
format_on_save = { format_on_save = function(bufnr)
timeout_ms = 500, -- Disable "format_on_save lsp_fallback" for languages that don't
lsp_fallback = true, -- have a well standardized coding style. You can add additional
}, -- languages here or re-enable it for the disabled ones.
local disable_filetypes = { c = true, cpp = true }
return {
timeout_ms = 500,
lsp_fallback = not disable_filetypes[vim.bo[bufnr].filetype],
}
end,
formatters_by_ft = { formatters_by_ft = {
lua = { 'stylua' }, lua = { 'stylua' },
-- Conform can also run multiple formatters sequentially -- Conform can also run multiple formatters sequentially

View File

@ -10,6 +10,10 @@ return {
-- 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', opts = {} }, { 'j-hui/fidget.nvim', opts = {} },
-- `neodev` configures Lua LSP for your Neovim config, runtime and plugins
-- used for completion, annotations and signatures of Neovim apis
{ 'folke/neodev.nvim', opts = {} },
}, },
config = function() config = function()
-- Brief Aside: **What is LSP?** -- Brief Aside: **What is LSP?**
@ -56,7 +60,7 @@ return {
-- Jump to the definition of the word under your cursor. -- Jump to the definition of the word under your cursor.
-- This is where a variable was first declared, or where a function is defined, etc. -- This is where a variable was first declared, or where a function is defined, etc.
-- To jump back, press <C-T>. -- To jump back, press <C-t>.
map('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition') map('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition')
-- Find references for the word under your cursor. -- Find references for the word under your cursor.
@ -152,19 +156,6 @@ return {
-- capabilities = {}, -- capabilities = {},
settings = { settings = {
Lua = { Lua = {
runtime = { version = 'LuaJIT' },
workspace = {
checkThirdParty = false,
-- Tells lua_ls where to find all the Lua files that you have loaded
-- for your neovim configuration.
library = {
'${3rd}/luv/library',
unpack(vim.api.nvim_get_runtime_file('', true)),
},
-- If lua_ls is really slow on your computer, you can try this instead:
-- library = { vim.env.VIMRUNTIME },
},
telemetry = { enable = false },
completion = { completion = {
callSnippet = 'Replace', callSnippet = 'Replace',
}, },

View File

@ -5,9 +5,8 @@ return {
-- --
-- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme` -- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`
'folke/tokyonight.nvim', 'folke/tokyonight.nvim',
lazy = false, -- make sure we load this during startup if it is your main colorscheme
priority = 1000, -- make sure to load this before all the other start plugins priority = 1000, -- make sure to load this before all the other start plugins
config = function() init = function()
-- Load the colorscheme here. -- Load the colorscheme here.
-- Like many other themes, this one has different styles, and you could load -- Like many other themes, this one has different styles, and you could load
-- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'. -- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'.

View File

@ -8,77 +8,82 @@ return {
'nvim-treesitter/nvim-treesitter-textobjects', 'nvim-treesitter/nvim-treesitter-textobjects',
}, },
build = ':TSUpdate', build = ':TSUpdate',
config = function() opts = {
ensure_installed = { 'lua', 'python', 'rust', 'javascript', 'typescript', 'vimdoc', 'vim', 'svelte', 'c_sharp' },
-- Autoinstall languages that are not installed
auto_install = true,
-- Enable autotags and -rename
autotag = {
enable = true,
enable_autocmd = true,
},
highlight = {
enable = true,
-- Some languages depend on vim's regex highlighting system (such as Ruby) for indent rules.
-- If you are experiencing weird indenting issues, add the language to
-- the list of additional_vim_regex_highlighting and disabled languages for indent.
additional_vim_regex_highlighting = { 'ruby' },
},
indent = { enable = true, disable = { 'ruby' } },
incremental_selection = {
enable = true,
keymaps = {
init_selection = '<c-space>',
node_incremental = '<c-space>',
scope_incremental = '<c-s>',
node_decremental = '<M-space>',
},
},
textobjects = {
select = {
enable = true,
lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim
keymaps = {
-- You can use the capture groups defined in textobjects.scm
['aa'] = '@parameter.outer',
['ia'] = '@parameter.inner',
['af'] = '@function.outer',
['if'] = '@function.inner',
['ac'] = '@class.outer',
['ic'] = '@class.inner',
},
},
move = {
enable = true,
set_jumps = true, -- whether to set jumps in the jumplist
goto_next_start = {
[']m'] = '@function.outer',
[']]'] = '@class.outer',
},
goto_next_end = {
[']M'] = '@function.outer',
[']['] = '@class.outer',
},
goto_previous_start = {
['[m'] = '@function.outer',
['[['] = '@class.outer',
},
goto_previous_end = {
['[M'] = '@function.outer',
['[]'] = '@class.outer',
},
},
swap = {
enable = true,
swap_next = {
['<leader>a'] = '@parameter.inner',
},
swap_previous = {
['<leader>A'] = '@parameter.inner',
},
},
},
},
config = function(_, opts)
-- [[ Configure Treesitter ]] See `:help nvim-treesitter` -- [[ Configure Treesitter ]] See `:help nvim-treesitter`
---@diagnostic disable-next-line: missing-fields ---@diagnostic disable-next-line: missing-fields
require('nvim-treesitter.configs').setup { require('nvim-treesitter.configs').setup(opts)
ensure_installed = { 'lua', 'python', 'rust', 'javascript', 'typescript', 'vimdoc', 'vim', 'svelte', 'c_sharp' },
-- Autoinstall languages that are not installed
auto_install = false,
-- Enable autotags and -rename
autotag = {
enable = true,
enable_autocmd = true,
},
-- Install languages synchronously (only applied to `ensure_installed`)
sync_install = false,
highlight = { enable = true },
indent = { enable = true },
incremental_selection = {
enable = true,
keymaps = {
init_selection = '<c-space>',
node_incremental = '<c-space>',
scope_incremental = '<c-s>',
node_decremental = '<M-space>',
},
},
textobjects = {
select = {
enable = true,
lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim
keymaps = {
-- You can use the capture groups defined in textobjects.scm
['aa'] = '@parameter.outer',
['ia'] = '@parameter.inner',
['af'] = '@function.outer',
['if'] = '@function.inner',
['ac'] = '@class.outer',
['ic'] = '@class.inner',
},
},
move = {
enable = true,
set_jumps = true, -- whether to set jumps in the jumplist
goto_next_start = {
[']m'] = '@function.outer',
[']]'] = '@class.outer',
},
goto_next_end = {
[']M'] = '@function.outer',
[']['] = '@class.outer',
},
goto_previous_start = {
['[m'] = '@function.outer',
['[['] = '@class.outer',
},
goto_previous_end = {
['[M'] = '@function.outer',
['[]'] = '@class.outer',
},
},
swap = {
enable = true,
swap_next = {
['<leader>a'] = '@parameter.inner',
},
swap_previous = {
['<leader>A'] = '@parameter.inner',
},
},
},
}
end, end,
}, },
} }

View File

@ -69,9 +69,6 @@ require('lazy').setup({
-- "gc" to comment visual regions/lines -- "gc" to comment visual regions/lines
{ 'numToStr/Comment.nvim', opts = {} }, { 'numToStr/Comment.nvim', opts = {} },
-- Setup neovim lua configuration
{ 'folke/neodev.nvim', opts = {} },
-- modular approach: using `require 'path/name'` will -- modular approach: using `require 'path/name'` will
-- include a plugin definition from file lua/path/name.lua -- include a plugin definition from file lua/path/name.lua

View File

@ -55,6 +55,9 @@ vim.opt.signcolumn = 'yes'
-- Decrease update time -- Decrease update time
vim.opt.updatetime = 250 vim.opt.updatetime = 250
-- Decrease mapped sequence wait time
-- Displays which-key popup sooner
vim.opt.timeoutlen = 300 vim.opt.timeoutlen = 300
-- Configure how new splits should be opened -- Configure how new splits should be opened