You've already forked dotfiles
feat: A working state during the transfer between the old neovim
configurations and using newer built-in functionality in the 0.12.x versions of Neovim. Further work is needed for treesitter updates, cleanup of the conversion work and testing to verify old functionality isn't lessened to get the benefits of a cleaner config and vastly faster load times.
This commit is contained in:
10
README.md
10
README.md
@@ -92,8 +92,8 @@ The config adds the following settings outside of oh-my-zsh:
|
|||||||
- User $HOME based `.local/bin`
|
- User $HOME based `.local/bin`
|
||||||
- Keychain initialization for caching SSH keys
|
- Keychain initialization for caching SSH keys
|
||||||
- Adding a timing function for checking ZSH load timing
|
- Adding a timing function for checking ZSH load timing
|
||||||
- Local specific configuration file loading, with three initial configs:
|
- Split configuration file loading with three main configs and a local override:
|
||||||
- `.zsh_aliases`: Aliases for local specific commands
|
- `zsh_aliases`: Aliases for common commands
|
||||||
- `.zsh_exports`: Exported variables for a specific system
|
- `zsh_exports`: Exported variables for the system
|
||||||
- `.zsh_functions`: Custom functions
|
- `zsh_functions`: Custom functions beyond simple aliasing can fulfill but not requiring a script
|
||||||
- `.zsh_local`: Local ZSH settings for a specific system such as any environment specific bash required to set up a system's shell or direct ZSH settings
|
- `zsh_local`: Local ZSH settings for a specific system such as any environment specific bash required to set up a system's shell or direct ZSH settings
|
||||||
|
|||||||
@@ -42,13 +42,11 @@
|
|||||||
--
|
--
|
||||||
-- Created: 7/2/2012
|
-- Created: 7/2/2012
|
||||||
|
|
||||||
-- local vim = vim
|
|
||||||
vim.loader.enable()
|
vim.loader.enable()
|
||||||
|
|
||||||
require('custom_functions')
|
|
||||||
require('custom_commands')
|
require('custom_commands')
|
||||||
|
require('plugins')
|
||||||
|
require('language_support')
|
||||||
|
require('autocmds')
|
||||||
require('keymappings')
|
require('keymappings')
|
||||||
require('settings')
|
require('settings')
|
||||||
require('autocmds')
|
|
||||||
require('lsp')
|
|
||||||
require('plugins')
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
vim.api.nvim_create_user_command('FindAndReplace', function(opts)
|
vim.api.nvim_create_user_command('FindAndReplace', function(opts)
|
||||||
-- Update each quickfix location using substitute, update the files to save changes, close the opened buffers and close the quickfix window
|
-- Update each quickfix location using substitute, update the files to save changes, close the opened buffers and close the quickfix window
|
||||||
-- TODO: Does not close the buffers opened through changes
|
-- TODO: Does not close the buffers opened through changes
|
||||||
vim.api.nvim_command(string.format('cdo s/%s/%s/g', opts.fargs[1], opts.fargs[2]) .. '| update | cclose')
|
vim.api.nvim_command(string.format('cfdo s/%s/%s/gc', opts.fargs[1], opts.fargs[2]) .. '| update | cclose')
|
||||||
end, { nargs = '*' })
|
end, { nargs = '*' })
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
return {
|
return {
|
||||||
execute = function(type)
|
execute = function(type)
|
||||||
|
-- Mapping of filetypes to commands
|
||||||
local command_table = {
|
local command_table = {
|
||||||
build = {
|
build = {
|
||||||
rust = 'cargo build',
|
rust = 'cargo build',
|
||||||
@@ -21,11 +22,15 @@ return {
|
|||||||
cpp = 'make upload',
|
cpp = 'make upload',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-- Save the file
|
||||||
vim.api.nvim_command('write')
|
vim.api.nvim_command('write')
|
||||||
|
|
||||||
local command = command_table[type][vim.bo.filetype]
|
local command = command_table[type][vim.bo.filetype]
|
||||||
|
|
||||||
if command ~= nil then
|
if command ~= nil then
|
||||||
vim.cmd('FloatermNew --autoclose=0 --height=0.9 --width=0.9 ' .. command)
|
-- Run command in a new terminal buffer
|
||||||
|
vim.cmd('terminal ' .. command)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,6 +50,10 @@ vim.keymap.set('n', '<leader>w', ':set list!<CR>', options)
|
|||||||
-- Folding the section under the cursor
|
-- Folding the section under the cursor
|
||||||
vim.keymap.set('n', '<space>', 'za')
|
vim.keymap.set('n', '<space>', 'za')
|
||||||
|
|
||||||
|
-- Comment toggling
|
||||||
|
vim.keymap.set('n', '<leader>c', 'gcc', {remap=true})
|
||||||
|
vim.keymap.set('v', '<leader>c', 'gc', {remap=true})
|
||||||
|
|
||||||
-- Keymaps for custom functions
|
-- Keymaps for custom functions
|
||||||
vim.keymap.set('n', '<leader>et', function() custom_functions.execute('test') end)
|
vim.keymap.set('n', '<leader>et', function() custom_functions.execute('test') end)
|
||||||
vim.keymap.set('n', '<leader>er', function() custom_functions.execute('run') end)
|
vim.keymap.set('n', '<leader>er', function() custom_functions.execute('run') end)
|
||||||
@@ -57,6 +61,8 @@ vim.keymap.set('n', '<leader>ec', function() custom_functions.execute('compile')
|
|||||||
vim.keymap.set('n', '<leader>eb', function() custom_functions.execute('benchmark') end)
|
vim.keymap.set('n', '<leader>eb', function() custom_functions.execute('benchmark') end)
|
||||||
vim.keymap.set('n', '<leader>eu', function() custom_functions.execute('upload') end)
|
vim.keymap.set('n', '<leader>eu', function() custom_functions.execute('upload') end)
|
||||||
|
|
||||||
|
-- Netrw directory exploration
|
||||||
vim.keymap.set('n', '<leader>eo', ':Lexplore<CR>', options)
|
vim.keymap.set('n', '<leader>eo', ':Lexplore<CR>', options)
|
||||||
|
|
||||||
vim.keymap.set('n', '<leader>l', ':Lazy<CR>', options)
|
-- Allow for leaving Terminal mode using the escape key instead of the odd default
|
||||||
|
vim.keymap.set('t', '<Esc>', '<C-\\><C-n>')
|
||||||
|
|||||||
77
nvim/lua/language_support.lua
Normal file
77
nvim/lua/language_support.lua
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
-- Treesitter
|
||||||
|
-- def tsi [parser: string] {
|
||||||
|
-- let tree = $"($env.HOME)/.local/share/nvim/site"
|
||||||
|
-- luarocks $"--tree=($tree)" install $"tree-sitter-($parser)"
|
||||||
|
-- }
|
||||||
|
|
||||||
|
local rocks_path = vim.fn.stdpath("data") .. "/site/lib/luarocks/rocks-5.1"
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
|
callback = function (args)
|
||||||
|
pcall(vim.treesitter.start, args.buf)
|
||||||
|
end
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.diagnostic.config({
|
||||||
|
underline = true,
|
||||||
|
virtual_text = {
|
||||||
|
prefix = "●",
|
||||||
|
source = 'always',
|
||||||
|
},
|
||||||
|
-- signs = true,
|
||||||
|
severity_sort = true,
|
||||||
|
-- update_in_insert = true,
|
||||||
|
float = {
|
||||||
|
source = 'always'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
-- LSP
|
||||||
|
vim.pack.add({
|
||||||
|
'https://github.com/neovim/nvim-lspconfig',
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Auto set keymaps and other settings on LSP attach
|
||||||
|
vim.api.nvim_create_autocmd('LspAttach', {
|
||||||
|
group = vim.api.nvim_create_augroup('my.lsp', {}),
|
||||||
|
callback = function(args)
|
||||||
|
-- Native completion
|
||||||
|
-- local client = assert(vim.lsp.get_client_by_id(args.data.client_id))
|
||||||
|
-- local chars = {}; for i = 32, 126 do table.insert(chars, string.char(i)) end
|
||||||
|
-- client.server_capabilities.completionProvider.triggerCharacters = chars
|
||||||
|
--
|
||||||
|
-- vim.lsp.completion.enable(true, args.data.client_id, args.buf, {
|
||||||
|
-- autotrigger = true,
|
||||||
|
-- convert = function(item)
|
||||||
|
-- local abbr = item.label
|
||||||
|
-- abbr = abbr:gsub("%b()", ""):gsub("%b{}", "")
|
||||||
|
-- abbr = abbr:match("[%w_.]+.*") or abbr
|
||||||
|
-- abbr = #abbr > 20 and abbr:sub(1, 19) .. "..." or abbr
|
||||||
|
--
|
||||||
|
-- return { abbr = abbr }
|
||||||
|
-- end,
|
||||||
|
-- })
|
||||||
|
|
||||||
|
-- Keyboard Mappings
|
||||||
|
local bufnr = args.buf
|
||||||
|
|
||||||
|
local bufopts = { noremap = true, silent = true, buffer = bufnr }
|
||||||
|
vim.keymap.set('n', '<C-[>', vim.diagnostic.goto_prev, bufopts)
|
||||||
|
vim.keymap.set('n', '<C-]>', vim.diagnostic.goto_next, bufopts)
|
||||||
|
vim.keymap.set('n', 'ga', vim.lsp.buf.code_action, bufopts)
|
||||||
|
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts)
|
||||||
|
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts)
|
||||||
|
vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts)
|
||||||
|
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts)
|
||||||
|
vim.keymap.set('n', 'gs', vim.lsp.buf.signature_help, bufopts)
|
||||||
|
vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts)
|
||||||
|
vim.keymap.set('n', '<leader>D', vim.lsp.buf.type_definition, bufopts)
|
||||||
|
vim.keymap.set('n', '<leader><leader>f', function() vim.lsp.buf.format { async = true } end, bufopts)
|
||||||
|
vim.keymap.set('n', '<leader>r', vim.lsp.buf.rename, bufopts)
|
||||||
|
vim.keymap.set('i', '<c-space>', vim.lsp.completion.get, bufopts)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Enable LSP engines
|
||||||
|
-- vim.lsp.enable('clangd')
|
||||||
|
vim.lsp.enable('gdscript')
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
vim.lsp.handlers['textDocument/publishDiagnostics'] = vim.lsp.with(
|
|
||||||
vim.lsp.diagnostic.on_publish_diagnostics, {
|
|
||||||
underline = true,
|
|
||||||
virtual_text = true,
|
|
||||||
signs = true,
|
|
||||||
update_in_insert = true,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
@@ -1,41 +1,43 @@
|
|||||||
local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim'
|
require('vim._core.ui2').enable()
|
||||||
|
|
||||||
if not vim.loop.fs_stat(lazypath) then
|
-- Load the following plugins eagerly to prevent visual oddities
|
||||||
vim.fn.system({
|
vim.pack.add({
|
||||||
'git',
|
'https://github.com/sainnhe/gruvbox-material',
|
||||||
'clone',
|
|
||||||
'--filter=blob:none',
|
|
||||||
'https://github.com/folke/lazy.nvim.git',
|
|
||||||
'--branch=stable',
|
|
||||||
lazypath,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
vim.opt.rtp:prepend(lazypath)
|
|
||||||
|
|
||||||
require('lazy').setup({
|
|
||||||
require('plugins.lspconfig'), -- LSP configuration
|
|
||||||
require('plugins.mason'), -- LSP and DAP manager
|
|
||||||
require('plugins.gruvbox'), -- Colorscheme
|
|
||||||
require('plugins.comment'), -- Simple language specific commenting shortcuts
|
|
||||||
require('plugins.dap'), -- DAP debugging plugin
|
|
||||||
require('plugins.dap-python'), -- Debug plugin settings specifically for python
|
|
||||||
require('plugins.treesitter'), -- Treesitter syntax highlighting and tree support
|
|
||||||
require('plugins.gitsigns'), -- Gutter symbols for Git status and quick actions for Git operations
|
|
||||||
require('plugins.luasnip'), -- Snippet engine
|
|
||||||
-- require('plugins.nvim-lint'), -- Linter loader
|
|
||||||
require('plugins.nvim-cmp'), -- Autocompletion engine
|
|
||||||
require('plugins.lualine'), -- Status line
|
|
||||||
require('plugins.telekasten'), -- Note taking setup
|
|
||||||
require('plugins.telescope'), -- Floating windows for searching and other operations
|
|
||||||
'tpope/vim-surround', -- Change surrounding symbols
|
|
||||||
require('plugins.floaterm'), -- Floating terminal
|
|
||||||
require('plugins.vim-godot'), -- Godot specific bindings and debug
|
|
||||||
-- require('plugins.markdown-preview'), -- Open a preview of markdown rendered in a browser
|
|
||||||
require('plugins.render-markdown'), -- Render markdown directly in nvim (experimental, may take over for markdown-preview)
|
|
||||||
require('plugins.autopairs'), -- Autocomplete symbol pairs when typing (experimental)
|
|
||||||
require('plugins.twilight'), -- Focus mode, dim lines around the current segment of code
|
|
||||||
require('plugins.yaml-companion'), -- Additional YAML and JSON schema helper
|
|
||||||
require('plugins.fugitive'), -- _The_ Git integration plugin people have been using forever
|
|
||||||
-- require('plugins.schemastore'), -- Loads YAML and JSON schemas for autocompletion
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
vim.g.gruvbox_material_enable_italic = true
|
||||||
|
vim.g.gruvbox_material_background = 'hard'
|
||||||
|
vim.g.gruvbox_material_better_performance = 1
|
||||||
|
vim.cmd.colorscheme('gruvbox-material')
|
||||||
|
|
||||||
|
require('plugins.lualine') -- Status line plugin
|
||||||
|
|
||||||
|
-- vim.schedule defers plugin loading for after the main loop starts
|
||||||
|
-- Startup is cleaner and faster than ever
|
||||||
|
vim.schedule(function ()
|
||||||
|
require('plugins.gitsigns') -- Git gutter notifiers
|
||||||
|
require('plugins.nvim-cmp') -- Autocompletion plugin (TODO: Move to builtin completion?)
|
||||||
|
require('plugins.telescope') -- Floating window fuzzy searching different sources
|
||||||
|
require('plugins.telekasten') -- Note taking plugins
|
||||||
|
require('plugins.mason') -- LSP and DAP manager
|
||||||
|
require('plugins.twilight') -- Focus mode, dim lines around the cursor's location
|
||||||
|
require('plugins.render-markdown') -- Render markdown directly in neovim
|
||||||
|
require('plugins.luasnip') -- Snippet engine
|
||||||
|
require('plugins.treesitter') -- Syntax highlighting and tree support
|
||||||
|
|
||||||
|
vim.pack.add({'https://github.com/windwp/nvim-autopairs'}) -- Autocomplete symbol pairs when typing
|
||||||
|
vim.pack.add({'https://github.com/tpope/vim-surround'}) -- Change surrounding characters (doesn't need setup called)
|
||||||
|
vim.pack.add({'https://github.com/habamax/vim-godot'}) -- Godot specific bindings and debug
|
||||||
|
|
||||||
|
require('nvim-autopairs').setup()
|
||||||
|
end)
|
||||||
|
|
||||||
|
-- TODO: Still in need of translation to the new setup
|
||||||
|
-- require('plugins.dap'), -- DAP debugging plugin
|
||||||
|
-- require('plugins.dap-python'), -- Debug plugin settings specifically for python
|
||||||
|
-- require('plugins.yaml-companion'), -- Additional YAML and JSON schema helper
|
||||||
|
|
||||||
|
-- Currently not enabled
|
||||||
|
-- require('plugins.nvim-lint'), -- Linter loader
|
||||||
|
-- require('plugins.fugitive'), -- _The_ Git integration plugin people have been using forever
|
||||||
|
-- require('plugins.schemastore'), -- Loads YAML and JSON schemas for autocompletion
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
return {
|
|
||||||
'windwp/nvim-autopairs',
|
|
||||||
config = function()
|
|
||||||
require('nvim-autopairs').setup()
|
|
||||||
end
|
|
||||||
}
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
return {
|
|
||||||
'numToStr/Comment.nvim',
|
|
||||||
config = function()
|
|
||||||
require('Comment').setup {
|
|
||||||
ignore = '^$',
|
|
||||||
toggler = {
|
|
||||||
line = 'gc',
|
|
||||||
block = '<nop>',
|
|
||||||
},
|
|
||||||
}
|
|
||||||
end,
|
|
||||||
keys = {
|
|
||||||
{ '<leader>c', ':norm gcc<CR>' },
|
|
||||||
{ '<leader>c', ':norm gc<CR>', mode = 'v' },
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
return {
|
|
||||||
'voldikss/vim-floaterm',
|
|
||||||
keys = {
|
|
||||||
{ 't', ':FloatermToggle myfloat<CR>' },
|
|
||||||
{ '<ESC>', '<C-\\><C-n>:q<CR>', mode = 't' },
|
|
||||||
},
|
|
||||||
lazy = false,
|
|
||||||
}
|
|
||||||
@@ -1,52 +1,52 @@
|
|||||||
return {
|
vim.pack.add({
|
||||||
'lewis6991/gitsigns.nvim',
|
'https://github.com/lewis6991/gitsigns.nvim'
|
||||||
config = function()
|
})
|
||||||
require('gitsigns').setup {
|
|
||||||
on_attach = function(bufnr)
|
|
||||||
local gitsigns = require('gitsigns')
|
|
||||||
|
|
||||||
local function map(mode, l, r, opts)
|
require('gitsigns').setup {
|
||||||
opts = opts or {}
|
on_attach = function(bufnr)
|
||||||
opts.buffer = bufnr
|
local gitsigns = require('gitsigns')
|
||||||
vim.keymap.set(mode, l, r, opts)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Navigation
|
-- TODO: Move to custom functions?
|
||||||
map('n', ']c', function()
|
local function map(mode, l, r, opts)
|
||||||
if vim.wo.diff then
|
opts = opts or {}
|
||||||
vim.cmd.normal({ ']c', bang = true })
|
opts.buffer = bufnr
|
||||||
else
|
vim.keymap.set(mode, l, r, opts)
|
||||||
gitsigns.nav_hunk('next')
|
end
|
||||||
end
|
|
||||||
end)
|
|
||||||
|
|
||||||
map('n', '[c', function()
|
-- Navigation
|
||||||
if vim.wo.diff then
|
map('n', ']c', function()
|
||||||
vim.cmd.normal({ '[c', bang = true })
|
if vim.wo.diff then
|
||||||
else
|
vim.cmd.normal({ ']c', bang = true })
|
||||||
gitsigns.nav_hunk('prev')
|
else
|
||||||
end
|
gitsigns.nav_hunk('next')
|
||||||
end)
|
|
||||||
|
|
||||||
-- Actions
|
|
||||||
map('n', '<leader>gs', gitsigns.stage_hunk)
|
|
||||||
map('n', '<leader>gu', gitsigns.undo_stage_hunk)
|
|
||||||
map('n', '<leader>gr', gitsigns.reset_hunk)
|
|
||||||
map('v', '<leader>gs', function() gitsigns.stage_hunk { vim.fn.line('.'), vim.fn.line('v') } end)
|
|
||||||
map('v', '<leader>gu', function() gitsigns.undo_stage_hunk { vim.fn.line('.'), vim.fn.line('v') } end)
|
|
||||||
map('v', '<leader>gr', function() gitsigns.reset_hunk { vim.fn.line('.'), vim.fn.line('v') } end)
|
|
||||||
map('n', '<leader>gS', gitsigns.stage_buffer)
|
|
||||||
map('n', '<leader>gR', gitsigns.reset_buffer)
|
|
||||||
map('n', '<leader>gp', gitsigns.preview_hunk)
|
|
||||||
map('n', '<leader>gb', function() gitsigns.blame_line { full = true } end)
|
|
||||||
map('n', '<leader>gtb', gitsigns.toggle_current_line_blame)
|
|
||||||
map('n', '<leader>gd', gitsigns.diffthis)
|
|
||||||
map('n', '<leader>gD', function() gitsigns.diffthis('~') end)
|
|
||||||
map('n', '<leader>gtd', gitsigns.toggle_deleted)
|
|
||||||
|
|
||||||
-- Text object
|
|
||||||
map({ 'o', 'x' }, 'ih', ':<C-U>Gitsigns select_hunk<CR>')
|
|
||||||
end
|
end
|
||||||
}
|
end)
|
||||||
end,
|
|
||||||
|
map('n', '[c', function()
|
||||||
|
if vim.wo.diff then
|
||||||
|
vim.cmd.normal({ '[c', bang = true })
|
||||||
|
else
|
||||||
|
gitsigns.nav_hunk('prev')
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
-- Actions
|
||||||
|
map('n', '<leader>gs', gitsigns.stage_hunk)
|
||||||
|
map('n', '<leader>gu', gitsigns.undo_stage_hunk)
|
||||||
|
map('n', '<leader>gr', gitsigns.reset_hunk)
|
||||||
|
map('v', '<leader>gs', function() gitsigns.stage_hunk { vim.fn.line('.'), vim.fn.line('v') } end)
|
||||||
|
map('v', '<leader>gu', function() gitsigns.undo_stage_hunk { vim.fn.line('.'), vim.fn.line('v') } end)
|
||||||
|
map('v', '<leader>gr', function() gitsigns.reset_hunk { vim.fn.line('.'), vim.fn.line('v') } end)
|
||||||
|
map('n', '<leader>gS', gitsigns.stage_buffer)
|
||||||
|
map('n', '<leader>gR', gitsigns.reset_buffer)
|
||||||
|
map('n', '<leader>gp', gitsigns.preview_hunk)
|
||||||
|
map('n', '<leader>gb', function() gitsigns.blame_line { full = true } end)
|
||||||
|
map('n', '<leader>gtb', gitsigns.toggle_current_line_blame)
|
||||||
|
map('n', '<leader>gd', gitsigns.diffthis)
|
||||||
|
map('n', '<leader>gD', function() gitsigns.diffthis('~') end)
|
||||||
|
map('n', '<leader>gtd', gitsigns.toggle_deleted)
|
||||||
|
|
||||||
|
-- Text object
|
||||||
|
map({ 'o', 'x' }, 'ih', ':<C-U>Gitsigns select_hunk<CR>')
|
||||||
|
end
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +0,0 @@
|
|||||||
return {
|
|
||||||
'sainnhe/gruvbox-material',
|
|
||||||
config = function()
|
|
||||||
vim.g.gruvbox_material_enable_italic = true
|
|
||||||
vim.g.gruvbox_material_background = 'hard'
|
|
||||||
vim.cmd.colorscheme('gruvbox-material')
|
|
||||||
end,
|
|
||||||
lazy = false,
|
|
||||||
priority = 1000,
|
|
||||||
}
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
return {
|
|
||||||
'neovim/nvim-lspconfig',
|
|
||||||
config = function()
|
|
||||||
vim.diagnostic.config({
|
|
||||||
virtual_text = {
|
|
||||||
source = 'always',
|
|
||||||
},
|
|
||||||
severity_sort = true,
|
|
||||||
float = {
|
|
||||||
source = 'always'
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Auto set keymaps and other settings on LSP attach
|
|
||||||
vim.api.nvim_create_autocmd('LspAttach', {
|
|
||||||
group = vim.api.nvim_create_augroup('my.lsp', {}),
|
|
||||||
callback = function(args)
|
|
||||||
local bufnr = args.buf
|
|
||||||
|
|
||||||
-- Keyboard Mappings
|
|
||||||
local bufopts = { noremap = true, silent = true, buffer = bufnr }
|
|
||||||
vim.keymap.set('n', '<C-[>', vim.diagnostic.goto_prev, bufopts)
|
|
||||||
vim.keymap.set('n', '<C-]>', vim.diagnostic.goto_next, bufopts)
|
|
||||||
vim.keymap.set('n', 'ga', vim.lsp.buf.code_action, bufopts)
|
|
||||||
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts)
|
|
||||||
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts)
|
|
||||||
vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts)
|
|
||||||
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts)
|
|
||||||
vim.keymap.set('n', 'gs', vim.lsp.buf.signature_help, bufopts)
|
|
||||||
vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts)
|
|
||||||
vim.keymap.set('n', '<leader>D', vim.lsp.buf.type_definition, bufopts)
|
|
||||||
vim.keymap.set('n', '<leader><leader>f', function() vim.lsp.buf.format { async = true } end, bufopts)
|
|
||||||
vim.keymap.set('n', '<leader>r', vim.lsp.buf.rename, bufopts)
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
||||||
vim.lsp.enable('gdscript')
|
|
||||||
end
|
|
||||||
}
|
|
||||||
@@ -6,26 +6,23 @@ local function get_schema()
|
|||||||
return schema.result[1].name
|
return schema.result[1].name
|
||||||
end
|
end
|
||||||
|
|
||||||
return {
|
vim.pack.add({
|
||||||
'nvim-lualine/lualine.nvim',
|
'https://github.com/nvim-tree/nvim-web-devicons',
|
||||||
config = function()
|
'https://github.com/nvim-lualine/lualine.nvim'
|
||||||
require('lualine').setup {
|
})
|
||||||
tabline = {
|
|
||||||
lualine_a = {
|
require('lualine').setup {
|
||||||
'tabs',
|
tabline = {
|
||||||
},
|
lualine_a = {
|
||||||
lualine_z = {
|
'tabs',
|
||||||
'buffers',
|
},
|
||||||
}
|
lualine_z = {
|
||||||
},
|
'buffers',
|
||||||
sections = {
|
|
||||||
lualine_x = {
|
|
||||||
'encoding', 'fileformat', 'filetype', get_schema
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
end,
|
|
||||||
dependencies = {
|
|
||||||
'nvim-tree/nvim-web-devicons'
|
|
||||||
},
|
},
|
||||||
|
sections = {
|
||||||
|
lualine_x = {
|
||||||
|
'encoding', 'fileformat', 'filetype', get_schema
|
||||||
|
},
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,20 @@
|
|||||||
return {
|
vim.pack.add({
|
||||||
'L3MON4D3/LuaSnip',
|
'https://github.com/saadparwaiz1/cmp_luasnip',
|
||||||
config = function()
|
'https://github.com/rafamadriz/friendly-snippets',
|
||||||
require('luasnip.loaders.from_vscode').lazy_load()
|
'https://github.com/L3MON4D3/LuaSnip'
|
||||||
require('luasnip.loaders.from_lua').lazy_load({ paths = "./snippets" })
|
})
|
||||||
end,
|
|
||||||
dependencies = {
|
local luasnip_lua_path = vim.api.nvim_get_runtime_file('lua/luasnip/init.lua', false)[1]
|
||||||
'saadparwaiz1/cmp_luasnip', -- Wrapper to load snippets in nvim-cmp
|
if not luasnip_lua_path then return end
|
||||||
'rafamadriz/friendly-snippets',
|
local luasnip_root = vim.fn.fnamemodify(luasnip_lua_path, ':h:h:h')
|
||||||
},
|
|
||||||
build = "make install_jsregexp"
|
vim.api.nvim_create_autocmd('PackChanged', { callback = function(args)
|
||||||
}
|
local name, kind = args.data.spec.name, args.data.kind
|
||||||
|
if name == 'luasnip' and kind == 'update' then
|
||||||
|
if not args.data.active then vim.cmd.packadd('luasnip') end
|
||||||
|
vim.system({'make', 'install_jsregexp'}, { cwd = luasnip_root })
|
||||||
|
end
|
||||||
|
end})
|
||||||
|
|
||||||
|
require('luasnip.loaders.from_vscode').lazy_load()
|
||||||
|
require('luasnip.loaders.from_lua').lazy_load({ paths = "./snippets" })
|
||||||
|
|||||||
@@ -1,15 +0,0 @@
|
|||||||
return {
|
|
||||||
'iamcco/markdown-preview.nvim',
|
|
||||||
cmd = { 'MarkdownPreviewToggle', 'MarkdownPreview', 'MarkdownPreviewStop' },
|
|
||||||
ft = { 'markdown' },
|
|
||||||
build = function()
|
|
||||||
vim.fn['mkdp#util#install']()
|
|
||||||
end,
|
|
||||||
keys = {
|
|
||||||
{
|
|
||||||
'<leader>md',
|
|
||||||
':MarkdownPreviewToggle<CR>',
|
|
||||||
desc = 'Toggles Markdown preview service'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@@ -1,27 +1,22 @@
|
|||||||
return {
|
vim.pack.add({
|
||||||
'mason-org/mason.nvim',
|
'https://github.com/mason-org/mason.nvim',
|
||||||
config = function()
|
'https://github.com/mason-org/mason-lspconfig.nvim',
|
||||||
require('mason').setup()
|
})
|
||||||
|
|
||||||
require('mason-lspconfig').setup {
|
require('mason').setup()
|
||||||
automatic_enable = true,
|
require('mason-lspconfig').setup {
|
||||||
ensure_installed = {
|
automatic_enable = true,
|
||||||
'ansiblels', -- Ansible
|
ensure_installed = {
|
||||||
'arduino_language_server', -- Arduino specific C
|
'ansiblels', -- Ansible
|
||||||
'bashls', -- Bash
|
'arduino_language_server', -- Arduino specific C
|
||||||
'clangd', -- C/C++
|
'bashls', -- Bash
|
||||||
'intelephense', -- PHP
|
'clangd', -- C/C++
|
||||||
'lua_ls', -- Lua
|
'intelephense', -- PHP
|
||||||
'marksman', -- markdown
|
'lua_ls', -- Lua
|
||||||
'pylsp', -- Python
|
'marksman', -- markdown
|
||||||
'rust_analyzer', -- Rust
|
'pylsp', -- Python
|
||||||
'ts_ls', -- Typscript
|
'rust_analyzer', -- Rust
|
||||||
'yamlls', -- YAML
|
'ts_ls', -- Typscript
|
||||||
}
|
'yamlls', -- YAML
|
||||||
}
|
}
|
||||||
end,
|
|
||||||
dependencies = {
|
|
||||||
'mason-org/mason-lspconfig.nvim',
|
|
||||||
},
|
|
||||||
lazy = false,
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,70 +1,66 @@
|
|||||||
return {
|
vim.pack.add({
|
||||||
'hrsh7th/nvim-cmp',
|
'https://github.com/hrsh7th/nvim-cmp',
|
||||||
config = function()
|
'https://github.com/hrsh7th/cmp-nvim-lsp',
|
||||||
local cmp = require('cmp')
|
'https://github.com/hrsh7th/cmp-buffer',
|
||||||
cmp.setup {
|
'https://github.com/hrsh7th/cmp-path',
|
||||||
completion = {
|
'https://github.com/hrsh7th/cmp-cmdline',
|
||||||
completeopt = 'menu,menuone,noinsert',
|
'https://github.com/hrsh7th/cmp-nvim-lua',
|
||||||
},
|
})
|
||||||
experimental = {
|
|
||||||
ghost_text = true,
|
|
||||||
},
|
|
||||||
mapping = {
|
|
||||||
['<C-n>'] = cmp.mapping.select_next_item(),
|
|
||||||
['<C-p>'] = cmp.mapping.select_prev_item(),
|
|
||||||
['<C-j>'] = cmp.mapping.scroll_docs(-4),
|
|
||||||
['<C-k>'] = cmp.mapping.scroll_docs(4),
|
|
||||||
['<C-space>'] = cmp.mapping.complete(),
|
|
||||||
['<C-y>'] = cmp.mapping.confirm({
|
|
||||||
behavior = cmp.ConfirmBehavior.Insert,
|
|
||||||
select = true,
|
|
||||||
}),
|
|
||||||
},
|
|
||||||
formatting = {
|
|
||||||
format = function(entry, vim_item)
|
|
||||||
vim_item.menu = ({
|
|
||||||
buffer = '[Buf]',
|
|
||||||
luasnip = '[Snips]',
|
|
||||||
nvim_lsp = '[LSP]',
|
|
||||||
nvim_lua = '[Lua]',
|
|
||||||
})[entry.source.name]
|
|
||||||
return vim_item
|
|
||||||
end,
|
|
||||||
field = { 'abbr', 'kind', 'menu' }
|
|
||||||
},
|
|
||||||
sources = cmp.config.sources({
|
|
||||||
{ name = 'nvim_lsp' },
|
|
||||||
{ name = 'luasnip' },
|
|
||||||
{ name = 'path' },
|
|
||||||
{ name = 'render-markdown' },
|
|
||||||
}, {
|
|
||||||
{ name = 'buffer' },
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
cmp.setup.cmdline(':', {
|
local cmp = require('cmp')
|
||||||
mapping = cmp.mapping.preset.cmdline(),
|
|
||||||
sources = cmp.config.sources({
|
|
||||||
{ name = 'path' },
|
|
||||||
}, {
|
|
||||||
{ name = 'cmdline' },
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
cmp.setup.cmdline({ '/', '?' }, {
|
cmp.setup {
|
||||||
mapping = cmp.mapping.preset.cmdline(),
|
completion = {
|
||||||
sources = {
|
completeopt = 'menu,menuone,noinsert',
|
||||||
{ name = 'buffer' }
|
|
||||||
}
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
dependencies = {
|
|
||||||
{ 'hrsh7th/cmp-nvim-lsp', lazy = false },
|
|
||||||
{ 'hrsh7th/cmp-buffer', lazy = false },
|
|
||||||
{ 'hrsh7th/cmp-path', lazy = false },
|
|
||||||
{ 'hrsh7th/cmp-cmdline', lazy = false },
|
|
||||||
{ 'L3MON4D3/LuaSnip', lazy = false },
|
|
||||||
},
|
},
|
||||||
event = 'InsertEnter',
|
experimental = {
|
||||||
lazy = false,
|
ghost_text = true,
|
||||||
|
},
|
||||||
|
mapping = {
|
||||||
|
['<C-n>'] = cmp.mapping.select_next_item(),
|
||||||
|
['<C-p>'] = cmp.mapping.select_prev_item(),
|
||||||
|
['<C-j>'] = cmp.mapping.scroll_docs(-4),
|
||||||
|
['<C-k>'] = cmp.mapping.scroll_docs(4),
|
||||||
|
['<C-space>'] = cmp.mapping.complete(),
|
||||||
|
['<C-y>'] = cmp.mapping.confirm({
|
||||||
|
behavior = cmp.ConfirmBehavior.Insert,
|
||||||
|
select = true,
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
formatting = {
|
||||||
|
format = function(entry, vim_item)
|
||||||
|
vim_item.menu = ({
|
||||||
|
buffer = '[Buf]',
|
||||||
|
luasnip = '[Snips]',
|
||||||
|
nvim_lsp = '[LSP]',
|
||||||
|
nvim_lua = '[Lua]',
|
||||||
|
})[entry.source.name]
|
||||||
|
return vim_item
|
||||||
|
end,
|
||||||
|
field = { 'abbr', 'kind', 'menu' }
|
||||||
|
},
|
||||||
|
sources = cmp.config.sources({
|
||||||
|
{ name = 'nvim_lsp' },
|
||||||
|
{ name = 'luasnip' },
|
||||||
|
{ name = 'path' },
|
||||||
|
{ name = 'render-markdown' },
|
||||||
|
}, {
|
||||||
|
{ name = 'buffer' },
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cmp.setup.cmdline(':', {
|
||||||
|
mapping = cmp.mapping.preset.cmdline(),
|
||||||
|
sources = cmp.config.sources({
|
||||||
|
{ name = 'path' },
|
||||||
|
}, {
|
||||||
|
{ name = 'cmdline' },
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
cmp.setup.cmdline({ '/', '?' }, {
|
||||||
|
mapping = cmp.mapping.preset.cmdline(),
|
||||||
|
sources = {
|
||||||
|
{ name = 'buffer' }
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
return {
|
vim.pack.add({
|
||||||
'meanderingprogrammer/render-markdown.nvim',
|
'https://github.com/meanderingprogrammer/render-markdown.nvim'
|
||||||
config = function()
|
})
|
||||||
require('render-markdown').setup({
|
|
||||||
enabled = true,
|
require('render-markdown').setup({
|
||||||
render_modes = { 'n', 'c', 't' },
|
enabled = true,
|
||||||
max_file_size = 10.0,
|
render_modes = { 'n', 'c', 't' },
|
||||||
file_types = {
|
max_file_size = 10.0,
|
||||||
'markdown',
|
file_types = {
|
||||||
'telekasten'
|
'markdown',
|
||||||
},
|
'telekasten'
|
||||||
})
|
},
|
||||||
end,
|
})
|
||||||
}
|
|
||||||
|
|||||||
@@ -2,58 +2,31 @@ function string.insert(str1, str2, pos)
|
|||||||
return str1:sub(1, pos) .. str2 .. str1:sub(pos + 1)
|
return str1:sub(1, pos) .. str2 .. str1:sub(pos + 1)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- function ToggleTODO(current_line)
|
vim.pack.add({
|
||||||
-- local todo_str = '%- %[ %] '
|
'https://github.com/renerocksai/telekasten.nvim'
|
||||||
-- local todo_checked_str = '%- %[x%] '
|
})
|
||||||
|
|
||||||
-- if current_line:find(todo_str, 1) then
|
local home = vim.fn.expand('~/.zettelkasten')
|
||||||
-- return string.gsub(current_line, todo_str, '', 1)
|
require('telekasten').setup({
|
||||||
-- elseif current_line:find(todo_checked_str, 1) then
|
home = home,
|
||||||
-- return string.gsub(current_line, todo_checked_str, '', 1)
|
dailies = home .. '/' .. 'daily',
|
||||||
-- else
|
weeklies = home .. '/' .. 'weeklies',
|
||||||
-- local first_idx = current_line:find('[%-%w]', 1) - 1
|
templates = home .. '/' .. 'templates',
|
||||||
-- return string.insert(current_line, '- [ ] ', first_idx)
|
template_new_note = home .. '/' .. 'templates/new_note.md',
|
||||||
-- end
|
template_new_daily = home .. '/' .. 'templates/daily.md',
|
||||||
-- end
|
template_new_weekly = home .. '/' .. 'templates/weekly.md',
|
||||||
|
command_palette_theme = 'ivy',
|
||||||
|
show_tags_theme = 'get_cursor',
|
||||||
|
plug_into_calendar = false,
|
||||||
|
})
|
||||||
|
|
||||||
-- vim.api.nvim_create_user_command('ToggleTODO', function()
|
-- Color for telekasten syntax
|
||||||
-- local current_line = vim.api.nvim_get_current_line()
|
vim.api.nvim_set_hl(0, 'tkLink', { ctermfg = 72, cterm = { bold = true, underdouble = true }, fg = '#689d6a', bold = true, underdouble = true })
|
||||||
-- local row, _ = unpack(vim.api.nvim_win_get_cursor(0))
|
vim.api.nvim_set_hl(0, 'tkBrackets', { ctermfg = 'gray', fg = 'gray' })
|
||||||
|
vim.api.nvim_set_hl(0, 'tkTag', { ctermfg = 'gray', fg = 'gray' })
|
||||||
|
|
||||||
-- local new_line = ToggleTODO(current_line)
|
vim.keymap.set('n', '<leader>zt', ':Telekasten toggle_todo<CR>')
|
||||||
|
vim.keymap.set('n', '<leader>zf', ':Telekasten find_notes<CR>')
|
||||||
-- vim.api.nvim_buf_set_lines(0, row - 1, row, true, { new_line })
|
vim.keymap.set('n', '<leader>zn', ':Telekasten new_note<CR>')
|
||||||
-- end, {})
|
vim.keymap.set('n', '<leader>zp', ':Telekasten panel<CR>')
|
||||||
|
vim.keymap.set('n', '<leader>zT', ':Telekasten goto_today<CR>')
|
||||||
return {
|
|
||||||
'renerocksai/telekasten.nvim',
|
|
||||||
config = function()
|
|
||||||
local home = vim.fn.expand('~/.zettelkasten')
|
|
||||||
require('telekasten').setup({
|
|
||||||
home = home,
|
|
||||||
dailies = home .. '/' .. 'daily',
|
|
||||||
weeklies = home .. '/' .. 'weeklies',
|
|
||||||
templates = home .. '/' .. 'templates',
|
|
||||||
template_new_note = home .. '/' .. 'templates/new_note.md',
|
|
||||||
template_new_daily = home .. '/' .. 'templates/daily.md',
|
|
||||||
template_new_weekly = home .. '/' .. 'templates/weekly.md',
|
|
||||||
command_palette_theme = 'ivy',
|
|
||||||
show_tags_theme = 'get_cursor',
|
|
||||||
plug_into_calendar = false,
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Color for telekasten syntax
|
|
||||||
vim.api.nvim_set_hl(0, 'tkLink', { ctermfg = 72, cterm = { bold = true, underdouble = true }, fg = '#689d6a', bold = true, underdouble = true })
|
|
||||||
vim.api.nvim_set_hl(0, 'tkBrackets', { ctermfg = 'gray', fg = 'gray' })
|
|
||||||
vim.api.nvim_set_hl(0, 'tkTag', { ctermfg = 'gray', fg = 'gray' })
|
|
||||||
end,
|
|
||||||
keys = {
|
|
||||||
{ '<leader>zt', ':Telekasten toggle_todo<CR>' },
|
|
||||||
{ '<leader>zfn', ':Telekasten find_notes<CR>' },
|
|
||||||
{ '<leader>zft', ':Telekasten show_tags<CR>' },
|
|
||||||
{ '<leader>zn', ':Telekasten new_note<CR>' },
|
|
||||||
{ '<leader>zp', ':Telekasten panel<CR>' },
|
|
||||||
},
|
|
||||||
lazy = false
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,148 +1,63 @@
|
|||||||
return {
|
vim.pack.add({
|
||||||
'nvim-telescope/telescope.nvim',
|
'https://github.com/kevinhwang91/nvim-bqf',
|
||||||
config = function(_, opts)
|
'https://github.com/nvim-telescope/telescope-file-browser.nvim',
|
||||||
local telescope = require('telescope')
|
'https://github.com/nvim-lua/plenary.nvim',
|
||||||
local actions = require('telescope.actions')
|
'https://github.com/nvim-telescope/telescope.nvim',
|
||||||
local action_state = require('telescope.actions.state')
|
})
|
||||||
local fb_actions = telescope.extensions.file_browser.actions
|
|
||||||
|
|
||||||
opts.defaults = {
|
require('telescope').setup {
|
||||||
file_ignore_patterns = {
|
defaults = {
|
||||||
'.png$',
|
file_ignore_patterns = {
|
||||||
'.jpg$',
|
'.png$',
|
||||||
'.jpeg$',
|
'.jpg$',
|
||||||
'.ico$',
|
'.jpeg$',
|
||||||
'.icns$',
|
'.ico$',
|
||||||
'.webp$',
|
'.icns$',
|
||||||
'.uproject$',
|
'.webp$',
|
||||||
'-workspace$',
|
'.uproject$',
|
||||||
'.git/',
|
'-workspace$',
|
||||||
'.node_modules/',
|
'.git/',
|
||||||
'node_modules',
|
'.node_modules/',
|
||||||
|
'node_modules',
|
||||||
|
},
|
||||||
|
layout_config = { prompt_position = 'bottom' },
|
||||||
|
-- layout_strategy = 'vertical',
|
||||||
|
mappings = {
|
||||||
|
i = {
|
||||||
|
['<ESC>'] = require('telescope.actions').close,
|
||||||
},
|
},
|
||||||
layout_config = { prompt_position = 'bottom' },
|
},
|
||||||
layout_strategy = 'vertical',
|
prompt_prefix = ' ',
|
||||||
mappings = {
|
results_title = false,
|
||||||
i = {
|
selection_caret = '➤ ',
|
||||||
['<ESC>'] = actions.close,
|
sorting_strategy = 'ascending',
|
||||||
},
|
winblend = 0,
|
||||||
},
|
|
||||||
prompt_prefix = ' ',
|
|
||||||
results_title = false,
|
|
||||||
selection_caret = '➤ ',
|
|
||||||
sorting_strategy = 'ascending',
|
|
||||||
winblend = 0,
|
|
||||||
}
|
|
||||||
|
|
||||||
opts.pickers = {
|
|
||||||
diagnostics = {
|
|
||||||
-- theme = 'ivy',
|
|
||||||
initial_mode = 'normal',
|
|
||||||
layout_config = {
|
|
||||||
preview_cutoff = 9999,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
opts.extensions = {
|
|
||||||
file_browser = {
|
|
||||||
theme = 'dropdown',
|
|
||||||
hijack_netrw = true,
|
|
||||||
mappings = {
|
|
||||||
['n'] = {
|
|
||||||
['N'] = fb_actions.create,
|
|
||||||
['h'] = fb_actions.goto_parent_dir,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
telescope.setup(opts)
|
|
||||||
telescope.load_extension('file_browser')
|
|
||||||
end,
|
|
||||||
dependencies = {
|
|
||||||
'nvim-lua/plenary.nvim',
|
|
||||||
'nvim-telescope/telescope-file-browser.nvim',
|
|
||||||
'kevinhwang91/nvim-bqf',
|
|
||||||
},
|
},
|
||||||
keys = {
|
pickers = {
|
||||||
{
|
diagnostics = {
|
||||||
';f',
|
-- theme = 'ivy',
|
||||||
function()
|
initial_mode = 'normal',
|
||||||
require('telescope.builtin').find_files({
|
layout_config = {
|
||||||
no_ignore = false,
|
preview_cutoff = 9999,
|
||||||
hidden = true,
|
},
|
||||||
})
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
';r',
|
|
||||||
function()
|
|
||||||
require('telescope.builtin').live_grep()
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
';b',
|
|
||||||
function()
|
|
||||||
require('telescope.builtin').buffers()
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
';h',
|
|
||||||
function()
|
|
||||||
require('telescope.builtin').help_tags()
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
';;',
|
|
||||||
function()
|
|
||||||
require('telescope.builtin').resume()
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
';d',
|
|
||||||
function()
|
|
||||||
require('telescope.builtin').diagnostics()
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
';t',
|
|
||||||
function()
|
|
||||||
require('telescope.builtin').treesitter()
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
';s',
|
|
||||||
function()
|
|
||||||
require('telescope.builtin').lsp_document_symbols()
|
|
||||||
end
|
|
||||||
},
|
|
||||||
{
|
|
||||||
';w',
|
|
||||||
function()
|
|
||||||
require('telescope.builtin').lsp_dynamic_workspace_symbols()
|
|
||||||
end
|
|
||||||
},
|
|
||||||
{
|
|
||||||
';e',
|
|
||||||
function()
|
|
||||||
local telescope = require('telescope')
|
|
||||||
|
|
||||||
local function telescope_buffer_dir()
|
|
||||||
return vim.fn.expand('%:p:h')
|
|
||||||
end
|
|
||||||
|
|
||||||
telescope.extensions.file_browser.file_browser({
|
|
||||||
path = '%:p:h',
|
|
||||||
cwd = telescope_buffer_dir(),
|
|
||||||
respect_gitignore = false,
|
|
||||||
hidden = true,
|
|
||||||
grouped = true,
|
|
||||||
previewer = false,
|
|
||||||
initial_mode = 'normal',
|
|
||||||
layout_config = { height = 40 },
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
local builtin = require('telescope.builtin')
|
||||||
|
|
||||||
|
vim.keymap.set('n', ';f', function()
|
||||||
|
builtin.find_files({
|
||||||
|
no_ignore = false,
|
||||||
|
hidden = true,
|
||||||
|
})
|
||||||
|
end)
|
||||||
|
|
||||||
|
vim.keymap.set('n', ';r', function() builtin.live_grep() end)
|
||||||
|
vim.keymap.set('n', ';b', function() builtin.buffers() end)
|
||||||
|
vim.keymap.set('n', ';h', function() builtin.help_tags() end)
|
||||||
|
vim.keymap.set('n', ';;', function() builtin.resume() end)
|
||||||
|
vim.keymap.set('n', ';d', function() builtin.diagnostics() end)
|
||||||
|
vim.keymap.set('n', ';t', function() builtin.treesitter() end)
|
||||||
|
vim.keymap.set('n', ';s', function() builtin.lsp_document_symbols() end)
|
||||||
|
vim.keymap.set('n', ';w', function() builtin.lsp_dynamic_workspace_symbols() end)
|
||||||
|
|||||||
@@ -1,50 +1,55 @@
|
|||||||
return {
|
vim.pack.add({
|
||||||
'nvim-treesitter/nvim-treesitter',
|
'https://github.com/nvim-treesitter/nvim-treesitter'
|
||||||
build = function()
|
})
|
||||||
require('nvim-treesitter.install').update({ with_sync = true })
|
|
||||||
end,
|
|
||||||
config = function()
|
|
||||||
require('nvim-treesitter.configs').setup {
|
|
||||||
auto_install = true,
|
|
||||||
ensure_installed = {
|
|
||||||
'c',
|
|
||||||
'c_sharp',
|
|
||||||
'comment',
|
|
||||||
'css',
|
|
||||||
'gdscript',
|
|
||||||
'gitignore',
|
|
||||||
'html',
|
|
||||||
'java',
|
|
||||||
'javascript',
|
|
||||||
'json',
|
|
||||||
'lua',
|
|
||||||
'markdown',
|
|
||||||
'markdown_inline',
|
|
||||||
'python',
|
|
||||||
'query',
|
|
||||||
'rust',
|
|
||||||
'sql',
|
|
||||||
'tera',
|
|
||||||
'toml',
|
|
||||||
'tsx',
|
|
||||||
'typescript',
|
|
||||||
'yaml',
|
|
||||||
},
|
|
||||||
highlight = {
|
|
||||||
enable = true,
|
|
||||||
additional_vim_regex_highlighting = false,
|
|
||||||
},
|
|
||||||
incremental_selection = {
|
|
||||||
enable = true,
|
|
||||||
},
|
|
||||||
indent = {
|
|
||||||
enable = true,
|
|
||||||
},
|
|
||||||
rainbow = {
|
|
||||||
enable = true,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
vim.treesitter.language.register('markdown', 'telekasten')
|
-- require('nvim-treesitter.configs').setup {
|
||||||
end,
|
-- auto_install = true,
|
||||||
}
|
-- ensure_installed = {
|
||||||
|
-- 'c',
|
||||||
|
-- 'c_sharp',
|
||||||
|
-- 'comment',
|
||||||
|
-- 'css',
|
||||||
|
-- 'gdscript',
|
||||||
|
-- 'gitignore',
|
||||||
|
-- 'html',
|
||||||
|
-- 'java',
|
||||||
|
-- 'javascript',
|
||||||
|
-- 'json',
|
||||||
|
-- 'lua',
|
||||||
|
-- 'markdown',
|
||||||
|
-- 'markdown_inline',
|
||||||
|
-- 'python',
|
||||||
|
-- 'query',
|
||||||
|
-- 'rust',
|
||||||
|
-- 'sql',
|
||||||
|
-- 'tera',
|
||||||
|
-- 'toml',
|
||||||
|
-- 'tsx',
|
||||||
|
-- 'typescript',
|
||||||
|
-- 'yaml',
|
||||||
|
-- },
|
||||||
|
-- highlight = {
|
||||||
|
-- enable = true,
|
||||||
|
-- additional_vim_regex_highlighting = false,
|
||||||
|
-- },
|
||||||
|
-- incremental_selection = {
|
||||||
|
-- enable = true,
|
||||||
|
-- },
|
||||||
|
-- indent = {
|
||||||
|
-- enable = true,
|
||||||
|
-- },
|
||||||
|
-- rainbow = {
|
||||||
|
-- enable = true,
|
||||||
|
-- }
|
||||||
|
-- }
|
||||||
|
|
||||||
|
vim.treesitter.language.register('markdown', 'telekasten')
|
||||||
|
|
||||||
|
-- return {
|
||||||
|
-- 'nvim-treesitter/nvim-treesitter',
|
||||||
|
-- build = function()
|
||||||
|
-- require('nvim-treesitter.install').update({ with_sync = true })
|
||||||
|
-- end,
|
||||||
|
-- config = function()
|
||||||
|
-- end,
|
||||||
|
-- }
|
||||||
|
|||||||
@@ -1,21 +1,19 @@
|
|||||||
return {
|
vim.pack.add({
|
||||||
'folke/twilight.nvim',
|
'https://github.com/folke/twilight.nvim'
|
||||||
config = function()
|
})
|
||||||
require('twilight').setup({
|
|
||||||
dimming = {
|
require('twilight').setup({
|
||||||
alpha = 0.3,
|
dimming = {
|
||||||
},
|
alpha = 0.3,
|
||||||
context = 6,
|
},
|
||||||
treesitter = true,
|
context = 6,
|
||||||
expand = {
|
treesitter = true,
|
||||||
"function",
|
expand = {
|
||||||
"method",
|
"function",
|
||||||
"table",
|
"method",
|
||||||
"if_statement",
|
"table",
|
||||||
}
|
"if_statement",
|
||||||
})
|
|
||||||
end,
|
|
||||||
keys = {
|
|
||||||
{ '<leader>f', ':Twilight<CR>' }
|
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
|
|
||||||
|
vim.keymap.set('n', '<leader>f', ':Twilight<CR>')
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
return {
|
|
||||||
'airblade/vim-gitgutter'
|
|
||||||
}
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
return {
|
|
||||||
'habamax/vim-godot',
|
|
||||||
ft = 'gdscript',
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,9 @@
|
|||||||
|
-- Experimental
|
||||||
|
-- vim.o.autocomplete = true
|
||||||
|
|
||||||
vim.opt.background = 'dark' -- Force a dark background for the colorscheme
|
vim.opt.background = 'dark' -- Force a dark background for the colorscheme
|
||||||
vim.opt.clipboard = 'unnamed,unnamedplus' -- Use both the "*" and "+" registers for yanks and deletes (puts things in the system clipboard)
|
vim.opt.clipboard = 'unnamed,unnamedplus' -- Use both the "*" and "+" registers for yanks and deletes (puts things in the system clipboard)
|
||||||
vim.opt.completeopt = 'menu,menuone,noinsert' -- Change how the completion menu is interacted with
|
vim.opt.completeopt = 'fuzzy,menuone,noinsert,popup' -- Change how the completion menu is interacted with and displays
|
||||||
vim.opt.cursorcolumn = true -- Highlight the column the cursor is on
|
vim.opt.cursorcolumn = true -- Highlight the column the cursor is on
|
||||||
vim.opt.cursorline = true -- Highlight the line the cursor is on.
|
vim.opt.cursorline = true -- Highlight the line the cursor is on.
|
||||||
vim.opt.expandtab = true -- Expand tabs into spaces
|
vim.opt.expandtab = true -- Expand tabs into spaces
|
||||||
|
|||||||
13
nvim/lua/treesitter.lua
Normal file
13
nvim/lua/treesitter.lua
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
-- Treesitter
|
||||||
|
-- def tsi [parser: string] {
|
||||||
|
-- let tree = $"($env.HOME)/.local/share/nvim/site"
|
||||||
|
-- luarocks $"--tree=($tree)" install $"tree-sitter-($parser)"
|
||||||
|
-- }
|
||||||
|
|
||||||
|
local rocks_path = vim.fn.stdpath("data") .. "/site/lib/luarocks/rocks-5.1"
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
|
callback = function (args)
|
||||||
|
pcall(vim.treesitter.start, args.buf)
|
||||||
|
end
|
||||||
|
})
|
||||||
Reference in New Issue
Block a user