refactor: clean up file tree, remove redundant code, formatting

This commit is contained in:
2024-12-20 18:11:06 -05:00
parent daa0aefd21
commit 660afc8411
33 changed files with 418 additions and 447 deletions
+7 -5
View File
@@ -1,23 +1,25 @@
local autocmd = vim.api.nvim_create_autocmd
local augroup = vim.api.nvim_create_augroup
local o = vim.opt_local
-- ──────────────────[ set options for markdown files ]───────────────
autocmd('FileType', {
pattern = 'markdown',
callback = function()
vim.opt_local.textwidth = 80
vim.opt_local.spell = true
o.colorcolumn = '+1,+2'
o.textwidth = 80
o.spell = true
end,
})
-- ─────────────────────[ set options for gitcommit ]─────────────────────
--[[ -- ─────────────────────[ set options for gitcommit ]─────────────────────
autocmd('FileType', {
pattern = 'gitcommit',
callback = function()
vim.opt_local.textwidth = 78
vim.opt_local.spell = true
end,
})
}) ]]
-- ┌
-- │ Highlight on yank
@@ -29,4 +31,4 @@ autocmd('TextYankPost', {
callback = function()
vim.highlight.on_yank({ higroup = 'IncSearch', timeout = '800' })
end,
})
})
+55 -56
View File
@@ -9,18 +9,55 @@ local function opts(desc)
end
-- ───────────────────────────────────────────────────( general use )─
keymap.set('i', 'jk', '<ESC>', opts('Exit insert mode with jk'))
keymap.set('i', 'jk', '<ESC>', opts('Exit insert mode'))
keymap.set('n', '<leader>nh', ':nohl<CR>', opts('Clear search highlights'))
keymap.set({ 'n', 'v' }, '<leader>cm', '<cmd>Noice dismiss<CR>', opts('Dismiss notifications'))
keymap.set('n', '<leader>?', '<cmd>Telescope help_tags<CR>', opts('Search documentation'))
keymap.set({ 'n', 'v' }, '<leader>cm', '<cmd>NoiceDismiss<CR>', opts('Dismiss notifications'))
-- ─────────────────────────────────────────────────────( telescope )─
keymap.set('n', '<leader>fh', '<cmd>Telescope help_tags<CR>', opts('Search documentation'))
keymap.set(
'n',
'<leader>ff',
'<cmd>Telescope find_files initial_mode=insert sort_mru=true sort_lastused=true select_current=true<cr>',
opts('Fuzzy find files in cwd')
)
keymap.set(
'n',
'<leader>fr',
'<cmd>Telescope oldfiles initial_mode=insert sort_mru=true sort_lastused=true select_current=true<cr>',
opts('Fuzzy find recent files')
)
keymap.set('n', '<leader>fs', '<cmd>Telescope current_buffer_fuzzy_find<cr>', opts('Find string in this buffer'))
keymap.set('n', '<leader>fS', '<cmd>Telescope live_grep<cr>', opts('Find string in cwd'))
keymap.set('n', '<leader>fc', '<cmd>Telescope grep_string<cr>', opts('Find string under cursor in cwd'))
keymap.set(
'n',
'<leader>ft',
'<cmd>TodoTelescope initial_mode=normal sort_mru=true sort_lastused=true select_current=true<cr>',
opts('Find todos')
)
keymap.set(
'n',
'<leader>fb',
'<cmd>Telescope buffers initial_mode=normal sort_mru=true sort_lastused=true select_current=true<cr>',
opts('Select from open buffers')
)
keymap.set(
'n',
'<leader>fn',
'<cmd>Telescope find_files cwd=' .. vim.fn.stdpath('config') .. '<cr>',
opts('Edit nvim config')
)
keymap.set('n', '<leader>fm', '<cmd>NoiceTelescope<cr>', opts('Open messages with Telescope'))
-- ──────────────────────────────────────────────────────( run code )─
keymap.set('n', '<leader>cr', '<cmd>MdEval<CR>', opts('Execute markdown codeblock'))
keymap.set('n', '<leader><leader>x', '<cmd>source %<CR>', opts('Execute the current file'))
keymap.set('n', '<leader>cx', ':.lua<CR>', opts('Execute current line'))
keymap.set('v', '<leader>cx', ':lua<CR>', opts('Execute selected code'))
-- ────────────────────────────────────────────────────( formatting )─
keymap.set({ 'n', 'v' }, '<leader>F', function()
keymap.set({ 'n', 'v' }, '<leader>cF', function()
require('conform').format({
lsp_fallback = true,
async = false,
@@ -29,7 +66,7 @@ keymap.set({ 'n', 'v' }, '<leader>F', function()
end, opts('Format file or selection'))
-- ───────────────────────────────────────────────────────( linting )─
keymap.set('n', '<leader>l', function()
keymap.set('n', '<leader>cl', function()
require('lint').try_lint()
end, opts('Trigger linting for current file'))
@@ -37,6 +74,16 @@ end, opts('Trigger linting for current file'))
keymap.set('n', '<leader>+', '<C-a>', opts('Increment number'))
keymap.set('n', '<leader>-', '<C-x>', opts('Decrement number'))
-- ────────────────────────────────────────────────────( bufferline )─
keymap.set('n', '<leader>bp', '<cmd>BufferLineTogglePin<CR>', opts('Toggle pinned tab'))
keymap.set('n', '<leader>bg', '<cmd>BufferLinePick<CR>', opts('Pick tab'))
keymap.set('n', '<leader>bx', '<cmd>bdelete<CR>', opts('Close tab'))
keymap.set('n', '<leader>bX', '<cmd>BufferLineCloseOthers<CR>', opts('Close other tabs'))
keymap.set('n', ']b', '<cmd>BufferLineCycleNext<CR>', opts('Next tab'))
keymap.set('n', '[b', '<cmd>BufferLineCyclePrev<CR>', opts('Previous tab'))
keymap.set('n', '<S-L>', '<cmd>BufferLineMoveNext<CR>', opts('Move tab to the right'))
keymap.set('n', '<S-H>', '<cmd>BufferLineMovePrev<CR>', opts('Move tab to the left'))
-- ──────────────────────────────────────────────( split management )─
keymap.set('n', '<leader>sv', '<C-w>v', opts('Split window vertically'))
keymap.set('n', '<leader>sh', '<C-w>s', opts('Split window horizontally'))
@@ -51,16 +98,6 @@ keymap.set('n', '<leader>tx', '<cmd>tabclose<CR>', opts('Close current tab'))
-- keymap.set("n", "<leader>tp", "<cmd>tabp<CR>", opts("Go to previous tab"))
keymap.set('n', '<leader>tf', '<cmd>tabnew %<CR>', opts('Open current buffer in new tab'))
-- ────────────────────────────────────────────────────( bufferline )─
keymap.set('n', '<leader>bp', '<cmd>BufferLineTogglePin<CR>', opts('Toggle pinned tab'))
keymap.set('n', '<leader>bg', '<cmd>BufferLinePick<CR>', opts('Pick tab'))
keymap.set('n', '<leader>bx', '<cmd>bdelete<CR>', opts('Close tab'))
keymap.set('n', '<leader>bX', '<cmd>BufferLineCloseOthers<CR>', opts('Close other tabs'))
keymap.set('n', ']b', '<cmd>BufferLineCycleNext<CR>', opts('Next tab'))
keymap.set('n', '[b', '<cmd>BufferLineCyclePrev<CR>', opts('Previous tab'))
keymap.set('n', '<S-L>', '<cmd>BufferLineMoveNext<CR>', opts('Move tab to the right'))
keymap.set('n', '<S-H>', '<cmd>BufferLineMovePrev<CR>', opts('Move tab to the left'))
-- ────────────────────────────────────────────( session management )─
keymap.set('n', '<leader>wa', '<cmd>SessionToggleAutoSave<CR>', opts('Toggle session autosave'))
keymap.set('n', '<leader>wD', '<cmd>Autosession delete<CR>', opts('Delete a session'))
@@ -107,41 +144,6 @@ keymap.set(
opts('Open todos in trouble')
)
-- ─────────────────────────────────────────────────────( telescope )─
keymap.set(
'n',
'<leader>ff',
'<cmd>Telescope find_files initial_mode=insert sort_mru=true sort_lastused=true select_current=true<cr>',
opts('Fuzzy find files in cwd')
)
keymap.set(
'n',
'<leader>fr',
'<cmd>Telescope oldfiles initial_mode=insert sort_mru=true sort_lastused=true select_current=true<cr>',
opts('Fuzzy find recent files')
)
keymap.set('n', '<leader>fs', '<cmd>Telescope current_buffer_fuzzy_find<cr>', opts('Find string in this buffer'))
keymap.set('n', '<leader>fS', '<cmd>Telescope live_grep<cr>', opts('Find string in cwd'))
keymap.set('n', '<leader>fc', '<cmd>Telescope grep_string<cr>', opts('Find string under cursor in cwd'))
keymap.set(
'n',
'<leader>ft',
'<cmd>TodoTelescope initial_mode=normal sort_mru=true sort_lastused=true select_current=true<cr>',
opts('Find todos')
)
keymap.set(
'n',
'<leader>fb',
'<cmd>Telescope buffers initial_mode=normal sort_mru=true sort_lastused=true select_current=true<cr>',
opts('Select from open buffers')
)
keymap.set(
'n',
'<leader>fn',
'<cmd>Telescope find_files cwd=' .. vim.fn.stdpath('config') .. '<cr>',
opts('Edit nvim config')
)
-- ────────────────────────────────────────────────────( substitute )─
keymap.set('n', 's', function()
require('substitute').operator()
@@ -156,7 +158,7 @@ keymap.set('x', 's', function()
require('substitute').visual()
end, opts('Substitute in visual mode'))
-- ─────────────────────────────────────────────────────( nvim-tree )─
-- ──────────────────────────────────────────────────( file browser )─
keymap.set('n', '<leader>ee', '<cmd>NvimTreeToggle<CR>', opts('Toggle file explorer'))
keymap.set('n', '<leader>ef', '<cmd>NvimTreeFindFileToggle<CR>', opts('Toggle file explorer on current file'))
keymap.set('n', '<leader>ec', '<cmd>NvimTreeCollapse<CR>', opts('Collapse file explorer'))
@@ -171,10 +173,10 @@ end, opts('Diff this'))
keymap.set('n', '<leader>hD', function()
require('gitsigns').diffthis('~')
end, opts('Diff this ~'))
vim.keymap.set('n', '<leader>hw', '<cmd>Gitsigns toggle_word_diff', opts('Toggle word diff'))
-- ───────────────────────────────────────────────────────────( git )─
keymap.set('n', '<leader>Lg', '<cmd>LazyGit<cr>', opts('Open LazyGit'))
vim.keymap.set('n', '<leader>hw', '<cmd>Gitsigns toggle_word_diff', opts('Toggle word diff'))
keymap.set('n', ']h', function()
require('gitsigns').nav_hunk('next')
end, opts('Next hunk'))
@@ -227,9 +229,6 @@ keymap.set('n', '<leader>cp', '<cmd>CccPick<CR>', opts('Open color picker'))
keymap.set({ 'n', 'v' }, '<leader>cv', '<cmd>CccConvert<CR>', opts('Convert color'))
keymap.set('n', '<leader>cc', '<cmd>CccHighlighterToggle<CR>', opts('Toggle rendered colors'))
-- ──────────────────────────────────────────────────────( markdown )─
keymap.set('n', '<leader>cr', '<cmd>MdEval<CR>', opts('Execute markdown codeblock'))
-- ────────────────────────────────────────────────────( spellcheck )─
keymap.set('n', '<leader>S', function()
if vim.wo.spell then
@@ -244,4 +243,4 @@ keymap.set('i', '<C-s>', function()
else
vim.opt_local.spell = true
end
end, opts('Toggle spell check'))
end, opts('Toggle spell check'))
+1 -9
View File
@@ -22,14 +22,6 @@ o.number = true
o.relativenumber = true
-- ──────────────────────────────────────────────────── sign column ──
o.signcolumn = 'yes'
-- ─────────────────────────────────────────────────────── markdown ──
vim.api.nvim_create_autocmd('BufWinEnter', {
pattern = { '*.md' },
callback = function()
o.colorcolumn = '+1,+2'
o.textwidth = 80
end,
})
-- ──────────────────────────────────────────────────── cursor line ──
o.cursorline = true
-- o.scrolloff = 999 -- keep cursor line centered
@@ -95,4 +87,4 @@ o.ignorecase = true
o.smartcase = true
o.iskeyword:append('-') -- consider string-string as a whole word
-- ───────────────────────────────────────────────────── completion ──
o.completeopt = 'menu,preview,noselect'
o.completeopt = 'menu,preview,noselect'
+1 -2
View File
@@ -182,12 +182,11 @@ return {
},
})
-- FIX: on my Arch laptop, 't' as first character on cmdline escapes
-- the cmdline and destructively prints xx:xx to the document
cmp.setup.cmdline(':', {
enabled = function()
local disabled = {
-- list of commands to disable completions
wa = true,
wq = true,
wqa = true,
}
+1 -1
View File
@@ -24,4 +24,4 @@ return {
},
},
},
}
}
+8 -11
View File
@@ -1,15 +1,13 @@
return {
'stevearc/dressing.nvim',
dependencies = {
'nvim-telescope/telescope.nvim',
},
event = 'VeryLazy',
opts = {
input = {
enabled = true,
-- default_prompt = 'Prompt',
prompt_align = 'left',
trim_prompt = 'true',
insert_only = false,
-- start_mode = 'insert',
start_in_insert = true,
border = 'rounded',
relative = 'cursor',
@@ -27,9 +25,6 @@ return {
['<Down>'] = 'HistoryNext',
},
},
override = function(conf)
return conf
end,
},
select = {
enabled = true,
@@ -44,9 +39,11 @@ return {
['<CR>'] = 'Confirm',
},
},
override = function(conf)
return conf
end,
},
nui = {
win_options = {
winblend = 0.7,
},
},
},
}
}
+1 -1
View File
@@ -9,4 +9,4 @@ return {
seps = { '' },
},
},
}
}
+13 -2
View File
@@ -1,4 +1,15 @@
return {
'tpope/vim-fugitive',
cmd = { 'Git', 'Gdiffsplit', 'Gedit', 'Gvdiffsplit', 'Gread', 'Gwrite', 'Ggrep', 'GMove', 'GDelete', 'GBrowse' },
}
cmd = {
'Git',
'Gdiffsplit',
'Gedit',
'Gvdiffsplit',
'Gread',
'Gwrite',
'Ggrep',
'GMove',
'GDelete',
'GBrowse',
},
}
+2 -1
View File
@@ -39,7 +39,8 @@ return {
numhl = true,
linehl = false,
word_diff = false,
show_deleted = false, -- turning this off for now as it seems to be slowing down neovim on MBP
trouble = true,
show_deleted = false,
watch_gitdir = {
interval = 1000,
follow_files = true,
+3 -1
View File
@@ -3,7 +3,7 @@ return {
event = { 'BufReadPre', 'BufNewFile' },
opts = {
providers = {
'lsp',
'nvim_lsp',
'treesitter',
'regex',
},
@@ -14,6 +14,8 @@ return {
'man',
'markdown',
'md',
'oil',
'fugitive',
},
under_cursor = true,
min_count_to_highlight = 1,
+29 -23
View File
@@ -1,18 +1,18 @@
return {
"lukas-reineke/indent-blankline.nvim",
event = { "BufReadPre", "BufNewFile" },
main = "ibl",
'lukas-reineke/indent-blankline.nvim',
event = { 'BufReadPre', 'BufNewFile' },
main = 'ibl',
opts = {
indent = {
char = "",
char = '',
smart_indent_cap = true,
highlight = {
"RainbowDelimiterCyan", -- #88c0d0
"RainbowDelimiterBlue", -- #81a1c1
"RainbowDelimiterGreen", -- #a3be8c
"RainbowDelimiterViolet", -- #b48ead
"RainbowDelimiterYellow", -- #ebcb8b
"RainbowDelimiterRed", -- #d08770
'RainbowDelimiterCyan', -- #88c0d0
'RainbowDelimiterBlue', -- #81a1c1
'RainbowDelimiterGreen', -- #a3be8c
'RainbowDelimiterViolet', -- #b48ead
'RainbowDelimiterYellow', -- #ebcb8b
'RainbowDelimiterRed', -- #d08770
-- "RainbowDelimiterOrange", -- #d08770
},
},
@@ -21,22 +21,28 @@ return {
show_start = true,
show_end = true,
-- highlight = { "Function", "Label" },
char = "",
char = '',
},
exclude = {
filetypes = {
"lspinfo",
"checkhealth",
"help",
"man",
"gitcommit",
"TelescopePrompt",
"TelescopeResults",
"",
"dashboard",
"alpha",
"NvimTree",
'lspinfo',
'checkhealth',
'help',
'man',
'gitcommit',
'TelescopePrompt',
'TelescopeResults',
'',
'alpha',
'NvimTree',
},
buftypes = {
'dashboard',
'terminal',
'nofile',
'quickfix',
'prompt',
},
},
},
}
}
+10 -9
View File
@@ -1,13 +1,14 @@
return {
"kdheepak/lazygit.nvim",
cmd = {
"LazyGit",
"LazyGitConfig",
"LazyGitCurrentFile",
"LazyGitFilter",
"LazyGitFilterCurrentFile",
},
-- TODO: replace with toggleterm or something similar..
'kdheepak/lazygit.nvim',
dependencies = {
"nvim-lua/plenary.nvim",
'nvim-lua/plenary.nvim',
},
cmd = {
'LazyGit',
'LazyGitConfig',
'LazyGitCurrentFile',
'LazyGitFilter',
'LazyGitFilterCurrentFile',
},
}
+20 -14
View File
@@ -1,25 +1,31 @@
return {
"mfussenegger/nvim-lint",
event = { "BufReadPre", "BufNewFile" },
'mfussenegger/nvim-lint',
event = { 'BufReadPre', 'BufNewFile' },
config = function()
local lint = require "lint"
local lint = require('lint')
lint.linters_by_ft = {
markdown = { "markdownlint" },
html = { "htmlhint" },
json = { "jsonlint" },
bash = { "shellcheck", "shellharden" },
javascript = { "eslint_d" },
typescript = { "eslint_d" },
javascriptreact = { "eslint_d" },
typescriptreact = { "eslint_d" },
python = { "pylint" },
markdown = { 'markdownlint' },
html = { 'htmlhint' },
json = { 'jsonlint' },
sh = { 'shellcheck' },
zsh = { 'shellcheck' },
bash = { 'shellcheck' },
javascript = { 'eslint_d', 'trivy' },
typescript = { 'eslint_d' },
python = { 'pylint', 'trivy' },
ansible = { 'ansiblelint' },
gitcommit = { 'gitlint' },
docker = { 'trivy' },
yaml = { 'yamllint' },
editorconfig = { 'editorconfig-checker' },
systemd = { 'systemdlint' },
}
local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true })
local lint_augroup = vim.api.nvim_create_augroup('lint', { clear = true })
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, {
group = lint_augroup,
callback = function()
lint.try_lint()
+1 -2
View File
@@ -51,7 +51,6 @@ return {
mason_tool_installer.setup({
ensure_installed = {
'ansible-lint',
'beautysh',
'black',
'eslint_d',
'gitlint',
@@ -70,4 +69,4 @@ return {
},
})
end,
}
}
+16 -2
View File
@@ -84,7 +84,7 @@ return {
prose.setup({
wpm = 200.0,
filetypes = { 'markdown', 'asciidoc' },
filetypes = { 'markdown', 'asciidoc', 'text' },
placeholders = {
words = nil,
minutes = nil,
@@ -165,6 +165,11 @@ return {
},
},
lualine_x = {
--[[ {
require('noice').api.status.mode.get,
cond = require('noice').api.status.mode.has,
color = { fg = '#d08770' },
}, ]]
{
-- show status when recording a macro
function()
@@ -272,7 +277,16 @@ return {
lualine_b = { { 'navic', color_correction = 'nil' } },
lualine_c = {},
lualine_x = {},
lualine_y = {},
lualine_y = {
{
'diagnostics',
sources = { 'nvim_lsp', 'nvim_workspace_diagnostic', 'nvim_diagnostic' },
sections = { 'error', 'warn', 'info' },
--symbols = { error = " ", warn = " ", info = " ", hint = "󰠠 " },
colored = true,
always_visible = true,
},
},
lualine_z = {},
},
inactive_winbar = {},
+7 -7
View File
@@ -2,19 +2,19 @@ return {
'willothy/moveline.nvim',
build = 'make',
keys = {
{ '<M-[>', mode = 'n' },
{ '<M-]>', mode = 'n' },
{ '<M-[>', mode = 'v' },
{ '<M-]>', mode = 'v' },
{ '<M-[>', mode = 'n' },
{ '<M-[>', mode = 'v' },
},
config = function()
local moveline = require('moveline')
local map = vim.keymap
map.set('n', '<M-[>', moveline.up)
map.set('n', '<M-]>', moveline.down)
map.set('v', '<M-[>', moveline.block_up)
map.set('v', '<M-]>', moveline.block_down)
map.set('n', '<M-]>', moveline.up)
map.set('n', '<M-[>', moveline.down)
map.set('v', '<M-]>', moveline.block_up)
map.set('v', '<M-[>', moveline.block_down)
end,
}
}
+45 -7
View File
@@ -8,22 +8,60 @@ return {
render = 'compact',
},
},
'nvim-treesitter/nvim-treesitter',
},
event = 'VeryLazy',
opts = {
lsp = {
override = {
['vim.lsp.util.convert_input_to_markdown_lines'] = true,
['vim.lsp.util.stylize_markdown'] = true,
['cmp.entry.get_documentation'] = true,
progress = {
enabled = true,
view = 'mini',
},
hover = {
enabled = true,
silent = true,
},
signature = {
enabled = true,
trigger = true,
luasnip = true,
},
message = {
enabled = true,
view = 'notify',
},
documentation = {
view = 'hover',
opts = {
lang = 'markdown',
},
},
override = {
['vim.lsp.util.convert_input_to_markdown_lines'] = false,
['vim.lsp.util.stylize_markdown'] = false,
['cmp.entry.get_documentation'] = false,
},
},
health = {
checker = true,
},
presets = {
bottom_search = true,
command_palette = false,
long_message_to_split = true,
inc_rename = false,
lsp_doc_border = true,
},
cmdline = {
enabled = true,
},
messages = {
enabled = true,
view_error = 'notify',
view_warn = 'notify',
view_history = 'messages',
view_search = 'virtualtext',
},
popupmenu = {
enabled = true,
},
},
}
}
+2 -2
View File
@@ -36,7 +36,7 @@ return {
color = true,
},
},
git_placement = 'after',
git_placement = 'signcolumn',
modified_placement = 'after',
diagnostics_placement = 'signcolumn',
padding = ' ',
@@ -101,4 +101,4 @@ return {
show_on_open_dirs = true,
},
},
}
}
+11 -129
View File
@@ -1,134 +1,52 @@
return {
'stevearc/oil.nvim',
---@module 'oil'
---@type oil.SetupOpts
dependencies = { 'nvim-tree/nvim-web-devicons' },
cmd = 'Oil',
opts = {
-- Oil will take over directory buffers (e.g. `vim .` or `:e src/`)
-- Set to false if you want some other plugin (e.g. netrw) to open when you edit directories.
default_file_explorer = true,
-- Id is automatically added at the beginning, and name at the end
default_file_explorer = false,
-- See :help oil-columns
columns = {
'icon',
-- "permissions",
-- "size",
-- "mtime",
},
-- Buffer-local options to use for oil buffers
buf_options = {
buflisted = false,
bufhidden = 'hide',
},
-- Window-local options to use for oil buffers
win_options = {
wrap = false,
signcolumn = 'no',
cursorcolumn = false,
signcolumn = 'yes',
cursorcolumn = true,
foldcolumn = '0',
spell = false,
list = false,
conceallevel = 3,
concealcursor = 'nvic',
},
-- Send deleted files to the trash instead of permanently deleting them (:help oil-trash)
delete_to_trash = false,
-- Skip the confirmation popup for simple operations (:help oil.skip_confirm_for_simple_edits)
skip_confirm_for_simple_edits = false,
-- Selecting a new/moved/renamed file or directory will prompt you to save changes first
-- (:help prompt_save_on_select_new_entry)
delete_to_trash = true,
skip_confirm_for_simple_edits = true,
prompt_save_on_select_new_entry = true,
-- Oil will automatically delete hidden buffers after this delay
-- You can set the delay to false to disable cleanup entirely
-- Note that the cleanup process only starts when none of the oil buffers are currently displayed
cleanup_delay_ms = 2000,
lsp_file_methods = {
-- Enable or disable LSP file operations
enabled = true,
-- Time to wait for LSP file operations to complete before skipping
timeout_ms = 1000,
-- Set to true to autosave buffers that are updated with LSP willRenameFiles
-- Set to "unmodified" to only save unmodified buffers
autosave_changes = false,
},
-- Constrain the cursor to the editable parts of the oil buffer
-- Set to `false` to disable, or "name" to keep it on the file names
constrain_cursor = 'editable',
-- Set to true to watch the filesystem for changes and reload oil
constrain_cursor = 'name',
watch_for_changes = false,
-- Keymaps in oil buffer. Can be any value that `vim.keymap.set` accepts OR a table of keymap
-- options with a `callback` (e.g. { callback = function() ... end, desc = "", mode = "n" })
-- Additionally, if it is a string that matches "actions.<name>",
-- it will use the mapping at require("oil.actions").<name>
-- Set to `false` to remove a keymap
-- See :help oil-actions for a list of all available actions
keymaps = {
['g?'] = 'actions.show_help',
['<CR>'] = 'actions.select',
['<C-s>'] = { 'actions.select', opts = { vertical = true }, desc = 'Open the entry in a vertical split' },
['<C-h>'] = { 'actions.select', opts = { horizontal = true }, desc = 'Open the entry in a horizontal split' },
['<C-t>'] = { 'actions.select', opts = { tab = true }, desc = 'Open the entry in new tab' },
['<C-p>'] = 'actions.preview',
['<C-c>'] = 'actions.close',
['<C-l>'] = 'actions.refresh',
['-'] = 'actions.parent',
['_'] = 'actions.open_cwd',
['`'] = 'actions.cd',
['~'] = { 'actions.cd', opts = { scope = 'tab' }, desc = ':tcd to the current oil directory', mode = 'n' },
['gs'] = 'actions.change_sort',
['gx'] = 'actions.open_external',
['g.'] = 'actions.toggle_hidden',
['g\\'] = 'actions.toggle_trash',
},
-- Set to false to disable all of the above keymaps
use_default_keymaps = true,
view_options = {
-- Show files and directories that start with "."
show_hidden = false,
-- This function defines what is considered a "hidden" file
show_hidden = true,
is_hidden_file = function(name, bufnr)
local m = name:match('^%.')
return m ~= nil
end,
-- This function defines what will never be shown, even when `show_hidden` is set
is_always_hidden = function(name, bufnr)
return false
end,
-- Sort file names with numbers in a more intuitive order for humans.
-- Can be "fast", true, or false. "fast" will turn it off for large directories.
natural_order = 'fast',
-- Sort file and directory names case insensitive
case_insensitive = false,
sort = {
-- sort order can be "asc" or "desc"
-- see :help oil-columns to see which columns are sortable
{ 'type', 'asc' },
{ 'name', 'asc' },
{ 'type', 'asc' },
},
-- Customize the highlight group for the file name
highlight_filename = function(entry, is_hidden, is_link_target, is_link_orphan)
return nil
end,
},
-- Extra arguments to pass to SCP when moving/copying files over SSH
extra_scp_args = {},
-- EXPERIMENTAL support for performing file operations with git
git = {
-- Return true to automatically git add/mv/rm files
add = function(path)
return false
end,
mv = function(src_path, dest_path)
return false
end,
rm = function(path)
return false
end,
},
-- Configuration for the floating window in oil.open_float
float = {
-- Padding around the floating window
padding = 2,
max_width = 100,
max_height = 50,
@@ -136,71 +54,35 @@ return {
win_options = {
winblend = 0,
},
-- optionally override the oil buffers window title with custom function: fun(winid: integer): string
get_win_title = nil,
-- preview_split: Split direction: "auto", "left", "right", "above", "below".
preview_split = 'auto',
-- This is the config that will be passed to nvim_open_win.
-- Change values here to customize the layout
override = function(conf)
return conf
end,
preview_split = 'right',
},
-- Configuration for the file preview window
preview_win = {
-- Whether the preview window is automatically updated when the cursor is moved
update_on_cursor_moved = true,
-- How to open the preview window "load"|"scratch"|"fast_scratch"
preview_method = 'fast_scratch',
-- A function that returns true to disable preview on a file e.g. to avoid lag
disable_preview = function(filename)
return false
end,
-- Window-local options to use for preview window buffers
win_options = {},
},
-- Configuration for the floating action confirmation window
confirmation = {
-- Width dimensions can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
-- min_width and max_width can be a single value or a list of mixed integer/float types.
-- max_width = {100, 0.8} means "the lesser of 100 columns or 80% of total"
max_width = 0.9,
-- min_width = {40, 0.4} means "the greater of 40 columns or 40% of total"
max_width = 0.7,
min_width = { 40, 0.4 },
-- optionally define an integer/float for the exact width of the preview window
width = nil,
-- Height dimensions can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
-- min_height and max_height can be a single value or a list of mixed integer/float types.
-- max_height = {80, 0.9} means "the lesser of 80 columns or 90% of total"
max_height = 0.9,
-- min_height = {5, 0.1} means "the greater of 5 columns or 10% of total"
min_height = { 5, 0.1 },
-- optionally define an integer/float for the exact height of the preview window
height = nil,
border = 'rounded',
win_options = {
winblend = 0,
},
},
-- Configuration for the floating progress window
progress = {
max_width = 0.9,
max_width = 0.6,
min_width = { 40, 0.4 },
width = nil,
max_height = { 10, 0.9 },
min_height = { 5, 0.1 },
height = nil,
border = 'rounded',
minimized_border = 'none',
win_options = {
winblend = 0,
},
},
-- Configuration for the floating SSH window
ssh = {
border = 'rounded',
},
-- Configuration for the floating keymaps help window
keymaps_help = {
border = 'rounded',
},
+58 -61
View File
@@ -1,13 +1,13 @@
return {
"hedyhli/outline.nvim",
'hedyhli/outline.nvim',
lazy = true,
cmd = { "Outline", "OutlineOpen" },
cmd = { 'Outline', 'OutlineOpen' },
keys = {
{ "<leader>o", "<cmd>Outline<CR>", desc = "Toggle outline" },
{ '<leader>o', '<cmd>Outline<CR>', desc = 'Toggle outline' },
},
opts = {
outline_window = {
position = "right",
position = 'right',
width = 25,
relative_width = true,
auto_close = false,
@@ -18,75 +18,72 @@ return {
hide_cursor = true,
focus_on_open = false,
},
outline_items = {
show_symbol_details = true,
show_symbol_lineno = false,
highlight_hovered_item = true,
auto_set_cursor = true,
auto_update_events = {
follow = { "CursorMoved" },
items = { "InsertLeave", "WinEnter", "BufEnter", "BufWinEnter", "TabEnter", "BufWritePost" },
follow = { 'CursorMoved' },
items = { 'InsertLeave', 'WinEnter', 'BufEnter', 'BufWinEnter', 'TabEnter', 'BufWritePost' },
},
},
keymaps = {
show_help = "?",
close = { "<Esc>", "q" },
goto_location = "<Cr>",
peek_location = "o",
goto_and_close = "<S-Cr>",
restore_location = "<C-g>",
hover_symbol = "<C-space>",
toggle_preview = "K",
rename_symbol = "r",
code_actions = "a",
fold = "h",
unfold = "l",
fold_toggle = "<Tab>",
fold_toggle_all = "<S-Tab>",
fold_all = "W",
unfold_all = "E",
fold_reset = "R",
down_and_jump = "<C-j>",
up_and_jump = "<C-k>",
show_help = '?',
close = { '<Esc>', 'q' },
goto_location = '<Cr>',
peek_location = 'o',
goto_and_close = '<S-Cr>',
restore_location = '<C-g>',
hover_symbol = '<C-space>',
toggle_preview = 'K',
rename_symbol = 'r',
code_actions = 'a',
fold = 'h',
unfold = 'l',
fold_toggle = '<Tab>',
fold_toggle_all = '<S-Tab>',
fold_all = 'W',
unfold_all = 'E',
fold_reset = 'R',
down_and_jump = '<C-j>',
up_and_jump = '<C-k>',
},
symbols = {
icons = {
File = { icon = "󰈔", hl = "Identifier" },
Module = { icon = "󰆧", hl = "Include" },
Namespace = { icon = "󰅪", hl = "Include" },
Package = { icon = "󰏗", hl = "Include" },
Class = { icon = "𝓒", hl = "Type" },
Method = { icon = "ƒ", hl = "Function" },
Property = { icon = "", hl = "Identifier" },
Field = { icon = "󰆨", hl = "Identifier" },
Constructor = { icon = "", hl = "Special" },
Enum = { icon = "", hl = "Type" },
Interface = { icon = "󰜰", hl = "Type" },
Function = { icon = "ƒ", hl = "Function" },
Variable = { icon = "", hl = "Constant" },
Constant = { icon = "", hl = "Constant" },
String = { icon = "𝓐", hl = "String" },
Number = { icon = "#", hl = "Number" },
Boolean = { icon = "", hl = "Boolean" },
Array = { icon = "󰅪", hl = "Constant" },
Object = { icon = "⦿", hl = "Type" },
Key = { icon = "🔐", hl = "Type" },
Null = { icon = "NULL", hl = "Type" },
EnumMember = { icon = "", hl = "Identifier" },
Struct = { icon = "𝓢", hl = "Structure" },
Event = { icon = "🗲", hl = "Type" },
Operator = { icon = "+", hl = "Identifier" },
TypeParameter = { icon = "𝙏", hl = "Identifier" },
Component = { icon = "󰅴", hl = "Function" },
Fragment = { icon = "󰅴", hl = "Constant" },
TypeAlias = { icon = "", hl = "Type" },
Parameter = { icon = "", hl = "Identifier" },
StaticMethod = { icon = "", hl = "Function" },
Macro = { icon = "", hl = "Function" },
File = { icon = '󰈔', hl = 'Identifier' },
Module = { icon = '󰆧', hl = 'Include' },
Namespace = { icon = '󰅪', hl = 'Include' },
Package = { icon = '󰏗', hl = 'Include' },
Class = { icon = '𝓒', hl = 'Type' },
Method = { icon = 'ƒ', hl = 'Function' },
Property = { icon = '', hl = 'Identifier' },
Field = { icon = '󰆨', hl = 'Identifier' },
Constructor = { icon = '', hl = 'Special' },
Enum = { icon = '', hl = 'Type' },
Interface = { icon = '󰜰', hl = 'Type' },
Function = { icon = 'ƒ', hl = 'Function' },
Variable = { icon = '', hl = 'Constant' },
Constant = { icon = '', hl = 'Constant' },
String = { icon = '𝓐', hl = 'String' },
Number = { icon = '#', hl = 'Number' },
Boolean = { icon = '', hl = 'Boolean' },
Array = { icon = '󰅪', hl = 'Constant' },
Object = { icon = '⦿', hl = 'Type' },
Key = { icon = '🔐', hl = 'Type' },
Null = { icon = 'NULL', hl = 'Type' },
EnumMember = { icon = '', hl = 'Identifier' },
Struct = { icon = '𝓢', hl = 'Structure' },
Event = { icon = '🗲', hl = 'Type' },
Operator = { icon = '+', hl = 'Identifier' },
TypeParameter = { icon = '𝙏', hl = 'Identifier' },
Component = { icon = '󰅴', hl = 'Function' },
Fragment = { icon = '󰅴', hl = 'Constant' },
TypeAlias = { icon = '', hl = 'Type' },
Parameter = { icon = '', hl = 'Identifier' },
StaticMethod = { icon = '', hl = 'Function' },
Macro = { icon = '', hl = 'Function' },
},
},
},
}
}
+33 -30
View File
@@ -1,32 +1,35 @@
return {
"stevearc/conform.nvim",
event = { "BufReadPre", "BufNewFile" },
config = function()
local conform = require "conform"
conform.setup {
formatters_by_ft = {
javascript = { "prettier" },
typescript = { "prettier" },
javascriptreact = { "prettier" },
typescriptreact = { "prettier" },
svelte = { "prettier" },
css = { "prettier" },
html = { "prettier" },
json = { "prettier" },
yaml = { "prettier" },
markdown = { "prettier" },
graphql = { "prettier" },
liquid = { "prettier" },
lua = { "stylua" },
python = { "sort", "black" },
},
format_on_save = {
lsp_fallback = true,
async = false,
timeout_ms = 1000,
},
}
end,
'stevearc/conform.nvim',
event = { 'BufReadPre', 'BufNewFile' },
opts = {
formatters_by_ft = {
sh = { 'shellharden', 'shfmt' },
bash = { 'shellharden', 'shfmt' },
zsh = { 'shellharden', 'shfmt' },
javascript = { 'prettier' },
typescript = { 'prettier' },
css = { 'prettier' },
html = { 'prettier' },
json = { 'prettier' },
yaml = { 'prettier' },
markdown = { 'markdownlint', 'prettier' },
graphql = { 'prettier' },
liquid = { 'prettier' },
lua = { 'stylua' },
python = { 'black', 'sort' },
},
formatters = {
--[[ shfmt = {
prepend_args = { '-i', '6' },
}, ]]
},
default_format_opts = {
lsp_format = 'fallback',
},
format_on_save = {
lsp_format = 'fallback',
async = false,
timeout_ms = 1000,
},
},
}
+19 -15
View File
@@ -1,21 +1,25 @@
return {
"hiphish/rainbow-delimiters.nvim",
event = { "BufReadPre", "BufNewFile" },
'hiphish/rainbow-delimiters.nvim',
event = { 'BufReadPre', 'BufNewFile' },
main = 'rainbow-delimiters.setup',
opts = {
strategy = {},
query = {},
highlight = {
"RainbowDelimiterCyan",
"RainbowDelimiterBlue",
"RainbowDelimiterGreen",
"RainbowDelimiterViolet",
"RainbowDelimiterYellow",
"RainbowDelimiterRed",
"RainbowDelimiterOrange",
'RainbowDelimiterCyan',
'RainbowDelimiterBlue',
'RainbowDelimiterGreen',
'RainbowDelimiterViolet',
'RainbowDelimiterYellow',
'RainbowDelimiterRed',
'RainbowDelimiterOrange',
},
query = {
[''] = 'rainbow-delimiters',
lua = 'rainbow-blocks',
help = 'rainbow-blocks',
query = function(bufnr)
local is_nofile = vim.bo[bufnr].buftype == 'nofile'
return is_nofile and 'rainbow-blocks' or 'rainbow-delimiters'
end,
},
},
config = function(_, opts)
require("rainbow-delimiters.setup").setup(opts)
end,
}
+9 -4
View File
@@ -1,5 +1,10 @@
return {
'gbprod/substitute.nvim',
event = { 'BufReadPre', 'BufNewFile' },
opts = {},
}
'gbprod/substitute.nvim',
event = { 'BufReadPre', 'BufNewFile' },
opts = {
highlight_substituted_text = {
enabled = true,
timer = 800,
},
},
}
@@ -1,18 +0,0 @@
return {
-- does the same thing as git_files, but for yadm
'pschmitt/telescope-yadm.nvim',
dependencies = {
'nvim-telescope/telescope.nvim',
},
enabled = true,
event = 'VeryLazy',
config = function(_, opts)
local telescope = require('telescope')
telescope.setup(opts)
telescope.load_extension('yadm_files')
telescope.load_extension('git_or_files')
telescope.load_extension('git_or_yadm_files')
end,
}
+10 -1
View File
@@ -3,9 +3,11 @@ return {
branch = '0.1.x',
dependencies = {
'nvim-lua/plenary.nvim',
{ 'nvim-telescope/telescope-fzf-native.nvim', build = 'make' },
'nvim-tree/nvim-web-devicons',
{ 'nvim-telescope/telescope-fzf-native.nvim', build = 'make' },
'folke/todo-comments.nvim',
'pschmitt/telescope-yadm.nvim',
{ 'nvim-telescope/telescope-media-files.nvim', dependencies = 'nvim-lua/popup.nvim' },
},
event = 'VeryLazy',
config = function()
@@ -51,9 +53,16 @@ return {
},
extensions = {
fzf = {},
media_files = {
find_cmd = 'rg',
},
},
})
telescope.load_extension('fzf')
telescope.load_extension('media_files')
telescope.load_extension('yadm_files')
telescope.load_extension('git_or_files')
telescope.load_extension('git_or_yadm_files')
end,
}
-4
View File
@@ -15,8 +15,4 @@ return {
return buftype == 'terminal' or floating
end,
},
config = function(_, opts)
require('tint').setup(opts)
end,
}
+12 -12
View File
@@ -1,17 +1,17 @@
return {
"christoomey/vim-tmux-navigator",
'christoomey/vim-tmux-navigator',
cmd = {
"TmuxNavigateLeft",
"TmuxNavigateDown",
"TmuxNavigateUp",
"TmuxNavigateRight",
"TmuxNavigatePrevious",
'TmuxNavigateLeft',
'TmuxNavigateDown',
'TmuxNavigateUp',
'TmuxNavigateRight',
'TmuxNavigatePrevious',
},
keys = {
{ "<c-h>", "<cmd><C-U>TmuxNavigateLeft<cr>" },
{ "<c-j>", "<cmd><C-U>TmuxNavigateDown<cr>" },
{ "<c-k>", "<cmd><C-U>TmuxNavigateUp<cr>" },
{ "<c-l>", "<cmd><C-U>TmuxNavigateRight<cr>" },
{ "<c-\\>", "<cmd><C-U>TmuxNavigatePrevious<cr>" },
{ '<c-h>', '<cmd><C-U>TmuxNavigateLeft<cr>' },
{ '<c-j>', '<cmd><C-U>TmuxNavigateDown<cr>' },
{ '<c-k>', '<cmd><C-U>TmuxNavigateUp<cr>' },
{ '<c-l>', '<cmd><C-U>TmuxNavigateRight<cr>' },
{ '<c-\\>', '<cmd><C-U>TmuxNavigatePrevious<cr>' },
},
}
}
+4 -7
View File
@@ -1,9 +1,6 @@
return {
"folke/todo-comments.nvim",
event = { "BufReadPre", "BufNewFile" },
dependencies = { "nvim-lua/plenary.nvim" },
config = function()
require("todo-comments").setup()
end,
'folke/todo-comments.nvim',
dependencies = { 'nvim-lua/plenary.nvim' },
event = { 'BufReadPre', 'BufNewFile' },
opts = {},
}
@@ -43,11 +43,11 @@ return {
incremental_selection = {
enable = true,
keymaps = {
init_selection = '<C-space>',
node_incremental = '<C-space>',
scope_incremental = false,
init_selection = 'gnn',
node_incremental = 'grn',
scope_incremental = 'grc',
node_decremental = '<bs>',
},
},
},
}
}
+14 -2
View File
@@ -2,10 +2,22 @@ return {
'folke/trouble.nvim',
dependencies = {
'nvim-tree/nvim-web-devicons',
'folke/todo-comments.nvim',
},
cmd = 'Trouble',
opts = {
focus = false,
warn_no_results = false,
open_no_results = true,
auto_close = false,
auto_open = false,
auto_preview = true,
auto_refresh = true,
auto_jump = false,
restore = true,
follow = true,
indent_guides = true,
max_items = 200,
multiline = true,
pinned = false,
},
}
}
+2 -2
View File
@@ -1,4 +1,4 @@
return {
'szw/vim-maximizer',
event = { 'BufReadPre', 'BufNewFile' },
'szw/vim-maximizer',
event = { 'BufReadPre', 'BufNewFile' },
}
+16 -2
View File
@@ -1,13 +1,18 @@
return {
'folke/which-key.nvim',
dependencies = {
'nvim-tree/nvim-web-devicons',
},
event = 'VeryLazy',
init = function()
vim.o.timeout = true
vim.o.timeoutlen = 500
vim.o.timeoutlen = 800
end,
opts = {
preset = 'modern', -- may set this back to 'classic'
sort = { 'local', 'order', 'group', 'alphanum', 'mod' },
sort = { 'local', 'order', 'group', 'case', 'alphanum', 'mod' },
expand = 2,
delay = 200,
notify = true,
win = {
title = true,
@@ -21,6 +26,15 @@ return {
enabled = true,
suggestions = 20,
},
presets = {
operators = true,
motions = true,
text_objects = true,
windows = true,
nav = true,
z = true,
g = true,
},
},
},
}