Compare commits

..

13 commits

Author SHA1 Message Date
Damjan 9000
d34281a630 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-16 01:27:51 +01:00
stgpepper
2ace500d85 Update README.md (#763)
Added file text to code block for consistency since the other plugin had file also inside code block.
2024-03-16 01:27:51 +01:00
TJ DeVries
9009dfc7c9 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-16 01:27:51 +01:00
TJ DeVries
368b0afe00 doc: add note about advanced luasnip features 2024-03-16 01:27:51 +01:00
Vladislav Grechannik
d5006f9407 Move friendly snippets to dependencies of LuaSnip (#759)
Co-authored-by: TJ DeVries <devries.timothyj@gmail.com>
2024-03-16 01:27:43 +01:00
Rafael Zasas
68ad1b63f9 Add <C-b>/<C-f> cmp mapping to scroll cmp docs (#750) 2024-03-16 01:25:23 +01:00
TLW
c9c8fa82af doc: add info about timeoutlen (#691)
Add separate comment for `timeoutlen` option
`timeoutlen` option was under unrelated comment with `updatetime` option.
2024-03-16 01:25:23 +01:00
Chris Patti
6570754479 Revert "Use cmp-nvim-lua as nvim-cmp source for neovim Lua API (#696)" (#755)
This reverts commit d8a1dbc4b40fc018f254be3f060061d90ad35185.
2024-03-16 01:25:23 +01:00
James Karefylakis
0d662bdbee 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-16 01:25:23 +01:00
Damjan 9000
1bca80e56a 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-16 01:25:23 +01:00
Chiller Dragon
03a2ca3273 chore: rename <C-T> to <C-t> for consistency (#719) 2024-03-16 01:25:23 +01:00
Ryan Baumgardner
fd18ddfd0a feat: allow treesitter defaults to be overwritten from custom directory (#732) 2024-03-16 01:25:23 +01:00
Damjan 9000
51889f5ac7 README.md: update neo-tree example - remove legacy setting (#744) 2024-03-16 01:25:23 +01:00
2 changed files with 52 additions and 27 deletions

View file

@ -140,8 +140,7 @@ This will install the tree plugin and add the command `:Neotree` for you. For mo
In the file: `lua/custom/plugins/filetree.lua`, add:
```lua
-- Unless you are still migrating, remove the deprecated commands from v1.x
vim.cmd([[ let g:neo_tree_remove_legacy_commands = 1 ]])
-- File: lua/custom/plugins/filetree.lua
return {
"nvim-neo-tree/neo-tree.nvim",

View file

@ -130,6 +130,9 @@ vim.opt.signcolumn = 'yes'
-- Decrease update time
vim.opt.updatetime = 250
-- Decrease mapped sequence wait time
-- Displays which-key popup sooner
vim.opt.timeoutlen = 300
-- Configure how new splits should be opened
@ -436,6 +439,10 @@ require('lazy').setup({
-- Useful status updates for LSP.
-- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})`
{ '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()
-- Brief Aside: **What is LSP?**
@ -482,7 +489,7 @@ require('lazy').setup({
-- 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.
-- To jump back, press <C-T>.
-- To jump back, press <C-t>.
map('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition')
-- Find references for the word under your cursor.
@ -575,18 +582,6 @@ require('lazy').setup({
-- capabilities = {},
settings = {
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 },
},
completion = {
callSnippet = 'Replace',
},
@ -637,10 +632,16 @@ require('lazy').setup({
'stevearc/conform.nvim',
opts = {
notify_on_error = false,
format_on_save = {
format_on_save = function(bufnr)
-- Disable "format_on_save lsp_fallback" for languages that don't
-- 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 = true,
},
lsp_fallback = not disable_filetypes[vim.bo[bufnr].filetype],
}
end,
formatters_by_ft = {
lua = { 'stylua' },
-- Conform can also run multiple formatters sequentially
@ -676,6 +677,17 @@ require('lazy').setup({
end
return 'make install_jsregexp'
end)(),
dependencies = {
-- `friendly-snippets` contains a variety of premade snippets.
-- See the README about individual language/framework/plugin snippets:
-- https://github.com/rafamadriz/friendly-snippets
-- {
-- 'rafamadriz/friendly-snippets',
-- config = function()
-- require('luasnip.loaders.from_vscode').lazy_load()
-- end,
-- },
},
},
'saadparwaiz1/cmp_luasnip',
@ -718,6 +730,10 @@ require('lazy').setup({
-- Select the [p]revious item
['<C-p>'] = cmp.mapping.select_prev_item(),
-- scroll the documentation window [b]ack / [f]orward
['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
-- Accept ([y]es) the completion.
-- This will auto-import if your LSP supports it.
-- This will expand snippets if the LSP sent a snippet.
@ -746,6 +762,9 @@ require('lazy').setup({
luasnip.jump(-1)
end
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 = {
{ name = 'nvim_lsp' },
@ -822,17 +841,24 @@ require('lazy').setup({
{ -- Highlight, edit, and navigate code
'nvim-treesitter/nvim-treesitter',
build = ':TSUpdate',
config = function()
-- [[ Configure Treesitter ]] See `:help nvim-treesitter`
---@diagnostic disable-next-line: missing-fields
require('nvim-treesitter.configs').setup {
opts = {
ensure_installed = { 'bash', 'c', 'html', 'lua', 'markdown', 'vim', 'vimdoc' },
-- Autoinstall languages that are not installed
auto_install = true,
highlight = { enable = true },
indent = { enable = 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' } },
},
config = function(_, opts)
-- [[ Configure Treesitter ]] See `:help nvim-treesitter`
---@diagnostic disable-next-line: missing-fields
require('nvim-treesitter.configs').setup(opts)
-- There are additional nvim-treesitter modules that you can use to interact
-- with nvim-treesitter. You should go explore a few and see what interests you: