added basic klipper, vue and go configuration
This commit is contained in:
parent
7201dc4801
commit
7790c13c6d
232
init.lua
232
init.lua
|
@ -111,12 +111,22 @@ vim.opt.mouse = 'a'
|
||||||
vim.opt.showmode = false
|
vim.opt.showmode = false
|
||||||
|
|
||||||
-- Sync clipboard between OS and Neovim.
|
-- Sync clipboard between OS and Neovim.
|
||||||
-- Schedule the setting after `UiEnter` because it can increase startup-time.
|
|
||||||
-- Remove this option if you want your OS clipboard to remain independent.
|
-- Remove this option if you want your OS clipboard to remain independent.
|
||||||
-- See `:help 'clipboard'`
|
-- See `:help 'clipboard'`
|
||||||
vim.schedule(function()
|
-- vim.g.clipboard = {
|
||||||
vim.opt.clipboard = 'unnamedplus'
|
-- name = 'klipper',
|
||||||
end)
|
-- copy = {
|
||||||
|
--
|
||||||
|
-- ['+'] = 'qdbus org.kde.klipper /klipper setClipboardContents "$(</dev/stdin)\n$(cat)"',
|
||||||
|
-- ['*'] = 'qdbus org.kde.klipper /klipper setClipboardContents',
|
||||||
|
-- },
|
||||||
|
-- paste = {
|
||||||
|
-- ['+'] = 'qdbus org.kde.klipper /klipper getClipboardContents',
|
||||||
|
-- ['*'] = 'qdbus org.kde.klipper /klipper getClipboardContents',
|
||||||
|
-- },
|
||||||
|
-- cache_enabled = 0,
|
||||||
|
-- }
|
||||||
|
vim.opt.clipboard = 'unnamedplus'
|
||||||
|
|
||||||
-- Enable break indent
|
-- Enable break indent
|
||||||
vim.opt.breakindent = true
|
vim.opt.breakindent = true
|
||||||
|
@ -159,12 +169,19 @@ vim.opt.scrolloff = 10
|
||||||
|
|
||||||
-- [[ Basic Keymaps ]]
|
-- [[ Basic Keymaps ]]
|
||||||
-- See `:help vim.keymap.set()`
|
-- See `:help vim.keymap.set()`
|
||||||
|
vim.keymap.set('n', '<leader>y', '"+y')
|
||||||
|
vim.keymap.set('n', '<leader>p', '"+p')
|
||||||
|
vim.keymap.set('v', '<leader>y', '"+y')
|
||||||
|
vim.keymap.set('v', '<leader>p', '"+p')
|
||||||
|
|
||||||
-- Clear highlights on search when pressing <Esc> in normal mode
|
-- Set highlight on search, but clear on pressing <Esc> in normal mode
|
||||||
-- See `:help hlsearch`
|
vim.opt.hlsearch = true
|
||||||
vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')
|
vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')
|
||||||
|
|
||||||
-- Diagnostic keymaps
|
-- Diagnostic keymaps
|
||||||
|
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous [D]iagnostic message' })
|
||||||
|
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next [D]iagnostic message' })
|
||||||
|
vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, { desc = 'Show diagnostic [E]rror messages' })
|
||||||
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' })
|
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
|
-- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier
|
||||||
|
@ -207,12 +224,9 @@ vim.api.nvim_create_autocmd('TextYankPost', {
|
||||||
-- [[ Install `lazy.nvim` plugin manager ]]
|
-- [[ Install `lazy.nvim` plugin manager ]]
|
||||||
-- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info
|
-- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info
|
||||||
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
|
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
|
||||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
if not vim.loop.fs_stat(lazypath) then
|
||||||
local lazyrepo = 'https://github.com/folke/lazy.nvim.git'
|
local lazyrepo = 'https://github.com/folke/lazy.nvim.git'
|
||||||
local out = vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath }
|
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
|
|
||||||
end ---@diagnostic disable-next-line: undefined-field
|
end ---@diagnostic disable-next-line: undefined-field
|
||||||
vim.opt.rtp:prepend(lazypath)
|
vim.opt.rtp:prepend(lazypath)
|
||||||
|
|
||||||
|
@ -237,6 +251,11 @@ require('lazy').setup({
|
||||||
--
|
--
|
||||||
-- Use `opts = {}` to force a plugin to be loaded.
|
-- Use `opts = {}` to force a plugin to be loaded.
|
||||||
--
|
--
|
||||||
|
-- This is equivalent to:
|
||||||
|
-- require('Comment').setup({})
|
||||||
|
|
||||||
|
-- "gc" to comment visual regions/lines
|
||||||
|
{ 'numToStr/Comment.nvim', opts = {} },
|
||||||
|
|
||||||
-- Here is a more advanced example where we pass configuration
|
-- Here is a more advanced example where we pass configuration
|
||||||
-- options to `gitsigns.nvim`. This is equivalent to the following Lua:
|
-- options to `gitsigns.nvim`. This is equivalent to the following Lua:
|
||||||
|
@ -274,55 +293,24 @@ require('lazy').setup({
|
||||||
{ -- Useful plugin to show you pending keybinds.
|
{ -- Useful plugin to show you pending keybinds.
|
||||||
'folke/which-key.nvim',
|
'folke/which-key.nvim',
|
||||||
event = 'VimEnter', -- Sets the loading event to 'VimEnter'
|
event = 'VimEnter', -- Sets the loading event to 'VimEnter'
|
||||||
opts = {
|
config = function() -- This is the function that runs, AFTER loading
|
||||||
icons = {
|
require('which-key').setup()
|
||||||
-- 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 whick-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>',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Document existing key chains
|
-- Document existing key chains
|
||||||
spec = {
|
require('which-key').register {
|
||||||
{ '<leader>c', group = '[C]ode', mode = { 'n', 'x' } },
|
['<leader>c'] = { name = '[C]ode', _ = 'which_key_ignore' },
|
||||||
{ '<leader>d', group = '[D]ocument' },
|
['<leader>d'] = { name = '[D]ocument', _ = 'which_key_ignore' },
|
||||||
{ '<leader>r', group = '[R]ename' },
|
['<leader>r'] = { name = '[R]ename', _ = 'which_key_ignore' },
|
||||||
{ '<leader>s', group = '[S]earch' },
|
['<leader>s'] = { name = '[S]earch', _ = 'which_key_ignore' },
|
||||||
{ '<leader>w', group = '[W]orkspace' },
|
['<leader>w'] = { name = '[W]orkspace', _ = 'which_key_ignore' },
|
||||||
{ '<leader>t', group = '[T]oggle' },
|
['<leader>t'] = { name = '[T]oggle', _ = 'which_key_ignore' },
|
||||||
{ '<leader>h', group = 'Git [H]unk', mode = { 'n', 'v' } },
|
['<leader>h'] = { name = 'Git [H]unk', _ = 'which_key_ignore' },
|
||||||
},
|
}
|
||||||
},
|
-- visual mode
|
||||||
|
require('which-key').register({
|
||||||
|
['<leader>h'] = { 'Git [H]unk' },
|
||||||
|
}, { mode = 'v' })
|
||||||
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
-- NOTE: Plugins can specify dependencies.
|
-- NOTE: Plugins can specify dependencies.
|
||||||
|
@ -437,22 +425,7 @@ require('lazy').setup({
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
-- LSP Plugins
|
{ -- LSP Configuration & Plugins
|
||||||
{
|
|
||||||
-- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins
|
|
||||||
-- used for completion, annotations and signatures of Neovim apis
|
|
||||||
'folke/lazydev.nvim',
|
|
||||||
ft = 'lua',
|
|
||||||
opts = {
|
|
||||||
library = {
|
|
||||||
-- Load luvit types when the `vim.uv` word is found
|
|
||||||
{ path = 'luvit-meta/library', words = { 'vim%.uv' } },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{ 'Bilal2453/luvit-meta', lazy = true },
|
|
||||||
{
|
|
||||||
-- Main LSP Configuration
|
|
||||||
'neovim/nvim-lspconfig',
|
'neovim/nvim-lspconfig',
|
||||||
dependencies = {
|
dependencies = {
|
||||||
-- Automatically install LSPs and related tools to stdpath for Neovim
|
-- Automatically install LSPs and related tools to stdpath for Neovim
|
||||||
|
@ -464,8 +437,9 @@ require('lazy').setup({
|
||||||
-- 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 = {} },
|
||||||
|
|
||||||
-- Allows extra capabilities provided by nvim-cmp
|
-- `neodev` configures Lua LSP for your Neovim config, runtime and plugins
|
||||||
'hrsh7th/cmp-nvim-lsp',
|
-- 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?**
|
||||||
|
@ -505,9 +479,8 @@ require('lazy').setup({
|
||||||
--
|
--
|
||||||
-- In this case, we create a function that lets us more easily define mappings specific
|
-- In this case, we create a function that lets us more easily define mappings specific
|
||||||
-- for LSP related items. It sets the mode, buffer and description for us each time.
|
-- for LSP related items. It sets the mode, buffer and description for us each time.
|
||||||
local map = function(keys, func, desc, mode)
|
local map = function(keys, func, desc)
|
||||||
mode = mode or 'n'
|
vim.keymap.set('n', keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc })
|
||||||
vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc })
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Jump to the definition of the word under your cursor.
|
-- Jump to the definition of the word under your cursor.
|
||||||
|
@ -541,7 +514,11 @@ require('lazy').setup({
|
||||||
|
|
||||||
-- Execute a code action, usually your cursor needs to be on top of an error
|
-- Execute a code action, usually your cursor needs to be on top of an error
|
||||||
-- or a suggestion from your LSP for this to activate.
|
-- or a suggestion from your LSP for this to activate.
|
||||||
map('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction', { 'n', 'x' })
|
map('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction')
|
||||||
|
|
||||||
|
-- Opens a popup that displays documentation about the word under your cursor
|
||||||
|
-- See `:help K` for why this keymap.
|
||||||
|
map('K', vim.lsp.buf.hover, 'Hover Documentation')
|
||||||
|
|
||||||
-- WARN: This is not Goto Definition, this is Goto Declaration.
|
-- WARN: This is not Goto Definition, this is Goto Declaration.
|
||||||
-- For example, in C this would take you to the header.
|
-- For example, in C this would take you to the header.
|
||||||
|
@ -553,7 +530,7 @@ require('lazy').setup({
|
||||||
--
|
--
|
||||||
-- When you move your cursor, the highlights will be cleared (the second autocommand).
|
-- When you move your cursor, the highlights will be cleared (the second autocommand).
|
||||||
local client = vim.lsp.get_client_by_id(event.data.client_id)
|
local client = vim.lsp.get_client_by_id(event.data.client_id)
|
||||||
if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_documentHighlight) then
|
if client and client.server_capabilities.documentHighlightProvider then
|
||||||
local highlight_augroup = vim.api.nvim_create_augroup('kickstart-lsp-highlight', { clear = false })
|
local highlight_augroup = vim.api.nvim_create_augroup('kickstart-lsp-highlight', { clear = false })
|
||||||
vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, {
|
vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, {
|
||||||
buffer = event.buf,
|
buffer = event.buf,
|
||||||
|
@ -576,13 +553,13 @@ require('lazy').setup({
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
-- The following code creates a keymap to toggle inlay hints in your
|
-- The following autocommand is used to enable inlay hints in your
|
||||||
-- code, if the language server you are using supports them
|
-- code, if the language server you are using supports them
|
||||||
--
|
--
|
||||||
-- This may be unwanted, since they displace some of your code
|
-- This may be unwanted, since they displace some of your code
|
||||||
if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_inlayHint) then
|
if client and client.server_capabilities.inlayHintProvider and vim.lsp.inlay_hint then
|
||||||
map('<leader>th', function()
|
map('<leader>th', function()
|
||||||
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf })
|
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled())
|
||||||
end, '[T]oggle Inlay [H]ints')
|
end, '[T]oggle Inlay [H]ints')
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
@ -606,7 +583,7 @@ require('lazy').setup({
|
||||||
-- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/
|
-- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/
|
||||||
local servers = {
|
local servers = {
|
||||||
-- clangd = {},
|
-- clangd = {},
|
||||||
-- gopls = {},
|
gopls = {},
|
||||||
-- pyright = {},
|
-- pyright = {},
|
||||||
-- rust_analyzer = {},
|
-- rust_analyzer = {},
|
||||||
-- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
|
-- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
|
||||||
|
@ -614,9 +591,36 @@ require('lazy').setup({
|
||||||
-- Some languages (like typescript) have entire language plugins that can be useful:
|
-- Some languages (like typescript) have entire language plugins that can be useful:
|
||||||
-- https://github.com/pmizio/typescript-tools.nvim
|
-- https://github.com/pmizio/typescript-tools.nvim
|
||||||
--
|
--
|
||||||
-- But for many setups, the LSP (`ts_ls`) will work just fine
|
-- But for many setups, the LSP (`tsserver`) will work just fine
|
||||||
-- ts_ls = {},
|
volar = {
|
||||||
--
|
filetypes = { 'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue' },
|
||||||
|
init_options = {
|
||||||
|
vue = {
|
||||||
|
hybridMode = false,
|
||||||
|
},
|
||||||
|
typescript = {
|
||||||
|
-- Global install of typescript
|
||||||
|
tsdk = '~/.nvm/versions/node/v18.20.3/lib/node_modules/typescript',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
tsserver = {
|
||||||
|
init_options = {
|
||||||
|
plugins = {
|
||||||
|
{
|
||||||
|
name = '@vue/typescript-plugin',
|
||||||
|
location = '/home/vjn/.nvm/versions/node/v22.2.0/lib/node_modules/@vue/typescript-plugin/',
|
||||||
|
languages = { 'javascript', 'typescript', 'vue' },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
filetypes = {
|
||||||
|
'javascript',
|
||||||
|
'typescript',
|
||||||
|
'vue',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
lua_ls = {
|
lua_ls = {
|
||||||
-- cmd = {...},
|
-- cmd = {...},
|
||||||
|
@ -656,7 +660,7 @@ require('lazy').setup({
|
||||||
local server = servers[server_name] or {}
|
local server = servers[server_name] or {}
|
||||||
-- This handles overriding only values explicitly passed
|
-- This handles overriding only values explicitly passed
|
||||||
-- by the server configuration above. Useful when disabling
|
-- by the server configuration above. Useful when disabling
|
||||||
-- certain features of an LSP (for example, turning off formatting for ts_ls)
|
-- certain features of an LSP (for example, turning off formatting for tsserver)
|
||||||
server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {})
|
server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {})
|
||||||
require('lspconfig')[server_name].setup(server)
|
require('lspconfig')[server_name].setup(server)
|
||||||
end,
|
end,
|
||||||
|
@ -667,13 +671,12 @@ require('lazy').setup({
|
||||||
|
|
||||||
{ -- Autoformat
|
{ -- Autoformat
|
||||||
'stevearc/conform.nvim',
|
'stevearc/conform.nvim',
|
||||||
event = { 'BufWritePre' },
|
lazy = false,
|
||||||
cmd = { 'ConformInfo' },
|
|
||||||
keys = {
|
keys = {
|
||||||
{
|
{
|
||||||
'<leader>f',
|
'<leader>f',
|
||||||
function()
|
function()
|
||||||
require('conform').format { async = true, lsp_format = 'fallback' }
|
require('conform').format { async = true, lsp_fallback = true }
|
||||||
end,
|
end,
|
||||||
mode = '',
|
mode = '',
|
||||||
desc = '[F]ormat buffer',
|
desc = '[F]ormat buffer',
|
||||||
|
@ -686,15 +689,9 @@ require('lazy').setup({
|
||||||
-- have a well standardized coding style. You can add additional
|
-- have a well standardized coding style. You can add additional
|
||||||
-- languages here or re-enable it for the disabled ones.
|
-- languages here or re-enable it for the disabled ones.
|
||||||
local disable_filetypes = { c = true, cpp = true }
|
local disable_filetypes = { c = true, cpp = true }
|
||||||
local lsp_format_opt
|
|
||||||
if disable_filetypes[vim.bo[bufnr].filetype] then
|
|
||||||
lsp_format_opt = 'never'
|
|
||||||
else
|
|
||||||
lsp_format_opt = 'fallback'
|
|
||||||
end
|
|
||||||
return {
|
return {
|
||||||
timeout_ms = 500,
|
timeout_ms = 500,
|
||||||
lsp_format = lsp_format_opt,
|
lsp_fallback = not disable_filetypes[vim.bo[bufnr].filetype],
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
formatters_by_ft = {
|
formatters_by_ft = {
|
||||||
|
@ -702,8 +699,9 @@ require('lazy').setup({
|
||||||
-- Conform can also run multiple formatters sequentially
|
-- Conform can also run multiple formatters sequentially
|
||||||
-- python = { "isort", "black" },
|
-- python = { "isort", "black" },
|
||||||
--
|
--
|
||||||
-- You can use 'stop_after_first' to run the first available formatter from the list
|
-- You can use a sub-list to tell conform to run *until* a formatter
|
||||||
-- javascript = { "prettierd", "prettier", stop_after_first = true },
|
-- is found.
|
||||||
|
-- javascript = { { "prettierd", "prettier" } },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -811,11 +809,6 @@ require('lazy').setup({
|
||||||
-- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps
|
-- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps
|
||||||
},
|
},
|
||||||
sources = {
|
sources = {
|
||||||
{
|
|
||||||
name = 'lazydev',
|
|
||||||
-- set group index to 0 to skip loading LuaLS completions as lazydev recommends it
|
|
||||||
group_index = 0,
|
|
||||||
},
|
|
||||||
{ name = 'nvim_lsp' },
|
{ name = 'nvim_lsp' },
|
||||||
{ name = 'luasnip' },
|
{ name = 'luasnip' },
|
||||||
{ name = 'path' },
|
{ name = 'path' },
|
||||||
|
@ -852,7 +845,7 @@ require('lazy').setup({
|
||||||
--
|
--
|
||||||
-- Examples:
|
-- Examples:
|
||||||
-- - va) - [V]isually select [A]round [)]paren
|
-- - va) - [V]isually select [A]round [)]paren
|
||||||
-- - yinq - [Y]ank [I]nside [N]ext [Q]uote
|
-- - yinq - [Y]ank [I]nside [N]ext [']quote
|
||||||
-- - ci' - [C]hange [I]nside [']quote
|
-- - ci' - [C]hange [I]nside [']quote
|
||||||
require('mini.ai').setup { n_lines = 500 }
|
require('mini.ai').setup { n_lines = 500 }
|
||||||
|
|
||||||
|
@ -885,10 +878,8 @@ require('lazy').setup({
|
||||||
{ -- Highlight, edit, and navigate code
|
{ -- Highlight, edit, and navigate code
|
||||||
'nvim-treesitter/nvim-treesitter',
|
'nvim-treesitter/nvim-treesitter',
|
||||||
build = ':TSUpdate',
|
build = ':TSUpdate',
|
||||||
main = 'nvim-treesitter.configs', -- Sets main module to use for opts
|
|
||||||
-- [[ Configure Treesitter ]] See `:help nvim-treesitter`
|
|
||||||
opts = {
|
opts = {
|
||||||
ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' },
|
ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'vim', 'vimdoc' },
|
||||||
-- Autoinstall languages that are not installed
|
-- Autoinstall languages that are not installed
|
||||||
auto_install = true,
|
auto_install = true,
|
||||||
highlight = {
|
highlight = {
|
||||||
|
@ -900,12 +891,21 @@ require('lazy').setup({
|
||||||
},
|
},
|
||||||
indent = { enable = true, disable = { 'ruby' } },
|
indent = { enable = true, disable = { 'ruby' } },
|
||||||
},
|
},
|
||||||
-- There are additional nvim-treesitter modules that you can use to interact
|
config = function(_, opts)
|
||||||
-- with nvim-treesitter. You should go explore a few and see what interests you:
|
-- [[ Configure Treesitter ]] See `:help nvim-treesitter`
|
||||||
--
|
|
||||||
-- - Incremental selection: Included, see `:help nvim-treesitter-incremental-selection-mod`
|
-- Prefer git instead of curl in order to improve connectivity in some environments
|
||||||
-- - Show your current context: https://github.com/nvim-treesitter/nvim-treesitter-context
|
require('nvim-treesitter.install').prefer_git = true
|
||||||
-- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects
|
---@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:
|
||||||
|
--
|
||||||
|
-- - Incremental selection: Included, see `:help nvim-treesitter-incremental-selection-mod`
|
||||||
|
-- - Show your current context: https://github.com/nvim-treesitter/nvim-treesitter-context
|
||||||
|
-- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects
|
||||||
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
-- The following two comments only work if you have downloaded the kickstart repo, not just copy pasted the
|
-- The following two comments only work if you have downloaded the kickstart repo, not just copy pasted the
|
||||||
|
|
Loading…
Reference in New Issue