Compare commits

..

3 Commits

27 changed files with 922 additions and 830 deletions

View File

@@ -9,3 +9,9 @@ insert_final_newline = true
charset = utf-8 charset = utf-8
indent_style = space indent_style = space
indent_size = 2 indent_size = 2
max_line_length = 100
trim_trailing_whitespace = true
[*.md]
max_line_length = off
trim_trailing_whitespace = false

View File

@@ -1,5 +0,0 @@
{
"diagnostics.globals": [
"vim"
]
}

View File

@@ -1,24 +0,0 @@
{
"neodev": {
"library": {
"enabled": true,
"plugins": [
"nvim-lspconfig",
"lsp",
"completion",
]
}
},
"neoconf": {
"plugins": {
"lua_ls": {
"enabled": true
},
}
},
"lspconfig": {
"lua_ls": {
"Lua.completion.callSnippet": "Replace",
},
}
}

View File

@@ -1,6 +1,8 @@
-- vim: ts=2 sts=2 sw=2 et -- ╭─────────────────────────────────────────────────────────╮
-- │ ivuorinen's Neovim configuration │
-- ╰─────────────────────────────────────────────────────────╯
-- Install lazylazy -- ── Install lazylazy ────────────────────────────────────────────────
-- https://github.com/folke/lazy.nvim -- https://github.com/folke/lazy.nvim
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.uv or vim.loop).fs_stat(lazypath) then
@@ -18,29 +20,32 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then
end end
vim.opt.rtp:prepend(lazypath) vim.opt.rtp:prepend(lazypath)
-- Add ~/.local/bin to the PATH -- ── Add ~/.local/bin to the PATH ────────────────────────────────────
vim.fn.setenv('PATH', vim.fn.expand '$HOME/.local/bin' .. ':' .. vim.fn.expand '$PATH') vim.fn.setenv('PATH', vim.fn.expand '$HOME/.local/bin' .. ':' .. vim.fn.expand '$PATH')
require 'options' require 'options'
require 'autogroups'
require('lazy').setup('plugins', { -- ── Load plugins ────────────────────────────────────────────────────
require('lazy').setup(
-- Automatically load plugins from lua/plugins
'plugins',
-- Lazy Configuration
{
checker = { checker = {
-- Automatically check for updates -- Automatically check for updates
enabled = true, enabled = true,
nofity = false, -- We don't want to be notified about updates
},
change_detection = {
notify = false, notify = false,
}, },
}) change_detection = {
-- No need to notify about changes
notify = false,
},
install = {
colorscheme = { vim.g.colors_theme },
},
}
)
-- [[ Highlight on yank ]] -- vim: ts=2 sts=2 sw=2 et
-- See `:help vim.highlight.on_yank()`
local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true })
vim.api.nvim_create_autocmd('TextYankPost', {
callback = function()
vim.highlight.on_yank()
end,
group = highlight_group,
pattern = '*',
})

View File

@@ -0,0 +1,34 @@
-- ╭─────────────────────────────────────────────────────────╮
-- │ Autogroups │
-- ╰─────────────────────────────────────────────────────────╯
local augroup = vim.api.nvim_create_augroup -- Create/get autocommand group
local autocmd = vim.api.nvim_create_autocmd -- Create autocommand
-- ── Highlight on yank ───────────────────────────────────────────────
-- See `:help vim.highlight.on_yank()`
local highlight_group = augroup('YankHighlight', { clear = true })
autocmd('TextYankPost', {
callback = function()
vim.highlight.on_yank()
end,
group = highlight_group,
pattern = '*',
})
-- ── Windows to close with "q" ───────────────────────────────────────
autocmd('FileType', {
callback = function()
vim.keymap.set('n', '<esc>', ':bd<CR>', { buffer = true, silent = true })
end,
pattern = {
'help',
'startuptime',
'qf',
'lspinfo',
'man',
'checkhealth',
},
})
-- vim: ts=2 sts=2 sw=2 et

View File

@@ -1,16 +1,25 @@
-- ╭─────────────────────────────────────────────────────────╮
-- │ neovim configuration options │
-- ╰─────────────────────────────────────────────────────────╯
-- See `:help vim.opt`
-- For more options, you can see `:help option-list`
-- Enables the experimental nvim 0.5 features
vim.loader.enable()
-- Map leader and local leader
vim.g.mapleader = ' ' vim.g.mapleader = ' '
vim.g.maplocalleader = ' ' vim.g.maplocalleader = ' '
-- Set to true if you have a Nerd Font installed and selected in the terminal -- Set the colorscheme and variants
vim.g.have_nerd_font = true vim.g.colors_theme = 'tokyonight'
vim.g.colors_variant_light = 'tokyonight-day'
vim.g.colors_variant_dark = 'tokyonight-storm'
-- Make sure editorconfig support is enabled -- Make sure editorconfig support is enabled
vim.g.editorconfig = true vim.g.editorconfig = true
-- [[ Setting options ]] -- Enable line numbers and relative line numbers
-- See `:help vim.opt`
-- For more options, you can see `:help option-list`
vim.opt.number = true vim.opt.number = true
vim.opt.relativenumber = true vim.opt.relativenumber = true
@@ -22,7 +31,6 @@ 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. -- Schedule the setting after `UiEnter` because it can increase startup-time.
-- Remove this option if you want your OS clipboard to remain independent.
-- See `:help 'clipboard'` -- See `:help 'clipboard'`
vim.schedule(function() vim.schedule(function()
vim.opt.clipboard = 'unnamedplus' vim.opt.clipboard = 'unnamedplus'
@@ -34,7 +42,8 @@ vim.opt.smartindent = true -- Insert indents automatically
-- Save undo history -- Save undo history
vim.opt.undofile = true vim.opt.undofile = true
-- Case-insensitive searching UNLESS \C or one or more capital letters in the search term -- Case-insensitive searching UNLESS \C or one or
-- more capital letters in the search term
vim.opt.ignorecase = true vim.opt.ignorecase = true
vim.opt.smartcase = true vim.opt.smartcase = true
@@ -47,7 +56,7 @@ vim.wo.signcolumn = 'yes'
-- Decrease mapped sequence wait time -- Decrease mapped sequence wait time
-- Displays which-key popup sooner -- Displays which-key popup sooner
vim.opt.timeoutlen = 300 vim.opt.timeoutlen = 250
-- Configure how new splits should be opened -- Configure how new splits should be opened
vim.opt.splitright = true vim.opt.splitright = true
@@ -66,16 +75,11 @@ vim.opt.inccommand = 'split'
vim.opt.cursorline = true vim.opt.cursorline = true
-- Minimal number of screen lines to keep above and below the cursor. -- Minimal number of screen lines to keep above and below the cursor.
vim.opt.scrolloff = 10 vim.opt.scrolloff = 15
-- Enable break indent
vim.o.breakindent = true
-- Save undo history
vim.o.undofile = true
-- Set completeopt to have a better completion experience -- Set completeopt to have a better completion experience
vim.o.completeopt = 'menuone,noselect' vim.o.completeopt = 'menuone,noselect'
-- Fixes Notify opacity issues -- Fixes Notify opacity issues
vim.o.termguicolors = true vim.o.termguicolors = true
@@ -83,9 +87,25 @@ vim.o.termguicolors = true
vim.o.spell = true vim.o.spell = true
vim.o.spelllang = 'en_us' vim.o.spelllang = 'en_us'
-- Tree-sitter settings
vim.g.loaded_perl_provider = 0 vim.g.loaded_perl_provider = 0
vim.g.loaded_ruby_provider = 0
-- kevinhwang91/nvim-ufo settings
vim.o.fillchars = [[eob: ,fold: ,foldopen:,foldsep: ,foldclose:]]
vim.o.foldcolumn = '1' -- '0' is not bad
vim.o.foldlevel = 99 -- Using ufo provider need a large value, feel free to decrease the value
vim.o.foldlevelstart = 99
vim.o.foldenable = true
-- anuvyklack/windows.nvim settings
vim.o.winwidth = 15
vim.o.winminwidth = 10
vim.o.equalalways = false
-- ── Deal with word wrap ─────────────────────────────────────────────────────── -- ── Deal with word wrap ───────────────────────────────────────────────────────
local m = vim.api.nvim_set_keymap local m = vim.api.nvim_set_keymap
m('n', 'k', "v:count == 0 ? 'gk' : 'k'", { desc = 'Move up', noremap = true, expr = true }) m('n', 'k', "v:count == 0 ? 'gk' : 'k'", { desc = 'Move up', noremap = true, expr = true })
m('n', 'j', "v:count == 0 ? 'gj' : 'j'", { desc = 'Move down', noremap = true, expr = true }) m('n', 'j', "v:count == 0 ? 'gj' : 'j'", { desc = 'Move down', noremap = true, expr = true })
-- vim: ts=2 sts=2 sw=2 et

View File

@@ -7,11 +7,9 @@ return {
keys = { keys = {
{ {
'<leader>cf', '<leader>cf',
function() '<cmd>lua require("conform").format({ async = true, lsp_fallback = true })<cr>',
require('conform').format { async = true, lsp_fallback = true }
end,
mode = '', mode = '',
desc = '[f] Format buffer', desc = 'Format buffer',
}, },
}, },
opts = { opts = {

View File

@@ -1,22 +1,39 @@
return {
-- Auto completion -- Auto completion
-- https://github.com/hrsh7th/nvim-cmp -- https://github.com/hrsh7th/nvim-cmp
return {
{ {
'hrsh7th/nvim-cmp', 'hrsh7th/nvim-cmp',
lazy = false,
event = 'InsertEnter', event = 'InsertEnter',
dependencies = { dependencies = {
'hrsh7th/cmp-nvim-lsp', 'hrsh7th/cmp-nvim-lsp',
'L3MON4D3/LuaSnip', -- ── LuaSnip Dependencies ────────────────────────────────────────────
'saadparwaiz1/cmp_luasnip', -- Snippet Engine for Neovim written in Lua.
-- Adds other completion capabilities. -- https://github.com/L3MON4D3/LuaSnip
-- nvim-cmp does not ship with all sources by default. They are split { 'L3MON4D3/LuaSnip', build = 'make install_jsregexp' },
-- into multiple repos for maintenance purposes. -- luasnip completion source for nvim-cmp
'hrsh7th/cmp-nvim-lsp', -- https://github.com/saadparwaiz1/cmp_luasnip
'hrsh7th/cmp-path', { 'saadparwaiz1/cmp_luasnip' },
'onsails/lspkind.nvim', -- ── Adds other completion capabilities. ─────────────────────────────
-- ── nvim-cmp does not ship with all sources by default.
-- ── They are split into multiple repos for maintenance purposes.
{ 'hrsh7th/cmp-nvim-lsp' },
{ 'hrsh7th/cmp-buffer' },
{ 'hrsh7th/cmp-path' },
-- https://github.com/SergioRibera/cmp-dotenv
{ 'SergioRibera/cmp-dotenv' },
-- ── Other deps ──────────────────────────────────────────────────────
-- vscode-like pictograms for neovim lsp completion items
-- https://github.com/onsails/lspkind.nvim
{ 'onsails/lspkind.nvim' },
-- Lua plugin to turn github copilot into a cmp source
-- https://github.com/zbirenbaum/copilot-cmp
{ {
'zbirenbaum/copilot-cmp', 'zbirenbaum/copilot-cmp',
dependencies = { dependencies = {
-- Fully featured & enhanced replacement for copilot.vim complete
-- with API for interacting with Github Copilot
-- https://github.com/zbirenbaum/copilot.lua
{ {
'zbirenbaum/copilot.lua', 'zbirenbaum/copilot.lua',
cmd = 'Copilot', cmd = 'Copilot',
@@ -43,20 +60,37 @@ return {
local luasnip = require 'luasnip' local luasnip = require 'luasnip'
local lspkind = require 'lspkind' local lspkind = require 'lspkind'
luasnip.config.setup {} luasnip.config.setup {}
require('copilot_cmp').setup()
local has_words_before = function()
if vim.api.nvim_get_option_value('buftype', {}) == 'prompt' then
return false
end
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and vim.api.nvim_buf_get_text(0, line - 1, 0, line - 1, col, {})[1]:match '^%s*$' == nil
end
cmp.setup { cmp.setup {
formatting = { formatting = {
format = lspkind.cmp_format { format = lspkind.cmp_format {
mode = 'symbol', mode = 'symbol',
min_width = 40, max_width = function()
max_width = 100, return math.floor(0.45 * vim.o.columns)
end,
show_labelDetails = true,
symbol_map = { symbol_map = {
Copilot = '', Copilot = '',
}, },
}, },
}, },
view = { view = {
entries = 'native', width = function(_, _)
return math.min(80, vim.o.columns)
end,
entries = {
name = 'custom',
selection_order = 'near_cursor',
},
}, },
snippet = { snippet = {
expand = function(args) expand = function(args)
@@ -69,14 +103,14 @@ return {
-- Manually trigger a completion from nvim-cmp. -- Manually trigger a completion from nvim-cmp.
-- Generally you don't need this, because nvim-cmp will display -- Generally you don't need this, because nvim-cmp will display
-- completions whenever it has completion options available. -- completions whenever it has completion options available.
['<C-Space>'] = cmp.mapping.complete(), ['<C-c>'] = cmp.mapping.complete(),
['<CR>'] = cmp.mapping.confirm { ['<CR>'] = cmp.mapping.confirm {
behavior = cmp.ConfirmBehavior.Replace, behavior = cmp.ConfirmBehavior.Replace,
select = true, select = true,
}, },
['<Tab>'] = cmp.mapping(function(fallback) ['<Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then if cmp.visible() and has_words_before() then
cmp.select_next_item() cmp.select_next_item { behavior = cmp.SelectBehavior.Select }
elseif luasnip.expand_or_jumpable() then elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump() luasnip.expand_or_jump()
else else
@@ -100,6 +134,26 @@ return {
{ name = 'nvim_lsp', group_index = 2 }, { name = 'nvim_lsp', group_index = 2 },
{ name = 'path', group_index = 2 }, { name = 'path', group_index = 2 },
{ name = 'luasnip', group_index = 2 }, { name = 'luasnip', group_index = 2 },
{ name = 'buffer', group_index = 2 },
{ name = 'dotenv', group_index = 2 },
},
sorting = {
priority_weight = 2,
comparators = {
require('copilot_cmp.comparators').prioritize,
-- Below is the default comparator list and order for nvim-cmp
cmp.config.compare.offset,
-- cmp.config.compare.scopes, --this is commented in nvim-cmp too
cmp.config.compare.exact,
cmp.config.compare.score,
cmp.config.compare.recently_used,
cmp.config.compare.locality,
cmp.config.compare.kind,
cmp.config.compare.sort_text,
cmp.config.compare.length,
cmp.config.compare.order,
},
}, },
} }
end, end,

View File

@@ -9,22 +9,17 @@ return {
'ray-x/guihua.lua', 'ray-x/guihua.lua',
'leoluz/nvim-dap-go', 'leoluz/nvim-dap-go',
}, },
keys = {
{ '<leader>dt', '<cmd>DapUiToggle', desc = 'DAP: Toggle UI' },
{ '<leader>db', '<cmd>DapToggleBreakpoint', desc = 'DAP: Toggle Breakpoint' },
{ '<leader>dc', '<cmd>DapContinue', desc = 'DAP: Continue' },
{ '<leader>dr', ":lua require('dapui').open({reset = true})<CR>", desc = 'DAP: Reset' },
{ '<leader>ht', ":lua require('harpoon.ui').toggle_quick_menu()<CR>", desc = 'DAP: Harpoon UI' },
},
setup = function() setup = function()
require('dapui').setup() require('dapui').setup()
require('dap-go').setup() require('dap-go').setup()
require('nvim-dap-virtual-text').setup() require('nvim-dap-virtual-text').setup {}
vim.fn.sign_define( vim.fn.sign_define('DapBreakpoint', {
'DapBreakpoint', text = '🔴',
{ text = '🔴', texthl = 'DapBreakpoint', linehl = 'DapBreakpoint', numhl = 'DapBreakpoint' } texthl = 'DapBreakpoint',
) linehl = 'DapBreakpoint',
numhl = 'DapBreakpoint',
})
end, end,
}, },
} }

View File

@@ -1,32 +0,0 @@
return {
-- fzf <3 vim
-- https://github.com/junegunn/fzf.vim
'junegunn/fzf.vim',
dependencies = {
{ 'junegunn/fzf', run = ':call fzf#install()' },
},
keys = {
-- Stolen from https://github.com/erikw/dotfiles/blob/d68d6274d67ac47afa20b9a0b9f3b0fa54bcdaf3/.config/nvim/lua/plugins.lua
-- Search for files in given path.
{ '<Leader>zf', ':FZF<space>', desc = 'FZF: search for files in given path.' },
-- Sublime-like shortcut 'go to file' ctrl+p.
{ '<C-p>', ':Files<CR>', desc = 'FZF: search for files starting at current directory.' },
{ '<Leader>zc', ':Commands<CR>', desc = 'FZF: search commands.' },
{ '<Leader>zt', ':Tags<CR>', desc = 'FZF: search in tags file' },
{ '<Leader>zb', ':Buffers<CR>', desc = 'FZF: search open buffers.' },
-- Ref: https://medium.com/@paulodiovani/vim-buffers-windows-and-tabs-an-overview-8e2a57c57afa
{ '<Leader>zt', ':Windows<CR>', desc = 'FZF: search open tabs.' },
{ '<Leader>zh', ':History<CR>', desc = 'FZF: search history of opened files' },
{ '<Leader>zm', ':Maps<CR>', desc = 'FZF: search mappings.' },
{ '<Leader>zg', ':Rg<CR>', desc = 'FZF: search with rg (aka live grep).' },
},
config = function()
-- To ignore a certain path in a git project from both RG and FD used by FZF,
-- the eaiest way is to create ignore files and exclude the in local git clone.
-- Ref: https://stackoverflow.com/a/1753078/265508
-- $ cd git_proj/
-- $ echo "path/to/exclude" > .rgignore
-- $ echo "path/to/exclude" > .fdignore
-- $ printf ".rgignore\n.fdignore" >> .git/info/exclude
end,
}

View File

@@ -1,50 +0,0 @@
return {
-- Git integration for buffers
-- https://github.com/lewis6991/gitsigns.nvim
{
'lewis6991/gitsigns.nvim',
lazy = false,
config = function()
require('gitsigns').setup {
signs = {
add = { text = '+' },
change = { text = '~' },
delete = { text = '_' },
topdelete = { text = '' },
changedelete = { text = '~' },
},
current_line_blame = false,
on_attach = function(bufnr)
local gs = require 'gitsigns'
local function map(mode, l, r, opts)
opts = opts or {}
opts.buffer = bufnr
vim.keymap.set(mode, l, r, opts)
end
-- Navigation
map('n', 'gn', function()
if vim.wo.diff then
return ']c'
end
vim.schedule(function()
gs.next_hunk()
end)
return '<Ignore>'
end, { expr = true })
map('n', 'gp', function()
if vim.wo.diff then
return '[c'
end
vim.schedule(function()
gs.prev_hunk()
end)
return '<Ignore>'
end, { expr = true })
end,
}
end,
},
}

View File

@@ -1,18 +1,11 @@
return {
-- A small Neovim plugin for previewing definitions using floating windows. -- A small Neovim plugin for previewing definitions using floating windows.
-- https://github.com/rmagatti/goto-preview -- https://github.com/rmagatti/goto-preview
return {
'rmagatti/goto-preview', 'rmagatti/goto-preview',
dependencies = { dependencies = {
{ 'nvim-telescope/telescope.nvim' }, { 'nvim-telescope/telescope.nvim' },
}, },
keys = { opts = {
{ 'n', 'gp', group = 'Goto Preview' },
{ 'n', 'gpd', '<cmd>lua require("goto-preview").goto_preview_definition()<CR>' },
{ 'n', 'gpi', '<cmd>lua require("goto-preview").goto_preview_implementation()<CR>' },
{ 'n', 'gpP', '<cmd>lua require("goto-preview").close_all_windows()<CR>' },
},
config = function()
require('goto-preview').setup {
width = 120, -- Width of the floating window width = 120, -- Width of the floating window
height = 15, -- Height of the floating window height = 15, -- Height of the floating window
border = { '', '', '', '', '', '', '', '' }, -- Border characters of the floating window border = { '', '', '', '', '', '', '', '' }, -- Border characters of the floating window
@@ -33,6 +26,5 @@ return {
bufhidden = 'wipe', -- the bufhidden option to set on the floating window. See :h bufhidden bufhidden = 'wipe', -- the bufhidden option to set on the floating window. See :h bufhidden
stack_floating_preview_windows = true, -- Whether to nest floating windows stack_floating_preview_windows = true, -- Whether to nest floating windows
preview_window_title = { enable = true, position = 'left' }, preview_window_title = { enable = true, position = 'left' },
} },
end,
} }

View File

@@ -1,103 +0,0 @@
return {
-- Getting you where you want with the fewest keystrokes.
-- https://github.com/ThePrimeagen/harpoon
{
'ThePrimeagen/harpoon',
branch = 'harpoon2',
dependencies = {
'nvim-lua/plenary.nvim',
'nvim-telescope/telescope.nvim',
},
config = function()
local harpoon = require 'harpoon'
harpoon:setup {}
vim.keymap.set('n', '<leader>ht', function()
harpoon.ui:toggle_quick_menu(harpoon:list())
end, { desc = 'Open Harpoon Quick menu' })
-- basic telescope configuration
local conf = require('telescope.config').values
local function toggle_telescope(harpoon_files)
local file_paths = {}
for _, item in ipairs(harpoon_files.items) do
table.insert(file_paths, item.value)
end
require('telescope.pickers')
.new({}, {
prompt_title = 'Harpoon',
finder = require('telescope.finders').new_table {
results = file_paths,
},
previewer = conf.file_previewer {},
sorter = conf.generic_sorter {},
})
:find()
end
vim.keymap.set('n', '<leader>hw', function()
toggle_telescope(harpoon:list())
end, { desc = 'Open harpoon window with telescope' })
end,
keys = {
{
'<leader>ha',
function()
require('harpoon'):list():add()
end,
desc = 'harpoon file',
},
{
'<leader>hp',
function()
require('harpoon'):list():prev()
end,
desc = 'harpoon to previous file',
},
{
'<leader>hn',
function()
require('harpoon'):list():next()
end,
desc = 'harpoon to next file',
},
{
'<leader>1',
function()
require('harpoon'):list():select(1)
end,
desc = 'harpoon to file 1',
},
{
'<leader>2',
function()
require('harpoon'):list():select(2)
end,
desc = 'harpoon to file 2',
},
{
'<leader>3',
function()
require('harpoon'):list():select(3)
end,
desc = 'harpoon to file 3',
},
{
'<leader>4',
function()
require('harpoon'):list():select(4)
end,
desc = 'harpoon to file 4',
},
{
'<leader>5',
function()
require('harpoon'):list():select(5)
end,
desc = 'harpoon to file 5',
},
},
},
}

View File

@@ -1,60 +1,30 @@
return { return {
-- A better annotation generator. -- A better annotation generator.
-- Supports multiple languages and annotation conventions. -- Supports multiple languages and annotation conventions.
-- https://github.com/danymat/neogen -- https://github.com/danymat/neogen
{ { 'danymat/neogen', version = '*', opts = { enabled = true, snippet_engine = 'luasnip' } },
'danymat/neogen',
version = '*',
keys = {
{
'<leader>cg',
'<cmd>lua require("neogen").generate()<CR>',
desc = 'Generate annotations',
},
},
config = function()
require('neogen').setup {
enabled = true,
snippet_engine = 'luasnip',
}
end,
},
-- Rethinking Vim as a tool for writing -- The Refactoring library based off the Refactoring book by Martin Fowler
-- https://github.com/preservim/vim-pencil -- https://github.com/ThePrimeagen/refactoring.nvim
{ 'preservim/vim-pencil' }, { 'ThePrimeagen/refactoring.nvim', dependencies = { 'nvim-lua/plenary.nvim', 'nvim-treesitter/nvim-treesitter' }, opts = {} },
-- surround.vim: Delete/change/add parentheses/quotes/XML-tags/much more with ease -- All the npm/yarn/pnpm commands I don't want to type
-- https://github.com/tpope/vim-surround -- https://github.com/vuki656/package-info.nvim
{ 'tpope/vim-surround' }, { 'vuki656/package-info.nvim', dependencies = { 'MunifTanjim/nui.nvim' } },
-- Add/change/delete surrounding delimiter pairs with ease. Written with ❤️ in Lua.
-- https://github.com/kylechui/nvim-surround
{ 'kylechui/nvim-surround', version = '*', event = 'VeryLazy' },
-- Highlight, list and search todo comments in your projects -- Highlight, list and search todo comments in your projects
-- https://github.com/folke/todo-comments.nvim -- https://github.com/folke/todo-comments.nvim
{ { 'folke/todo-comments.nvim', dependencies = { 'nvim-lua/plenary.nvim' }, opts = {} },
'folke/todo-comments.nvim',
dependencies = 'nvim-lua/plenary.nvim',
config = function()
require('todo-comments').setup {}
end,
},
-- Indent guides for Neovim
-- https://github.com/lukas-reineke/indent-blankline.nvim
{
'lukas-reineke/indent-blankline.nvim',
main = 'ibl',
opts = {},
},
-- Commenting -- Commenting
-- "gc" to comment visual regions/lines
-- https://github.com/numToStr/Comment.nvim -- https://github.com/numToStr/Comment.nvim
{ { 'numToStr/Comment.nvim', event = { 'BufRead', 'BufNewFile' }, opts = {} },
'numToStr/Comment.nvim', -- "gc" to comment visual regions/lines
event = { 'BufRead', 'BufNewFile' },
config = function()
require('Comment').setup()
end,
},
-- Detect tabstop and shiftwidth automatically -- Detect tabstop and shiftwidth automatically
-- https://github.com/tpope/vim-sleuth -- https://github.com/tpope/vim-sleuth

View File

@@ -1,55 +0,0 @@
return {
{ -- Linting
'mfussenegger/nvim-lint',
event = { 'BufReadPre', 'BufNewFile' },
config = function()
local lint = require 'lint'
lint.linters_by_ft = {
markdown = { 'markdownlint' },
}
-- To allow other plugins to add linters to require('lint').linters_by_ft,
-- instead set linters_by_ft like this:
-- lint.linters_by_ft = lint.linters_by_ft or {}
-- lint.linters_by_ft['markdown'] = { 'markdownlint' }
--
-- However, note that this will enable a set of default linters,
-- which will cause errors unless these tools are available:
-- {
-- clojure = { "clj-kondo" },
-- dockerfile = { "hadolint" },
-- inko = { "inko" },
-- janet = { "janet" },
-- json = { "jsonlint" },
-- markdown = { "vale" },
-- rst = { "vale" },
-- ruby = { "ruby" },
-- terraform = { "tflint" },
-- text = { "vale" }
-- }
--
-- You can disable the default linters by setting their filetypes to nil:
-- lint.linters_by_ft['clojure'] = nil
-- lint.linters_by_ft['dockerfile'] = nil
-- lint.linters_by_ft['inko'] = nil
-- lint.linters_by_ft['janet'] = nil
-- lint.linters_by_ft['json'] = nil
-- lint.linters_by_ft['markdown'] = nil
-- lint.linters_by_ft['rst'] = nil
-- lint.linters_by_ft['ruby'] = nil
-- lint.linters_by_ft['terraform'] = nil
-- lint.linters_by_ft['text'] = nil
-- Create autocommand which carries out the actual linting
-- on the specified events.
local lint_augroup = vim.api.nvim_create_augroup('lint', { clear = true })
vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, {
group = lint_augroup,
callback = function()
lint.try_lint()
end,
})
end,
},
}

View File

@@ -5,59 +5,81 @@ return {
'neovim/nvim-lspconfig', 'neovim/nvim-lspconfig',
lazy = false, lazy = false,
dependencies = { dependencies = {
-- Neovim plugin to manage global and project-local settings -- Garbage collector that stops inactive LSP clients to free RAM
-- Should be included before LSP Config -- https://github.com/Zeioth/garbage-day.nvim
-- https://github.com/folke/neoconf.nvim
{ {
'folke/neoconf.nvim', 'zeioth/garbage-day.nvim',
lazy = false, dependencies = 'neovim/nvim-lspconfig',
event = 'VeryLazy',
opts = {},
},
-- improve neovim lsp experience
-- https://github.com/nvimdev/lspsaga.nvim
{
'nvimdev/lspsaga.nvim',
dependencies = {
'nvim-treesitter/nvim-treesitter', -- optional
'nvim-tree/nvim-web-devicons', -- optional
},
opts = {
code_action = {
show_server_name = true,
},
diagnostic = {
keys = { keys = {
{ '<leader>?c', '<cmd>Neoconf<CR>', desc = 'Neoconf: Open' }, quit = { 'q', '<ESC>' },
{ '<leader>?g', '<cmd>Neoconf global<CR>', desc = 'Neoconf: Global' },
{ '<leader>?l', '<cmd>Neoconf local<CR>', desc = 'Neoconf: Local' },
{ '<leader>?m', '<cmd>Neoconf lsp<CR>', desc = 'Neoconf: Show merged LSP config' },
{ '<leader>?s', '<cmd>Neoconf show<CR>', desc = 'Neoconf: Show merged config' },
}, },
config = function()
require('neoconf').setup()
end,
}, },
},
},
-- ── Mason and LSPConfig integration ─────────────────────────────────
-- Automatically install LSPs to stdpath for neovim -- Automatically install LSPs to stdpath for neovim
-- Portable package manager for Neovim that runs everywhere Neovim runs.
-- Easily install and manage LSP servers, DAP servers, linters,
-- and formatters.
-- https://github.com/williamboman/mason.nvim
{ 'williamboman/mason.nvim' },
{ 'williamboman/mason-lspconfig.nvim' },
{ 'WhoIsSethDaniel/mason-tool-installer.nvim' },
-- ── Linting ─────────────────────────────────────────────────────────
-- An asynchronous linter plugin for Neovim complementary to the
-- built-in Language Server Protocol support.
-- https://github.com/mfussenegger/nvim-lint
{ {
'williamboman/mason.nvim', 'mfussenegger/nvim-lint',
lazy = false, event = { 'BufReadPre', 'BufNewFile' },
run = ':call MasonUpdate',
}, },
'williamboman/mason-lspconfig.nvim', -- Extension to mason.nvim that makes it
'WhoIsSethDaniel/mason-tool-installer.nvim', -- easier to use nvim-lint with mason.nvim
'b0o/schemastore.nvim', -- https://github.com/rshkarin/mason-nvim-lint
{ 'rshkarin/mason-nvim-lint' },
-- ── Misc ────────────────────────────────────────────────────────────
-- vscode-like pictograms for neovim lsp completion items -- vscode-like pictograms for neovim lsp completion items
-- https://github.com/onsails/lspkind-nvim -- https://github.com/onsails/lspkind-nvim
{ 'onsails/lspkind.nvim' }, { 'onsails/lspkind.nvim' },
}, -- JSON schemas for Neovim
keys = { -- https://github.com/b0o/SchemaStore.nvim
{ '<leader>do', '<cmd>lua vim.diagnostic.open_float()<CR>', desc = 'Diagnostic: Open float' }, { 'b0o/schemastore.nvim' },
{ '<leader>dq', '<cmd>lua vim.diagnostic.setloclist()<CR>', desc = 'Diagnostic: Set loc list' },
{ 'dn', '<cmd>lua vim.diagnostic.goto_next()<CR>', desc = 'Diagnostic: Goto Next' },
{ 'dp', '<cmd>lua vim.diagnostic.goto_prev()<CR>', desc = 'Diagnostic: Goto Prev' },
{ '<leader>cr', '<cmd>lua vim.lsp.buf.rename()<CR>', desc = 'LSP: Rename' },
{ '<leader>ca', '<cmd>lua vim.lsp.buf.code_action()<CR>', desc = 'LSP: Code Action' },
{ 'gd', '<cmd>lua vim.lsp.buf.definition()<CR>', desc = 'LSP: Goto Definition' },
{ 'gr', '<cmd>lua require("telescope.builtin").lsp_references()<CR>', desc = 'LSP: Goto References' },
{ 'gI', '<cmd>lua vim.lsp.buf.implementation()<CR>', desc = 'LSP: Goto Implementation' },
{ '<leader>D', '<cmd>lua vim.lsp.buf.type_definition()<CR>', desc = 'LSP: Type Definition' },
{ '<leader>ds', '<cmd>lua require("telescope.builtin").lsp_document_symbols()<CR>', desc = 'LSP: Document Symbols' },
{ '<leader>ws', '<cmd>lua require("telescope.builtin").lsp_dynamic_workspace_symbols()<CR>', desc = 'LSP: Workspace Symbols' },
{ 'K', '<cmd>lua vim.lsp.buf.hover()<CR>', desc = 'LSP: Hover Documentation' },
{ '<C-k>', '<cmd>lua vim.lsp.buf.signature_help()<CR>', desc = 'LSP: Signature Documentation' },
{ 'gD', '<cmd>lua vim.lsp.buf.declaration()<CR>', desc = 'LSP: Goto Declaration' },
{ '<leader>wa', '<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>', desc = 'LSP: Workspace Add Folder' },
{ '<leader>wr', '<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>', desc = 'LSP: Workspace Remove Folder' },
{ '<leader>wl', '<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>', desc = 'LSP: Workspace List Folders' },
}, },
config = function() config = function()
-- LSP settings. -- ── LSP settings. ───────────────────────────────────────────────────
-- This function gets run when an LSP connects to a particular buffer. -- This function gets run when an LSP connects to a particular buffer.
-- Make runtime files discoverable to the server
local runtime_path = vim.split(package.path, ';')
table.insert(runtime_path, 'lua/?.lua')
table.insert(runtime_path, 'lua/?/init.lua')
-- Generate a command `:Format` local to the LSP buffer
--
---@param _ nil Skipped
---@param bufnr number Buffer number
---@output nil
local on_attach = function(_, bufnr) local on_attach = function(_, bufnr)
-- Create a command `:Format` local to the LSP buffer -- Create a command `:Format` local to the LSP buffer
vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_) vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_)
@@ -65,22 +87,24 @@ return {
vim.lsp.buf.format() vim.lsp.buf.format()
elseif vim.lsp.buf.formatting then elseif vim.lsp.buf.formatting then
vim.lsp.buf.formatting() vim.lsp.buf.formatting()
else
require('conform').format { async = true, lsp_fallback = true }
end end
end, { desc = 'Format current buffer with LSP' }) end, { desc = 'Format current buffer with LSP' })
end end
-- Setup mason so it can manage external tooling -- ── Setup mason so it can manage external tooling ───────────────────
require('mason').setup() require('mason').setup()
-- Enable the following language servers -- ── Enable the following language servers ───────────────────────────
-- Feel free to add/remove any LSPs that you want here. They will automatically be installed.
local servers = {
-- :help lspconfig-all for all pre-configured LSPs -- :help lspconfig-all for all pre-configured LSPs
local servers = {
ast_grep = {}, ast_grep = {},
actionlint = {}, -- GitHub Actions actionlint = {}, -- GitHub Actions
ansiblels = {}, -- Ansible ansiblels = {}, -- Ansible
bashls = {}, -- Bash bashls = {}, -- Bash
-- csharp_ls = {}, -- C#, requires dotnet executable
css_variables = {}, -- CSS css_variables = {}, -- CSS
cssls = {}, -- CSS cssls = {}, -- CSS
docker_compose_language_service = {}, -- Docker compose docker_compose_language_service = {}, -- Docker compose
@@ -110,11 +134,29 @@ return {
lua_ls = { lua_ls = {
settings = { settings = {
Lua = { Lua = {
runtime = {
-- Tell the language server which version of Lua you're using (most likely LuaJIT)
version = 'LuaJIT',
-- Setup your lua path
path = runtime_path,
},
diagnostics = {
globals = { 'vim' },
disable = {
-- Ignore Lua_LS's noisy `missing-fields` warnings
'missing-fields',
},
},
workspace = {
library = vim.api.nvim_get_runtime_file('', true),
checkThirdParty = false,
},
-- Do not send telemetry data containing a randomized but unique identifier
telemetry = { enable = false },
completion = { completion = {
callSnippet = 'Replace', callSnippet = 'Replace',
}, },
-- You can toggle below to ignore Lua_LS's noisy `missing-fields` warnings
diagnostics = { disable = { 'missing-fields' } },
}, },
}, },
}, },
@@ -133,18 +175,21 @@ return {
url = '', url = '',
}, },
schemas = require('schemastore').yaml.schemas(), schemas = require('schemastore').yaml.schemas(),
validate = { enable = true },
}, },
}, },
}, },
} }
local ensure_installed = vim.tbl_keys(servers or {}) -- Mason servers should be it's own variable for mason-nvim-lint
vim.list_extend(ensure_installed, { -- See: https://mason-registry.dev/registry/list
local mason_servers = {
'actionlint', 'actionlint',
'ansible-language-server', 'ansible-language-server',
'ansible-lint', 'ansible-lint',
'bash-language-server', 'bash-language-server',
'blade-formatter', 'blade-formatter',
'clang-format',
'commitlint', 'commitlint',
'diagnostic-languageserver', 'diagnostic-languageserver',
'docker-compose-language-service', 'docker-compose-language-service',
@@ -164,14 +209,19 @@ return {
'shfmt', 'shfmt',
'stylelint', 'stylelint',
'stylua', 'stylua',
'vue-language-server',
'yamllint', 'yamllint',
}) }
local ensure_installed = vim.tbl_keys(servers or {})
vim.list_extend(ensure_installed, mason_servers)
-- ── Automagically install tools ─────────────────────────────────────
require('mason-tool-installer').setup { require('mason-tool-installer').setup {
ensure_installed = ensure_installed, ensure_installed = ensure_installed,
auto_update = true, auto_update = true,
} }
-- Ensure the servers above are installed -- ── Ensure the servers above are installed ──────────────────────────
require('mason-lspconfig').setup { require('mason-lspconfig').setup {
automatic_installation = true, automatic_installation = true,
ensure_installed = servers, ensure_installed = servers,
@@ -181,6 +231,20 @@ return {
local capabilities = vim.lsp.protocol.make_client_capabilities() local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities) capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
require('mason-lspconfig').setup_handlers {
-- The first entry (without a key) will be the default handler
-- and will be called for each installed server that doesn't have
-- a dedicated handler.
function(server_name) -- default handler (optional)
require('lspconfig')[server_name].setup {}
end,
-- Next, you can provide a dedicated handler for specific servers.
-- For example, a handler override for the `rust_analyzer`:
-- ['rust_analyzer'] = function()
-- require('rust-tools').setup {}
-- end,
}
for _, lsp in ipairs(servers) do for _, lsp in ipairs(servers) do
require('lspconfig')[lsp].setup { require('lspconfig')[lsp].setup {
on_attach = on_attach, on_attach = on_attach,
@@ -188,37 +252,11 @@ return {
} }
end end
-- Turn on lsp status information
-- require('fidget').setup()
-- Example custom configuration for lua
--
-- Make runtime files discoverable to the server
local runtime_path = vim.split(package.path, ';')
table.insert(runtime_path, 'lua/?.lua')
table.insert(runtime_path, 'lua/?/init.lua')
require('lspconfig').lua_ls.setup { require('lspconfig').lua_ls.setup {
on_attach = on_attach, on_attach = on_attach,
capabilities = capabilities, capabilities = capabilities,
settings = { settings = {
Lua = { Lua = servers.lua_ls.settings.Lua,
runtime = {
-- Tell the language server which version of Lua you're using (most likely LuaJIT)
version = 'LuaJIT',
-- Setup your lua path
path = runtime_path,
},
diagnostics = {
globals = { 'vim' },
},
workspace = {
library = vim.api.nvim_get_runtime_file('', true),
checkThirdParty = false,
},
-- Do not send telemetry data containing a randomized but unique identifier
telemetry = { enable = false },
},
}, },
} }
@@ -231,6 +269,20 @@ return {
} }
end, end,
}) })
-- ── Setup linting ───────────────────────────────────────────────────
require('mason-nvim-lint').setup {
ensure_installed = mason_servers or {},
quiet_mode = true,
}
local lint = require 'lint'
local lint_augroup = vim.api.nvim_create_augroup('lint', { clear = true })
vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, {
group = lint_augroup,
callback = function()
lint.try_lint()
end,
})
end, end,
}, },
} }

View File

@@ -6,32 +6,33 @@ return {
'kyazdani42/nvim-web-devicons', 'kyazdani42/nvim-web-devicons',
'folke/noice.nvim', 'folke/noice.nvim',
}, },
config = function() opts = {
require('lualine').setup {
options = { options = {
icons_enabled = true, icons_enabled = true,
component_separators = '|', component_separators = '|',
section_separators = '', section_separators = '',
}, },
-- Sections
-- +-------------------------------------------------+
-- | A | B | C X | Y | Z |
-- +-------------------------------------------------+
sections = { sections = {
lualine_x = { lualine_b = {
{
require('noice').api.statusline.mode.get,
cond = require('noice').api.statusline.mode.has,
-- color = { fg = '#ff9e64' },
},
{
require('noice').api.status.command.get,
cond = require('noice').api.status.command.has,
-- color = { fg = '#ff9e64' },
},
},
lualine_a = {
{ {
'buffers', 'buffers',
}, },
}, },
lualine_x = {
{
require('noice').api.statusline.mode.get,
cond = require('noice').api.statusline.mode.has,
},
{
require('noice').api.status.command.get,
cond = require('noice').api.status.command.has,
},
},
},
}, },
} }
end,
}

View File

@@ -1,6 +1,5 @@
-- Neo-tree is a Neovim plugin to browse the file system -- Neo-tree is a Neovim plugin to browse the file system
-- https://github.com/nvim-neo-tree/neo-tree.nvim -- https://github.com/nvim-neo-tree/neo-tree.nvim
return { return {
'nvim-neo-tree/neo-tree.nvim', 'nvim-neo-tree/neo-tree.nvim',
version = '*', version = '*',
@@ -9,10 +8,12 @@ return {
'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended 'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended
'MunifTanjim/nui.nvim', 'MunifTanjim/nui.nvim',
{ {
-- This plugins prompts the user to pick a window and returns
-- the window id of the picked window
-- https://github.com/s1n7ax/nvim-window-picker
's1n7ax/nvim-window-picker', 's1n7ax/nvim-window-picker',
version = '2.*', version = '2.*',
config = function() opts = {
require('window-picker').setup {
filter_rules = { filter_rules = {
include_current_win = false, include_current_win = false,
autoselect_one = true, autoselect_one = true,
@@ -24,14 +25,10 @@ return {
buftype = { 'terminal', 'quickfix' }, buftype = { 'terminal', 'quickfix' },
}, },
}, },
} },
end,
}, },
}, },
cmd = 'Neotree', cmd = 'Neotree',
keys = {
{ '<leader>e', ':Neotree reveal<CR>', desc = 'NeoTree reveal' },
},
opts = { opts = {
close_if_last_window = true, close_if_last_window = true,
filesystem = { filesystem = {

View File

@@ -1,7 +1,15 @@
return {
-- Highly experimental plugin that completely replaces the UI -- Highly experimental plugin that completely replaces the UI
-- for messages, cmdline and the popupmenu. -- for messages, cmdline and the popupmenu.
-- https://github.com/folke/noice.nvim -- https://github.com/folke/noice.nvim
vim.g.noice_ignored_filetypes = {
'fugitiveblame',
'fugitive',
'gitcommit',
'noice',
}
return {
'folke/noice.nvim', 'folke/noice.nvim',
lazy = false, lazy = false,
enabled = true, enabled = true,
@@ -12,12 +20,7 @@ return {
'rcarriga/nvim-notify', 'rcarriga/nvim-notify',
'hrsh7th/nvim-cmp', 'hrsh7th/nvim-cmp',
}, },
keys = { opts = {
{ 'n', '<leader>tn', ':Noice dismiss<CR>', desc = 'Noice dismiss' },
},
config = function()
vim.g.noice_ignored_filetypes = { 'fugitiveblame', 'fugitive', 'gitcommit', 'noice' }
require('noice').setup {
lsp = { lsp = {
-- override markdown rendering so that **cmp** and other plugins use **Treesitter** -- override markdown rendering so that **cmp** and other plugins use **Treesitter**
override = { override = {
@@ -79,6 +82,5 @@ return {
}, },
}, },
}, },
} },
end,
} }

View File

@@ -8,7 +8,51 @@ return {
{ 'nvim-lua/plenary.nvim' }, { 'nvim-lua/plenary.nvim' },
{ 'nvim-telescope/telescope-symbols.nvim' }, { 'nvim-telescope/telescope-symbols.nvim' },
{ 'folke/which-key.nvim' }, { 'folke/which-key.nvim' },
{ 'ThePrimeagen/harpoon' }, -- Getting you where you want with the fewest keystrokes.
-- https://github.com/ThePrimeagen/harpoon
{
'ThePrimeagen/harpoon',
branch = 'harpoon2',
dependencies = {
'nvim-lua/plenary.nvim',
'nvim-telescope/telescope.nvim',
},
config = function()
local harpoon = require 'harpoon'
harpoon:setup {}
-- basic telescope configuration
local conf = require('telescope.config').values
local function toggle_telescope(harpoon_files)
local file_paths = {}
for _, item in ipairs(harpoon_files.items) do
table.insert(file_paths, item.value)
end
require('telescope.pickers')
.new({}, {
prompt_title = 'Harpoon',
finder = require('telescope.finders').new_table {
results = file_paths,
},
previewer = conf.file_previewer {},
sorter = conf.generic_sorter {},
})
:find()
end
vim.keymap.set('n', '<leader>hw', function()
toggle_telescope(harpoon:list())
end, { desc = 'Open harpoon window with telescope' })
vim.keymap.set('n', '<leader>ht', function()
harpoon.ui:toggle_quick_menu(harpoon:list())
end, { desc = 'Open Harpoon Quick menu' })
end,
},
-- A Telescope picker to quickly access configurations
-- of plugins managed by lazy.nvim.
-- https://github.com/polirritmico/telescope-lazy-plugins.nvim
{ 'polirritmico/telescope-lazy-plugins.nvim' },
-- Fuzzy Finder Algorithm which requires local dependencies to be built. -- Fuzzy Finder Algorithm which requires local dependencies to be built.
-- Only load if `make` is available -- Only load if `make` is available
@@ -28,15 +72,6 @@ return {
t.setup { t.setup {
defaults = { defaults = {
layout_strategy = 'horizontal', layout_strategy = 'horizontal',
layout_config = {
preview_width = 0.65,
horizontal = {
size = {
width = '95%',
height = '95%',
},
},
},
pickers = { pickers = {
find_files = { find_files = {
theme = 'dropdown', theme = 'dropdown',
@@ -56,32 +91,17 @@ return {
-- Load extensions -- Load extensions
pcall(t.load_extension, 'harpoon') pcall(t.load_extension, 'harpoon')
pcall(t.load_extension, 'git_worktree') pcall(t.load_extension, 'git_worktree')
pcall(t.load_extension, 'lazy_plugins')
-- Enable telescope fzf native, if installed -- Enable telescope fzf native, if installed
pcall(t.load_extension, 'fzf') pcall(t.load_extension, 'fzf')
-- [[ Telescope Keymaps ]] -- [[ Telescope Keymaps ]]
-- See `:help telescope.builtin` -- See `:help telescope.builtin`
-- See `:help telescope.keymap` -- See `:help telescope.keymap`
local b = require 'telescope.builtin'
local wk = require 'which-key'
wk.add {
{ '<leader><space>', b.buffers, desc = '[ ] Find existing buffers' },
{ '<leader><tab>', "<Cmd>lua require('telescope.builtin').commands()<CR>", desc = 'Telescope: Commands' },
{ '<leader>sS', b.git_status, desc = 'Git Status' },
{ '<leader>sd', b.diagnostics, desc = 'Search Diagnostics' },
{ '<leader>sf', b.find_files, desc = 'Search Files' },
{ '<leader>sg', b.live_grep, desc = 'Search by Grep' },
{ '<leader>sm', ':Telescope harpoon marks<CR>', desc = 'Harpoon Marks' },
{ '<leader>sn', "<cmd>lua require('telescope').extensions.notify.notify()<CR>", desc = 'Notify' },
{ '<leader>so', b.oldfiles, desc = 'Find recently Opened files' },
{ '<leader>st', ':TodoTelescope<CR>', desc = 'Telescope: Todo' },
{ '<leader>sw', b.grep_string, desc = 'Search current Word' },
}
vim.keymap.set('n', '<leader>/', function() vim.keymap.set('n', '<leader>/', function()
-- You can pass additional configuration to telescope to change theme, layout, etc. -- You can pass additional configuration to telescope to change theme, layout, etc.
b.current_buffer_fuzzy_find(themes.get_dropdown { require('telescope.builtin').current_buffer_fuzzy_find(themes.get_dropdown {
winblend = 10, winblend = 10,
previewer = true, previewer = true,
}) })

View File

@@ -1,6 +1,6 @@
return {
-- Highlight, edit, and navigate code -- Highlight, edit, and navigate code
-- https://github.com/nvim-treesitter/nvim-treesitter -- https://github.com/nvim-treesitter/nvim-treesitter
return {
'nvim-treesitter/nvim-treesitter', 'nvim-treesitter/nvim-treesitter',
build = function() build = function()
pcall(require('nvim-treesitter.install').update { with_sync = true }) pcall(require('nvim-treesitter.install').update { with_sync = true })

View File

@@ -1,34 +1,15 @@
-- A pretty diagnostics, references, telescope results,
-- quickfix and location list to help you solve all the
-- trouble your code is causing.
-- https://github.com/folke/trouble.nvim
return { return {
'folke/trouble.nvim', 'folke/trouble.nvim',
lazy = false, lazy = false,
dependencies = 'nvim-tree/nvim-web-devicons', dependencies = { 'nvim-tree/nvim-web-devicons' },
keys = { opts = {
{ '<leader>xx', '<cmd>Trouble<cr>', desc = 'Toggle Trouble' },
{ '<leader>xw', '<cmd>Trouble workspace_diagnostics<cr>', desc = 'Toggle Workspace Diagnostics' },
{ '<leader>xd', '<cmd>Trouble document_diagnostics<cr>', desc = 'Toggle Document Diagnostics' },
{ '<leader>xl', '<cmd>Trouble loclist<cr>', desc = 'Toggle Loclist' },
{ '<leader>xq', '<cmd>Trouble quickfix<cr>', desc = 'Toggle Quickfix' },
{ 'gR', '<cmd>Trouble lsp_references<cr>', desc = 'Toggle LSP References' },
},
config = function()
require('trouble').setup {
auto_preview = false, auto_preview = false,
auto_fold = true, auto_fold = true,
auto_close = true, auto_close = true,
use_lsp_diagnostic_signs = true, use_lsp_diagnostic_signs = true,
} },
-- Diagnostic signs
-- https://github.com/folke/trouble.nvim/issues/52
local signs = {
Error = '',
Warning = '',
Hint = '',
Information = '',
}
for type, icon in pairs(signs) do
local hl = 'DiagnosticSign' .. type
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl })
end
end,
} }

View File

@@ -1,23 +1,51 @@
-- Not UFO in the sky, but an ultra fold in Neovim. -- Not UFO in the sky, but an ultra fold in Neovim.
-- https://github.com/kevinhwang91/nvim-ufo/ -- https://github.com/kevinhwang91/nvim-ufo/
return {
{
'kevinhwang91/nvim-ufo',
version = '*',
dependencies = {
{ 'kevinhwang91/promise-async' },
{ 'nvim-treesitter/nvim-treesitter', run = ':TSUpdate' },
{
-- Status column plugin that provides a configurable
-- 'statuscolumn' and click handlers.
-- https://github.com/luukvbaal/statuscol.nvim
'luukvbaal/statuscol.nvim',
opts = {},
},
},
opts = {
open_fold_hl_timeout = 150,
close_fold_kinds_for_ft = { 'imports', 'comment' },
preview = {
win_config = {
border = { '', '', '', '', '', '', '', '' },
winhighlight = 'Normal:Folded',
winblend = 0,
},
mappings = {
scrollU = '<C-u>',
scrollD = '<C-d>',
jumpTop = '[',
jumpBot = ']',
},
},
provider_selector = function(_, _, _) -- bufnr, filetype, buftype
return { 'treesitter', 'indent' }
end,
-- fold_virt_text_handler -- fold_virt_text_handler
--
-- This handler is called when the fold text is too long to fit in the window. -- This handler is called when the fold text is too long to fit in the window.
-- It is expected to truncate the text and return a new list of virtual text. -- It is expected to truncate the text and return a new list of virtual text.
-- The handler is called with the following arguments:
-- virtText: The current virtual text list.
-- lnum: The line number of the first line in the fold.
-- endLnum: The line number of the last line in the fold.
-- width: The width of the window.
-- --
--@type function ---@param virtText table The current virtual text list.
--@param virtText ---@param lnum number The line number of the first line in the fold.
--@param lnum ---@param endLnum number The line number of the last line in the fold.
--@param endLnum ---@param width number The width of the window.
--@param width ---@param truncate function Truncate function
--@param truncate ---@return table
--@return table fold_virt_text_handler = function(virtText, lnum, endLnum, width, truncate)
local handler = function(virtText, lnum, endLnum, width, truncate)
local newVirtText = {} local newVirtText = {}
local suffix = (' 󰁂 %d '):format(endLnum - lnum) local suffix = (' 󰁂 %d '):format(endLnum - lnum)
local sufWidth = vim.fn.strdisplaywidth(suffix) local sufWidth = vim.fn.strdisplaywidth(suffix)
@@ -43,59 +71,7 @@ local handler = function(virtText, lnum, endLnum, width, truncate)
end end
table.insert(newVirtText, { suffix, 'MoreMsg' }) table.insert(newVirtText, { suffix, 'MoreMsg' })
return newVirtText return newVirtText
end
return {
{
'kevinhwang91/nvim-ufo',
lazy = false,
enabled = true,
version = '*',
dependencies = {
'kevinhwang91/promise-async',
{ 'nvim-treesitter/nvim-treesitter', run = ':TSUpdate' },
{
'luukvbaal/statuscol.nvim',
config = function()
local builtin = require 'statuscol.builtin'
require('statuscol').setup {
relculright = true,
segments = {
{ text = { builtin.foldfunc }, click = 'v:lua.ScFa' },
{ text = { '%s' }, click = 'v:lua.ScSa' },
{ text = { builtin.lnumfunc, ' ' }, click = 'v:lua.ScLa' },
},
}
end, end,
}, },
}, },
init = function()
vim.o.fillchars = [[eob: ,fold: ,foldopen:,foldsep: ,foldclose:]]
vim.o.foldcolumn = '1' -- '0' is not bad
vim.o.foldlevel = 99 -- Using ufo provider need a large value, feel free to decrease the value
vim.o.foldlevelstart = 99
vim.o.foldenable = true
end,
opts = {
open_fold_hl_timeout = 150,
close_fold_kinds_for_ft = { 'imports', 'comment' },
preview = {
win_config = {
border = { '', '', '', '', '', '', '', '' },
winhighlight = 'Normal:Folded',
winblend = 0,
},
mappings = {
scrollU = '<C-u>',
scrollD = '<C-d>',
jumpTop = '[',
jumpBot = ']',
},
},
provider_selector = function(_, _, _) -- bufnr, filetype, buftype
return { 'treesitter', 'indent' }
end,
fold_virt_text_handler = handler,
},
},
} }

View File

@@ -5,7 +5,7 @@ return {
'folke/tokyonight.nvim', 'folke/tokyonight.nvim',
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.
init = function() init = function()
vim.cmd.colorscheme 'tokyonight' vim.cmd.colorscheme(vim.g.colors_theme)
end, end,
opts = { opts = {
transparent = true, transparent = true,
@@ -20,27 +20,72 @@ return {
update_interval = 1000, update_interval = 1000,
set_dark_mode = function() set_dark_mode = function()
vim.api.nvim_set_option_value('background', 'dark', {}) vim.api.nvim_set_option_value('background', 'dark', {})
vim.cmd 'colorscheme tokyonight-storm' vim.cmd.colorscheme(vim.g.colors_variant_dark)
end, end,
set_light_mode = function() set_light_mode = function()
vim.api.nvim_set_option_value('background', 'light', {}) vim.api.nvim_set_option_value('background', 'light', {})
vim.cmd 'colorscheme tokyonight-day' vim.cmd.colorscheme(vim.g.colors_variant_light)
end, end,
}, },
}, },
-- Remove all background colors to make nvim transparent -- Remove all background colors to make nvim transparent
-- https://github.com/xiyaowong/nvim-transparent -- https://github.com/xiyaowong/nvim-transparent
{ 'xiyaowong/nvim-transparent' }, { 'xiyaowong/nvim-transparent', opts = {} },
-- Twilight is a Lua plugin for Neovim 0.5 that dims inactive -- Twilight is a Lua plugin for Neovim 0.5 that dims inactive
-- portions of the code you're editing using TreeSitter. -- portions of the code you're editing using TreeSitter.
-- https://github.com/folke/twilight.nvim -- https://github.com/folke/twilight.nvim
{ 'folke/twilight.nvim', opts = {} },
-- Indent guides for Neovim
-- https://github.com/lukas-reineke/indent-blankline.nvim
{ 'lukas-reineke/indent-blankline.nvim', main = 'ibl', opts = {} },
-- Git integration for buffers
-- https://github.com/lewis6991/gitsigns.nvim
{ {
'folke/twilight.nvim', 'lewis6991/gitsigns.nvim',
ft = 'markdown', -- Highlight markdown files lazy = false,
keys = { opts = {
{ 'n', 'tw', '<cmd>Twilight<cr>', desc = 'Twilight' }, signs = {
add = { text = '+' },
change = { text = '~' },
delete = { text = '_' },
topdelete = { text = '' },
changedelete = { text = '~' },
},
current_line_blame = false,
on_attach = function(bufnr)
local gs = require 'gitsigns'
local function map(mode, l, r, opts)
opts = opts or {}
opts.buffer = bufnr
vim.keymap.set(mode, l, r, opts)
end
-- Navigation
map('n', 'gn', function()
if vim.wo.diff then
return ']c'
end
vim.schedule(function()
gs.next_hunk()
end)
return '<Ignore>'
end, { expr = true })
map('n', 'gp', function()
if vim.wo.diff then
return '[c'
end
vim.schedule(function()
gs.prev_hunk()
end)
return '<Ignore>'
end, { expr = true })
end,
}, },
}, },
@@ -48,8 +93,6 @@ return {
-- https://github.com/christoomey/vim-tmux-navigator -- https://github.com/christoomey/vim-tmux-navigator
{ {
'christoomey/vim-tmux-navigator', 'christoomey/vim-tmux-navigator',
lazy = false,
enabled = true,
cmd = { cmd = {
'TmuxNavigateLeft', 'TmuxNavigateLeft',
'TmuxNavigateDown', 'TmuxNavigateDown',
@@ -57,26 +100,14 @@ return {
'TmuxNavigateRight', 'TmuxNavigateRight',
'TmuxNavigatePrevious', 'TmuxNavigatePrevious',
}, },
keys = {
{ '<c-h>', '<cmd><C-U>TmuxNavigateLeft<cr>', desc = 'tmux: Navigate Left' },
{ '<c-j>', '<cmd><C-U>TmuxNavigateDown<cr>', desc = 'tmux: Navigate Down' },
{ '<c-k>', '<cmd><C-U>TmuxNavigateUp<cr>', desc = 'tmux: Navigate Up' },
{ '<c-l>', '<cmd><C-U>TmuxNavigateRight<cr>', desc = 'tmux: Navigate Right' },
{ '<c-\\>', '<cmd><C-U>TmuxNavigatePrevious<cr>', desc = 'tmux: Navigate Previous' },
},
}, },
-- Cloak allows you to overlay *'s over defined patterns in defined files. -- Cloak allows you to overlay *'s over defined patterns in defined files.
-- https://github.com/laytan/cloak.nvim -- https://github.com/laytan/cloak.nvim
{ {
'laytan/cloak.nvim', 'laytan/cloak.nvim',
enabled = true,
lazy = false,
version = '*', version = '*',
keys = { opts = {
{ '<leader>tc', '<cmd>CloakToggle<cr>', desc = '[tc] Toggle Cloak' },
},
config = function()
require('cloak').setup {
enabled = true, enabled = true,
cloak_character = '*', cloak_character = '*',
-- The applied highlight group (colors) on the cloaking, see `:h highlight`. -- The applied highlight group (colors) on the cloaking, see `:h highlight`.
@@ -96,21 +127,22 @@ return {
cloak_pattern = '=.+', cloak_pattern = '=.+',
}, },
}, },
} },
end,
}, },
-- Close buffer without messing up with the window. -- Close buffer without messing up with the window.
-- https://github.com/famiu/bufdelete.nvim -- https://github.com/famiu/bufdelete.nvim
{ 'famiu/bufdelete.nvim' }, { 'famiu/bufdelete.nvim' },
-- Neovim plugin for locking a buffer to a window -- Neovim plugin for locking a buffer to a window
-- https://github.com/stevearc/stickybuf.nvim -- https://github.com/stevearc/stickybuf.nvim
{ 'stevearc/stickybuf.nvim', opts = {} }, { 'stevearc/stickybuf.nvim', opts = {} },
-- Describe the regexp under the cursor -- Describe the regexp under the cursor
-- https://github.com/bennypowers/nvim-regexplainer -- https://github.com/bennypowers/nvim-regexplainer
{ {
'bennypowers/nvim-regexplainer', 'bennypowers/nvim-regexplainer',
event = 'BufEnter',
lazy = false, lazy = false,
enabled = true,
dependencies = { dependencies = {
'nvim-treesitter/nvim-treesitter', 'nvim-treesitter/nvim-treesitter',
'MunifTanjim/nui.nvim', 'MunifTanjim/nui.nvim',
@@ -120,12 +152,11 @@ return {
auto = true, auto = true,
}, },
}, },
-- Clarify and beautify your comments using boxes and lines. -- Clarify and beautify your comments using boxes and lines.
-- https://github.com/LudoPinelli/comment-box.nvim -- https://github.com/LudoPinelli/comment-box.nvim
{ { 'LudoPinelli/comment-box.nvim', opts = {} },
'LudoPinelli/comment-box.nvim',
opts = {},
},
-- Automatically expand width of the current window. -- Automatically expand width of the current window.
-- Maximizes and restore it. And all this with nice animations! -- Maximizes and restore it. And all this with nice animations!
-- https://github.com/anuvyklack/windows.nvim -- https://github.com/anuvyklack/windows.nvim
@@ -135,11 +166,15 @@ return {
'anuvyklack/middleclass', 'anuvyklack/middleclass',
'anuvyklack/animation.nvim', 'anuvyklack/animation.nvim',
}, },
config = function() opts = {},
vim.o.winwidth = 15 },
vim.o.winminwidth = 10
vim.o.equalalways = false -- Plugin to improve viewing Markdown files in Neovim
require('windows').setup() -- https://github.com/MeanderingProgrammer/render-markdown.nvim
end, {
'MeanderingProgrammer/render-markdown.nvim',
dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons' },
ft = 'markdown',
opts = {},
}, },
} }

View File

@@ -14,9 +14,6 @@ return {
wk.setup() wk.setup()
wk.add { wk.add {
-- Better default experience
{ '<space>', '<Nop>', mode = { 'n', 'v' } },
-- ╭─────────────────────────────────────────────────────────╮ -- ╭─────────────────────────────────────────────────────────╮
-- │ With leader │ -- │ With leader │
-- ╰─────────────────────────────────────────────────────────╯ -- ╰─────────────────────────────────────────────────────────╯
@@ -26,18 +23,21 @@ return {
'<leader>b', '<leader>b',
group = '[b] Buffer', group = '[b] Buffer',
expand = function() expand = function()
-- Add the current buffers to the menu
return require('which-key.extras').expand.buf() return require('which-key.extras').expand.buf()
end, end,
}, },
{ '<leader>bk', ':blast<cr>', desc = 'Buffer: Last', mode = 'n' }, { '<leader>bk', '<cmd>blast<cr>', desc = 'Buffer: Last', mode = 'n' },
{ '<leader>bj', ':bfirst<cr>', desc = 'Buffer: First', mode = 'n' }, { '<leader>bj', '<cmd>bfirst<cr>', desc = 'Buffer: First', mode = 'n' },
{ '<leader>bh', ':bprev<cr>', desc = 'Buffer: Prev', mode = 'n' }, { '<leader>bh', '<cmd>bprev<cr>', desc = 'Buffer: Prev', mode = 'n' },
{ '<leader>bl', ':bnext<cr>', desc = 'Buffer: Next', mode = 'n' }, { '<leader>bl', '<cmd>bnext<cr>', desc = 'Buffer: Next', mode = 'n' },
{ '<leader>bd', ':Bdelete<cr>', desc = 'Buffer: Delete', mode = 'n' }, { '<leader>bd', '<cmd>Bdelete<cr>', desc = 'Buffer: Delete', mode = 'n' },
{ '<leader>bw', ':Bwipeout<cr>', desc = 'Buffer: Wipeout', mode = 'n' }, { '<leader>bw', '<cmd>Bwipeout<cr>', desc = 'Buffer: Wipeout', mode = 'n' },
-- ── Code ──────────────────────────────────────────────────────────── -- ── Code ────────────────────────────────────────────────────────────
{ '<leader>c', group = '[c] Code' }, { '<leader>c', group = '[c] Code' },
{ '<leader>ca', '<cmd>lua vim.lsp.buf.code_action()<CR>', desc = 'LSP: Code Action' },
{ '<leader>cg', '<cmd>lua require("neogen").generate()<CR>', desc = 'Generate annotations' },
-- ── Code: CommentBox ──────────────────────────────────────────────── -- ── Code: CommentBox ────────────────────────────────────────────────
{ '<leader>cb', group = 'CommentBox' }, { '<leader>cb', group = 'CommentBox' },
{ '<leader>cbb', '<Cmd>CBccbox<CR>', desc = 'CommentBox: Box Title' }, { '<leader>cbb', '<Cmd>CBccbox<CR>', desc = 'CommentBox: Box Title' },
@@ -45,65 +45,181 @@ return {
{ '<leader>cbl', '<Cmd>CBline<CR>', desc = 'CommentBox: Simple Line' }, { '<leader>cbl', '<Cmd>CBline<CR>', desc = 'CommentBox: Simple Line' },
{ '<leader>cbm', '<Cmd>CBllbox14<CR>', desc = 'CommentBox: Marked' }, { '<leader>cbm', '<Cmd>CBllbox14<CR>', desc = 'CommentBox: Marked' },
{ '<leader>cbt', '<Cmd>CBllline<CR>', desc = 'CommentBox: Titled Line' }, { '<leader>cbt', '<Cmd>CBllline<CR>', desc = 'CommentBox: Titled Line' },
-- ── Code: package.json control ──────────────────────────────────────
-- See: lua/plugins/lazy.lua
{ '<leader>cn', group = 'package.json control' },
{ '<leader>cnd', '<cmd>lua require("package-info").delete()<cr>', desc = 'Delete package' },
{ '<leader>cni', '<cmd>lua require("package-info").install()<cr>', desc = 'Install package' },
{ '<leader>cns', '<cmd>lua require("package-info").show({ force = true })<cr>', desc = 'Show package info' },
{ '<leader>cnu', '<cmd>lua require("package-info").change_version()<cr>', desc = 'Change version' },
-- ── Code: Refactoring ───────────────────────────────────────────────
{ '<leader>cx', group = '[x] Refactoring' },
{
mode = { 'x' },
-- Extract function supports only visual mode
{ '<leader>cxe', "<cmd>lua require('refactoring').refactor('Extract Function')<cr>", desc = 'Extract Function' },
{ '<leader>cxf', "<cmd>lua require('refactoring').refactor('Extract Function To File')<cr>", desc = 'Extract Function to File' },
-- Extract variable supports only visual mode
{ '<leader>cxv', "<cmd>lua require('refactoring').refactor('Extract Variable')<cr>", desc = 'Extract Variable' },
},
-- Inline func supports only normal
{ '<leader>cxi', "<cmd>lua require('refactoring').refactor('Inline Function')<cr>", desc = 'Inline Function' },
-- Extract block supports only normal mode
{ '<leader>cxb', "<cmd>lua require('refactoring').refactor('Extract Block')<cr>", desc = 'Extract Block' },
{ '<leader>cxbf', "<cmd>lua require('refactoring').refactor('Extract Block To File')<cr>", desc = 'Extract Block to File' },
{
mode = { 'n', 'x' },
-- Inline var supports both normal and visual mode
{ '<leader>cxi', "<cmd>lua require('refactoring').refactor('Inline Variable')<cr>", desc = 'Inline Variable' },
},
-- ── Code: LSPSaga ───────────────────────────────────────────────────
-- See: lua/plugins/lsp.lua
{ '<C-a>', '<cmd>Lspsaga term_toggle<cr>', desc = 'LSPSaga: Open Floaterm' },
{ '<leader>ca', '<cmd>Lspsaga code_action<cr>', desc = 'LSPSaga: Code Actions' },
{ '<leader>cci', '<cmd>Lspsaga incoming_calls<cr>', desc = 'LSPSaga: Incoming Calls' },
{ '<leader>cco', '<cmd>Lspsaga outgoing_calls<cr>', desc = 'LSPSaga: Outgoing Calls' },
{ '<leader>cd', '<cmd>Lspsaga show_line_diagnostics<cr>', desc = 'LSPSaga: Show Line Diagnostics' },
-- <leader>cf = Code Format, see: lua/plugins/autoformat.lua
{ '<leader>ci', '<cmd>Lspsaga implement<cr>', desc = 'LSPSaga: Implementations' },
{ '<leader>cl', '<cmd>Lspsaga show_cursor_diagnostics<cr>', desc = 'LSPSaga: Show Cursor Diagnostics' },
{ '<leader>cp', '<cmd>Lspsaga peek_definition<cr>', desc = 'LSPSaga: Peek Definition' },
{ '<leader>cr', '<cmd>Lspsaga rename<cr>', desc = 'LSPSaga: Rename' },
{ '<leader>cR', '<cmd>Lspsaga rename ++project<cr>', desc = 'LSPSaga: Rename Project wide' },
{ '<leader>cs', '<cmd>Lspsaga signature_help<cr>', desc = 'LSPSaga: Signature Documentation' },
{ '<leader>ct', '<cmd>Lspsaga peek_type_definition<cr>', desc = 'LSPSaga: Peek Type Definition' },
{ '<leader>cu', '<cmd>Lspsaga preview_definition<cr>', desc = 'LSPSaga: Preview Definition' },
{ '<leader>cv', '<cmd>Lspsaga diagnostic_jump_prev<cr>', desc = 'LSPSaga: Diagnostic Jump Prev' },
{ '<leader>cw', '<cmd>Lspsaga diagnostic_jump_next<cr>', desc = 'LSPSaga: Diagnostic Jump Next' },
-- ── DAP ─────────────────────────────────────────────────────────────
{ '<leader>d', group = '[d] DAP' }, { '<leader>d', group = '[d] DAP' },
-- See: lua/plugins/dap.lua { '<leader>db', '<cmd>DapToggleBreakpoint', desc = 'DAP: Toggle Breakpoint' },
{ '<leader>dc', '<cmd>DapContinue', desc = 'DAP: Continue' },
{ '<leader>g', group = '[g] Git' }, { '<leader>do', '<cmd>lua vim.diagnostic.open_float()<CR>', desc = 'Diagnostic: Open float' },
-- See: lua/plugins/git.lua { '<leader>dq', '<cmd>lua vim.diagnostic.setloclist()<CR>', desc = 'Diagnostic: Set loc list' },
{ '<leader>dr', "<cmd>lua require('dapui').open({reset = true})<CR>", desc = 'DAP: Reset' },
{ '<leader>ds', '<cmd>lua require("telescope.builtin").lsp_document_symbols()<CR>', desc = 'LSP: Document Symbols' },
{ '<leader>dt', '<cmd>DapUiToggle', desc = 'DAP: Toggle UI' },
-- ── Harpoon ─────────────────────────────────────────────────────────
-- See: lua/plugins/telescope.lua
{ '<leader>h', group = '[h] Harpoon' }, { '<leader>h', group = '[h] Harpoon' },
-- See: lua/plugins/harpoon.lua { '<leader>ha', '<cmd>lua require("harpoon"):list():add()<cr>', desc = 'harpoon file' },
{ '<leader>hn', '<cmd>lua require("harpoon"):list():next()<cr>', desc = 'harpoon to next file' },
{ '<leader>hp', '<cmd>lua require("harpoon"):list():prev()<cr>', desc = 'harpoon to previous file' },
{ '<leader>ht', "<cmd>lua require('harpoon.ui').toggle_quick_menu()<CR>", desc = 'DAP: Harpoon UI' },
-- ── LSP ─────────────────────────────────────────────────────────────
{ '<leader>l', group = '[l] LSP' }, { '<leader>l', group = '[l] LSP' },
-- See: lua/plugins/lsp.lua -- See: lua/plugins/lsp.lua
-- ── Quit ──────────────────────────────────────────────────────────── -- ── Quit ────────────────────────────────────────────────────────────
{ '<leader>q', group = '[q] Quit' }, { '<leader>q', group = '[q] Quit' },
{ '<leader>qf', ':q<CR>', desc = 'Quicker close split' }, { '<leader>qf', '<cmd>q<CR>', desc = 'Quicker close split' },
{ '<leader>qq', ':wq!<CR>', desc = 'Quit with force saving' }, { '<leader>qq', '<cmd>wq!<CR>', desc = 'Quit with force saving' },
{ '<leader>qw', ':wq<CR>', desc = 'Write and quit' }, { '<leader>qw', '<cmd>wq<CR>', desc = 'Write and quit' },
-- ── Search ──────────────────────────────────────────────────────────
{ '<leader>s', group = '[s] Search' }, { '<leader>s', group = '[s] Search' },
-- See: lua/plugins/telescope.lua -- See: lua/plugins/telescope.lua
{ '<leader><space>', "<cmd>lua require('telescope.builtin').buffers()<cr>", desc = 'Find existing buffers' },
{ '<leader><tab>', "<cmd>lua require('telescope.builtin').commands()<CR>", desc = 'Telescope: Commands' },
{ '<leader>sd', "<cmd>lua require('telescope.builtin').diagnostics()<cr>", desc = 'Search Diagnostics' },
{ '<leader>sg', "<cmd>lua require('telescope.builtin').live_grep()<cr>", desc = 'Search by Grep' },
{ '<leader>sm', '<cmd>Telescope harpoon marks<CR>', desc = 'Harpoon Marks' },
{ '<leader>sn', "<cmd>lua require('telescope').extensions.notify.notify()<CR>", desc = 'Notify' },
{ '<leader>so', "<cmd>lua require('telescope.builtin').oldfiles()<cr>", desc = 'Find recently Opened files' },
{ '<leader>sp', "<cmd>lua require('telescope').extensions.lazy_plugins.lazy_plugins()<cr>", desc = 'Find neovim/lazy configs' },
{ '<leader>st', '<cmd>TodoTelescope<CR>', desc = 'Telescope: Todo' },
{ '<leader>sw', "<cmd>lua require('telescope.builtin').grep_string()<cr>", desc = 'Search current Word' },
-- ── Toggle ────────────────────────────────────────────────────────── -- ── Toggle ──────────────────────────────────────────────────────────
{ '<leader>t', group = '[t] Toggle' }, { '<leader>t', group = '[t] Toggle' },
{ '<leader>tt', ':TransparentToggle<CR>', desc = 'Toggle Transparency' }, { '<leader>tc', '<cmd>CloakToggle<cr>', desc = 'Toggle Cloak' },
{ '<leader>ts', ':noh<CR>', desc = 'Toggle Search Highlighting' }, { '<leader>tn', '<cmd>Noice dismiss<CR>', desc = 'Noice dismiss' },
{ '<leader>ts', '<cmd>noh<CR>', desc = 'Toggle Search Highlighting' },
{ '<leader>tt', '<cmd>TransparentToggle<CR>', desc = 'Toggle Transparency' },
{ '<leader>tw', '<cmd>Twilight<cr>', desc = 'Toggle Twilight' },
-- ── Workspace ───────────────────────────────────────────────────────
{ '<leader>w', group = '[w] Workspace' }, { '<leader>w', group = '[w] Workspace' },
{ '<leader>x', group = '[x] Trouble' }, { '<leader>wa', '<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>', desc = 'LSP: Workspace Add Folder' },
{ '<leader>z', group = '[z] FZF' }, { '<leader>wl', '<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>', desc = 'LSP: Workspace List Folders' },
{ '<leader>wr', '<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>', desc = 'LSP: Workspace Remove Folder' },
{ '<leader>ws', '<cmd>lua require("telescope.builtin").lsp_dynamic_workspace_symbols()<CR>', desc = 'LSP: Workspace Symbols' },
-- ── Help ──────────────────────────────────────────────────────────── -- ── Trouble ─────────────────────────────────────────────────────────
{ '<leader>?', group = '[?] Help' }, { '<leader>x', group = '[x] Trouble' },
{ { '<leader>xx', '<cmd>Trouble<cr>', desc = 'Toggle Trouble' },
'<leader>?w', { '<leader>xw', '<cmd>Trouble workspace_diagnostics<cr>', desc = 'Toggle Workspace Diagnostics' },
function() { '<leader>xd', '<cmd>Trouble document_diagnostics<cr>', desc = 'Toggle Document Diagnostics' },
wk.show { global = false } { '<leader>xl', '<cmd>Trouble loclist<cr>', desc = 'Toggle Loclist' },
end, { '<leader>xq', '<cmd>Trouble quickfix<cr>', desc = 'Toggle Quickfix' },
desc = 'Buffer Local Keymaps (which-key)',
}, -- ── Help & Neoconf ──────────────────────────────────────────────────
{ '<leader>?', group = '[?] Help & neoconf' },
{ '<leader>?c', '<cmd>Neoconf<CR>', desc = 'Neoconf: Open' },
{ '<leader>?g', '<cmd>Neoconf global<CR>', desc = 'Neoconf: Global' },
{ '<leader>?l', '<cmd>Neoconf local<CR>', desc = 'Neoconf: Local' },
{ '<leader>?m', '<cmd>Neoconf lsp<CR>', desc = 'Neoconf: Show merged LSP config' },
{ '<leader>?s', '<cmd>Neoconf show<CR>', desc = 'Neoconf: Show merged config' },
{ '<leader>?w', '<cmd>lua require("which-key").show({global = false})<cr>', desc = 'Buffer Local Keymaps (which-key)' },
-- ── Misc ────────────────────────────────────────────────────────────
{ '<leader>1', '<cmd>lua require("harpoon"):list():select(1)<cr>', desc = 'harpoon to file 1' },
{ '<leader>2', '<cmd>lua require("harpoon"):list():select(2)<cr>', desc = 'harpoon to file 2' },
{ '<leader>3', '<cmd>lua require("harpoon"):list():select(3)<cr>', desc = 'harpoon to file 3' },
{ '<leader>4', '<cmd>lua require("harpoon"):list():select(4)<cr>', desc = 'harpoon to file 4' },
{ '<leader>5', '<cmd>lua require("harpoon"):list():select(5)<cr>', desc = 'harpoon to file 5' },
{ '<leader>D', '<cmd>lua vim.lsp.buf.type_definition()<CR>', desc = 'LSP: Type Definition' },
{ '<leader>e', '<cmd>Neotree reveal<CR>', desc = 'NeoTree reveal' },
-- ╭─────────────────────────────────────────────────────────╮ -- ╭─────────────────────────────────────────────────────────╮
-- │ Without leader │ -- │ Without leader │
-- ╰─────────────────────────────────────────────────────────╯ -- ╰─────────────────────────────────────────────────────────╯
{ 'y', group = 'Yank & Surround' }, { 'y', group = 'Yank & Surround' },
{ 'gp', group = 'Goto Preview' },
{ 'gpd', '<cmd>lua require("goto-preview").goto_preview_definition()<CR>' },
{ 'gpi', '<cmd>lua require("goto-preview").goto_preview_implementation()<CR>' },
{ 'gpP', '<cmd>lua require("goto-preview").close_all_windows()<CR>' },
-- ── tmux navigation ─────────────────────────────────────────────────
{ '<c-h>', '<cmd><C-U>TmuxNavigateLeft<cr>', desc = 'tmux: Navigate Left' },
{ '<c-j>', '<cmd><C-U>TmuxNavigateDown<cr>', desc = 'tmux: Navigate Down' },
{ '<c-k>', '<cmd><C-U>TmuxNavigateUp<cr>', desc = 'tmux: Navigate Up' },
{ '<c-l>', '<cmd><C-U>TmuxNavigateRight<cr>', desc = 'tmux: Navigate Right' },
{ '<c-\\>', '<cmd><C-U>TmuxNavigatePrevious<cr>', desc = 'tmux: Navigate Previous' },
-- ── Old habits ────────────────────────────────────────────────────── -- ── Old habits ──────────────────────────────────────────────────────
{ '<C-s>', ':w<CR>', desc = 'Save file' }, { '<C-s>', '<cmd>w<CR>', desc = 'Save file' },
-- ── Text manipulation in visual mode ──────────────────────────────── -- ── Text manipulation in visual mode ────────────────────────────────
{ '>', '>gv', desc = 'Indent Right', mode = 'v' }, {
{ '<', '<gv', desc = 'Indent Left', mode = 'v' }, mode = 'v',
{ 'J', ":m '>+1<CR>gv=gv", desc = 'Move Block Down', mode = 'v' }, { '>', '>gv', desc = 'Indent Right' },
{ 'K', ":m '<-2<CR>gv=gv", desc = 'Move Block Up', mode = 'v' }, { '<', '<gv', desc = 'Indent Left' },
{ 'J', "<cmd>m '>+1<CR>gv=gv", desc = 'Move Block Down' },
{ 'K', "<cmd>m '<-2<CR>gv=gv", desc = 'Move Block Up' },
},
-- ── LSP ─────────────────────────────────────────────────────────────
{ '<C-k>', '<cmd>lua vim.lsp.buf.signature_help()<CR>', desc = 'LSP: Signature Documentation' },
{ 'K', '<cmd>Lspsaga hover_doc<cr>', desc = 'LSPSaga: Hover Documentation' },
{ 'dn', '<cmd>lua vim.diagnostic.goto_next()<CR>', desc = 'Diagnostic: Goto Next' },
{ 'dp', '<cmd>lua vim.diagnostic.goto_prev()<CR>', desc = 'Diagnostic: Goto Prev' },
{ 'gD', '<cmd>lua vim.lsp.buf.declaration()<CR>', desc = 'LSP: Goto Declaration' },
{ 'gI', '<cmd>lua vim.lsp.buf.implementation()<CR>', desc = 'LSP: Goto Implementation' },
{ 'gR', '<cmd>Trouble lsp_references<cr>', desc = 'Toggle LSP References' },
{ 'gd', '<cmd>lua vim.lsp.buf.definition()<CR>', desc = 'LSP: Goto Definition' },
{ 'gr', '<cmd>lua require("telescope.builtin").lsp_references()<CR>', desc = 'LSP: Goto References' },
-- ── Misc keybinds ─────────────────────────────────────────────────── -- ── Misc keybinds ───────────────────────────────────────────────────
{ 'QQ', ':q!<CR>', desc = 'Quit without saving' }, -- Sublime-like shortcut 'go to file' ctrl+p.
{ 'WW', ':w!<CR>', desc = 'Force write to file' }, { '<C-p>', '<cmd>Telescope find_files<CR>', desc = 'Search for files starting at current directory.' },
{ 'ss', ':noh<CR>', desc = 'Clear Search Highlighting' }, { 'QQ', '<cmd>q!<CR>', desc = 'Quit without saving' },
{ 'WW', '<cmd>w!<CR>', desc = 'Force write to file' },
{ 'ss', '<cmd>noh<CR>', desc = 'Clear Search Highlighting' },
{ 'jj', '<Esc>', desc = 'Esc without touching esc in insert mode', mode = 'i' }, { 'jj', '<Esc>', desc = 'Esc without touching esc in insert mode', mode = 'i' },
-- ── Splits ────────────────────────────────────────────────────────── -- ── Splits ──────────────────────────────────────────────────────────
@@ -114,8 +230,8 @@ return {
{ '<C-j>', '<C-w><C-j>', desc = 'Move focus to the lower window' }, { '<C-j>', '<C-w><C-j>', desc = 'Move focus to the lower window' },
{ '<C-k>', '<C-w><C-k>', desc = 'Move focus to the upper window' }, { '<C-k>', '<C-w><C-k>', desc = 'Move focus to the upper window' },
-- Split resizing -- Split resizing
{ '<C-w>,', ':vertical resize -10<CR>', desc = 'V Resize -' }, { '<C-w>,', '<cmd>vertical resize -10<CR>', desc = 'V Resize -' },
{ '<C-w>.', ':vertical resize +10<CR>', desc = 'V Resize +' }, { '<C-w>.', '<cmd>vertical resize +10<CR>', desc = 'V Resize +' },
-- ── Disable arrow keys in normal mode ─────────────────────────────── -- ── Disable arrow keys in normal mode ───────────────────────────────
{ '<left>', '<cmd>echo "Use h to move!!"<CR>' }, { '<left>', '<cmd>echo "Use h to move!!"<CR>' },
@@ -134,7 +250,7 @@ return {
-- ── Search ────────────────────────────────────────────────────────── -- ── Search ──────────────────────────────────────────────────────────
-- :noh if you have search highlights -- :noh if you have search highlights
{ '<Esc><Esc>', ':noh<CR>', desc = 'Clear search highlights' }, { '<Esc><Esc>', '<cmd>noh<CR>', desc = 'Clear search highlights' },
} }
end, end,
} }

View File

@@ -11,3 +11,110 @@ good
#rd/! #rd/!
#rd #rd
wrd/! wrd/!
neovim
github
folke
nvim
keybinds
https
CommentBox
lua
dap
lsp
wincmd
CTRL
hjkl
resizing
noh
UiEnter
signcolumn
popup
whitespace
listchars
completeopt
Autoformat
stevearc
isort
formatters
formatter
hrsh7th
cmp
repos
editorconfig
rmagatti
goto
UI
api
configs
bufhidden
ThePrimeagen
preservim
tpope
todo
lukas
reineke
blankline
tabstop
shiftwidth
wakatime
numToStr
zbirenbaum
onsails
lspkind
pictograms
vscode
SergioRibera
dotenv
config
schemaStore
TypeError
dev
Automagically
runtime
discoverable
lspconfig
pre
LSPs
Stylelint
CSS
PHP
GitLab
ESLint
Ansible
Terraform
TypeScript
JS
Vue
YAML
LSPSaga
luasnip
saadparwaiz1
LuaSnip
L3MON4D3
jumplist
textobjects
scm
textobj
treesitter
statusline
lualine
ivuorinen's
lazylazy
cmdline
popupmenu
noice
statuscolumn
TreeSitter
ivuorinen
github
github
Tampere
Logrotate
sysvinit
Noice
fzf
linters
LSPConfig
deps
Noice
stdpath

Binary file not shown.