mirror of
https://github.com/mqttr/dotfiles.git
synced 2025-12-16 04:35:51 -06:00
Recreate neovim configuration
This commit is contained in:
@@ -1,16 +0,0 @@
|
||||
-- autopairs
|
||||
-- https://github.com/windwp/nvim-autopairs
|
||||
|
||||
return {
|
||||
'windwp/nvim-autopairs',
|
||||
event = 'InsertEnter',
|
||||
-- Optional dependency
|
||||
dependencies = { 'hrsh7th/nvim-cmp' },
|
||||
config = function()
|
||||
require('nvim-autopairs').setup {}
|
||||
-- If you want to automatically add `(` after selecting a function or method
|
||||
local cmp_autopairs = require 'nvim-autopairs.completion.cmp'
|
||||
local cmp = require 'cmp'
|
||||
cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done())
|
||||
end,
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
vim.g.barbar_auto_setup = false
|
||||
|
||||
return {
|
||||
{'romgrk/barbar.nvim',
|
||||
event = 'VimEnter',
|
||||
dependencies = {
|
||||
'lewis6991/gitsigns.nvim', -- OPTIONAL: for git status
|
||||
'nvim-tree/nvim-web-devicons', -- OPTIONAL: for file icons
|
||||
},
|
||||
init = function() vim.g.barbar_auto_setup = false end,
|
||||
opts = {
|
||||
-- lazy.nvim will automatically call setup for you. put your options here, anything missing will use the default:
|
||||
-- animation = true,
|
||||
insert_at_start = true,
|
||||
sidebar_filetypes = {
|
||||
-- Use the default values: {event = 'BufWinLeave', text = '', align = 'left'}
|
||||
NvimTree = true,
|
||||
-- Or, specify the text used for the offset:
|
||||
undotree = {
|
||||
text = 'undotree',
|
||||
align = 'center', -- *optionally* specify an alignment (either 'left', 'center', or 'right')
|
||||
},
|
||||
-- Or, specify the event which the sidebar executes when leaving:
|
||||
['neo-tree'] = {event = 'BufWipeout'},
|
||||
-- Or, specify all three
|
||||
Outline = {event = 'BufWinLeave', text = 'symbols-outline', align = 'right'},
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
{ 'L', '<cmd>BufferNext<CR>' },
|
||||
{ 'H', '<cmd>BufferPrevious<CR>' },
|
||||
{ 'Q', '<cmd>BufferClose<CR>' },
|
||||
{ 'T', '<cmd>BufferRestore<CR>' }
|
||||
},
|
||||
version = '^1.0.0', -- optional: only update when a new 1.x version is released
|
||||
},
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
return {
|
||||
'saghen/blink.cmp',
|
||||
lazy = false, -- lazy loading handled internally
|
||||
-- optional: provides snippets for the snippet source
|
||||
dependencies = 'rafamadriz/friendly-snippets',
|
||||
-- use a release tag to download pre-built binaries
|
||||
version = 'v0.*',
|
||||
-- OR build from source, requires nightly: https://rust-lang.github.io/rustup/concepts/channels.html#working-with-nightly-rust
|
||||
-- build = 'cargo build --release',
|
||||
opts = {
|
||||
keymap = { preset = 'super-tab' },
|
||||
|
||||
completion = {
|
||||
menu = {
|
||||
-- min_width = 30,
|
||||
-- max_width = 50,
|
||||
-- max_height = 20,
|
||||
border = 'rounded', -- Rounded corners for a fancy look
|
||||
winblend = 10, -- Slight transparency for a modern look
|
||||
winhighlight = 'Normal:BlinkCmpMenu,FloatBorder:BlinkCmpMenuBorder,CursorLine:BlinkCmpMenuSelection,Search:None',
|
||||
scrolloff = 2,
|
||||
},
|
||||
|
||||
documentation = {
|
||||
auto_show = true,
|
||||
window = {
|
||||
border = 'rounded',
|
||||
winblend = 10,
|
||||
winhighlight = 'Normal:BlinkCmpDoc,FloatBorder:BlinkCmpDocBorder,CursorLine:BlinkCmpDocCursorLine,Search:None',
|
||||
},
|
||||
},
|
||||
ghost_text = { enabled = true },
|
||||
accept = { auto_brackets = { enabled = true } },
|
||||
-- signature = {
|
||||
-- enabled = true,
|
||||
-- }
|
||||
},
|
||||
},
|
||||
-- set to 'mono' for 'Nerd Font Mono' or 'normal' for 'Nerd Font'
|
||||
-- adjusts spacing to ensure icons are aligned
|
||||
appearance = {
|
||||
use_nvim_cmp_as_default = true,
|
||||
nerd_font_variant = 'mono',
|
||||
},
|
||||
}
|
||||
3
nvim/lua/plugins/cmd.lua
Normal file
3
nvim/lua/plugins/cmd.lua
Normal file
@@ -0,0 +1,3 @@
|
||||
return {
|
||||
"gelguy/wilder.nvim"
|
||||
}
|
||||
@@ -1,19 +1,33 @@
|
||||
-- return {
|
||||
-- "lukas-reineke/indent-blankline.nvim",
|
||||
-- main = "ibl",
|
||||
-- opts = function(_, opts)
|
||||
-- -- Other blankline configuration here
|
||||
-- return require("indent-rainbowline").make_opts(opts)
|
||||
-- end,
|
||||
-- dependencies = {
|
||||
-- "TheGLander/indent-rainbowline.nvim",
|
||||
-- },
|
||||
-- }
|
||||
|
||||
return {
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
main = "ibl",
|
||||
---@module "ibl"
|
||||
---@type ibl.config
|
||||
opts = {},
|
||||
config = function()
|
||||
|
||||
local highlight = {
|
||||
"RainbowRed",
|
||||
"RainbowYellow",
|
||||
"RainbowBlue",
|
||||
"RainbowOrange",
|
||||
"RainbowGreen",
|
||||
"RainbowViolet",
|
||||
"RainbowCyan",
|
||||
}
|
||||
local hooks = require "ibl.hooks"
|
||||
-- create the highlight groups in the highlight setup hook, so they are reset
|
||||
-- every time the colorscheme changes
|
||||
hooks.register(hooks.type.HIGHLIGHT_SETUP, function()
|
||||
vim.api.nvim_set_hl(0, "RainbowRed", { fg = "#E06C75" })
|
||||
vim.api.nvim_set_hl(0, "RainbowYellow", { fg = "#E5C07B" })
|
||||
vim.api.nvim_set_hl(0, "RainbowBlue", { fg = "#61AFEF" })
|
||||
vim.api.nvim_set_hl(0, "RainbowOrange", { fg = "#D19A66" })
|
||||
vim.api.nvim_set_hl(0, "RainbowGreen", { fg = "#98C379" })
|
||||
vim.api.nvim_set_hl(0, "RainbowViolet", { fg = "#C678DD" })
|
||||
vim.api.nvim_set_hl(0, "RainbowCyan", { fg = "#56B6C2" })
|
||||
end )
|
||||
|
||||
require("ibl").setup { indent = { highlight = highlight } }
|
||||
end
|
||||
}
|
||||
|
||||
@@ -1,103 +0,0 @@
|
||||
-- debug.lua
|
||||
--
|
||||
-- Shows how to use the DAP plugin to debug your code.
|
||||
--
|
||||
-- Primarily focused on configuring the debugger for Go, but can
|
||||
-- be extended to other languages as well. That's why it's called
|
||||
-- kickstart.nvim and not kitchen-sink.nvim ;)
|
||||
|
||||
return {
|
||||
'mfussenegger/nvim-dap',
|
||||
dependencies = {
|
||||
-- Creates a beautiful debugger UI
|
||||
'rcarriga/nvim-dap-ui',
|
||||
|
||||
-- Required dependency for nvim-dap-ui
|
||||
'nvim-neotest/nvim-nio',
|
||||
|
||||
-- Installs the debug adapters for you
|
||||
'williamboman/mason.nvim',
|
||||
'jay-babu/mason-nvim-dap.nvim',
|
||||
|
||||
-- Add your own debuggers here
|
||||
'leoluz/nvim-dap-go',
|
||||
},
|
||||
keys = function(_, keys)
|
||||
local dap = require 'dap'
|
||||
local dapui = require 'dapui'
|
||||
return {
|
||||
-- Basic debugging keymaps, feel free to change to your liking!
|
||||
{ '<F5>', dap.continue, desc = 'Debug: Start/Continue' },
|
||||
{ '<F1>', dap.step_into, desc = 'Debug: Step Into' },
|
||||
{ '<F2>', dap.step_over, desc = 'Debug: Step Over' },
|
||||
{ '<F3>', dap.step_out, desc = 'Debug: Step Out' },
|
||||
{ '<leader>b', dap.toggle_breakpoint, desc = 'Debug: Toggle Breakpoint' },
|
||||
{
|
||||
'<leader>B',
|
||||
function()
|
||||
dap.set_breakpoint(vim.fn.input 'Breakpoint condition: ')
|
||||
end,
|
||||
desc = 'Debug: Set Breakpoint',
|
||||
},
|
||||
-- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception.
|
||||
{ '<F7>', dapui.toggle, desc = 'Debug: See last session result.' },
|
||||
unpack(keys),
|
||||
}
|
||||
end,
|
||||
config = function()
|
||||
local dap = require 'dap'
|
||||
local dapui = require 'dapui'
|
||||
|
||||
require('mason-nvim-dap').setup {
|
||||
-- Makes a best effort to setup the various debuggers with
|
||||
-- reasonable debug configurations
|
||||
automatic_installation = true,
|
||||
|
||||
-- You can provide additional configuration to the handlers,
|
||||
-- see mason-nvim-dap README for more information
|
||||
handlers = {},
|
||||
|
||||
-- You'll need to check that you have the required things installed
|
||||
-- online, please don't ask me how to install them :)
|
||||
ensure_installed = {
|
||||
-- Update this to ensure that you have the debuggers for the langs you want
|
||||
'delve',
|
||||
},
|
||||
}
|
||||
|
||||
-- Dap UI setup
|
||||
-- For more information, see |:help nvim-dap-ui|
|
||||
dapui.setup {
|
||||
-- Set icons to characters that are more likely to work in every terminal.
|
||||
-- Feel free to remove or use ones that you like more! :)
|
||||
-- Don't feel like these are good choices.
|
||||
icons = { expanded = '▾', collapsed = '▸', current_frame = '*' },
|
||||
controls = {
|
||||
icons = {
|
||||
pause = '⏸',
|
||||
play = '▶',
|
||||
step_into = '⏎',
|
||||
step_over = '⏭',
|
||||
step_out = '⏮',
|
||||
step_back = 'b',
|
||||
run_last = '▶▶',
|
||||
terminate = '⏹',
|
||||
disconnect = '⏏',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
dap.listeners.after.event_initialized['dapui_config'] = dapui.open
|
||||
dap.listeners.before.event_terminated['dapui_config'] = dapui.close
|
||||
dap.listeners.before.event_exited['dapui_config'] = dapui.close
|
||||
|
||||
-- Install golang specific config
|
||||
require('dap-go').setup {
|
||||
delve = {
|
||||
-- On Windows delve must be run attached or it crashes.
|
||||
-- See https://github.com/leoluz/nvim-dap-go/blob/main/README.md#configuring
|
||||
detached = vim.fn.has 'win32' == 0,
|
||||
},
|
||||
}
|
||||
end,
|
||||
}
|
||||
@@ -1,61 +1,12 @@
|
||||
-- Adds git related signs to the gutter, as well as utilities for managing changes
|
||||
-- NOTE: gitsigns is already included in init.lua but contains only the base
|
||||
-- config. This will add also the recommended keymaps.
|
||||
|
||||
return {
|
||||
{
|
||||
'lewis6991/gitsigns.nvim',
|
||||
opts = {
|
||||
on_attach = function(bufnr)
|
||||
local gitsigns = 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', ']c', function()
|
||||
if vim.wo.diff then
|
||||
vim.cmd.normal { ']c', bang = true }
|
||||
else
|
||||
gitsigns.nav_hunk 'next'
|
||||
end
|
||||
end, { desc = 'Jump to next git [c]hange' })
|
||||
|
||||
map('n', '[c', function()
|
||||
if vim.wo.diff then
|
||||
vim.cmd.normal { '[c', bang = true }
|
||||
else
|
||||
gitsigns.nav_hunk 'prev'
|
||||
end
|
||||
end, { desc = 'Jump to previous git [c]hange' })
|
||||
|
||||
-- Actions
|
||||
-- visual mode
|
||||
map('v', '<leader>hs', function()
|
||||
gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' }
|
||||
end, { desc = 'stage git hunk' })
|
||||
map('v', '<leader>hr', function()
|
||||
gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' }
|
||||
end, { desc = 'reset git hunk' })
|
||||
-- normal mode
|
||||
map('n', '<leader>hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' })
|
||||
map('n', '<leader>hr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' })
|
||||
map('n', '<leader>hS', gitsigns.stage_buffer, { desc = 'git [S]tage buffer' })
|
||||
map('n', '<leader>hu', gitsigns.undo_stage_hunk, { desc = 'git [u]ndo stage hunk' })
|
||||
map('n', '<leader>hR', gitsigns.reset_buffer, { desc = 'git [R]eset buffer' })
|
||||
map('n', '<leader>hp', gitsigns.preview_hunk, { desc = 'git [p]review hunk' })
|
||||
map('n', '<leader>hb', gitsigns.blame_line, { desc = 'git [b]lame line' })
|
||||
map('n', '<leader>hd', gitsigns.diffthis, { desc = 'git [d]iff against index' })
|
||||
map('n', '<leader>hD', function()
|
||||
gitsigns.diffthis '@'
|
||||
end, { desc = 'git [D]iff against last commit' })
|
||||
-- Toggles
|
||||
map('n', '<leader>tb', gitsigns.toggle_current_line_blame, { desc = '[T]oggle git show [b]lame line' })
|
||||
map('n', '<leader>tD', gitsigns.toggle_deleted, { desc = '[T]oggle git show [D]eleted' })
|
||||
end,
|
||||
'lewis6991/gitsigns.nvim',
|
||||
opts = {
|
||||
signs = {
|
||||
add = { text = '+' },
|
||||
change = { text = '~' },
|
||||
delete = { text = '_' },
|
||||
topdelete = { text = '‾' },
|
||||
changedelete = { text = '~' },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -1,108 +1,90 @@
|
||||
local servers = {
|
||||
"rust_analyzer",
|
||||
"clangd",
|
||||
"basedpyright",
|
||||
"lua_ls",
|
||||
'bashls',
|
||||
'yamlls',
|
||||
'gopls',
|
||||
'html',
|
||||
'cssls',
|
||||
}
|
||||
|
||||
return {
|
||||
"b0o/schemastore.nvim",
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
ensure_installed = servers
|
||||
},
|
||||
-- {
|
||||
-- "williamboman/mason-lspconfig.nvim",
|
||||
-- config = function ()
|
||||
-- require('mason-lspconfig').setup({
|
||||
-- ensure_installed = servers
|
||||
-- })
|
||||
--
|
||||
-- for _, lsp in pairs(servers) do
|
||||
-- require('lspconfig')[lsp].setup {
|
||||
-- on_attach = on_attach,
|
||||
-- capabilities = capabilities
|
||||
-- }
|
||||
-- end
|
||||
-- end,
|
||||
--
|
||||
-- automatic_installation = true,
|
||||
-- },
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = {
|
||||
{ 'williamboman/mason.nvim', config = true },
|
||||
'williamboman/mason-lspconfig.nvim',
|
||||
'saghen/blink.cmp',
|
||||
{
|
||||
'saghen/blink.cmp',
|
||||
-- optional: provides snippets for the snippet source
|
||||
dependencies = { 'rafamadriz/friendly-snippets' },
|
||||
|
||||
-- use a release tag to download pre-built binaries
|
||||
version = '1.*',
|
||||
-- build = 'cargo build --release',
|
||||
-- If you use nix, you can build from source using latest nightly rust with:
|
||||
-- build = 'nix run .#build-plugin',
|
||||
|
||||
---@module 'blink.cmp'
|
||||
---@type blink.cmp.Config
|
||||
opts = {
|
||||
-- All presets have the following mappings:
|
||||
-- C-space: Open menu or open docs if already open
|
||||
-- C-n/C-p or Up/Down: Select next/previous item
|
||||
-- C-e: Hide menu
|
||||
-- C-k: Toggle signature help (if signature.enabled = true)
|
||||
--
|
||||
-- See :h blink-cmp-config-keymap for defining your own keymap
|
||||
keymap = { preset = 'super-tab' },
|
||||
|
||||
appearance = {
|
||||
nerd_font_variant = 'mono'
|
||||
},
|
||||
|
||||
completion = {
|
||||
menu = {
|
||||
-- min_width = 30,
|
||||
-- max_width = 50,
|
||||
-- max_height = 20,
|
||||
border = 'rounded', -- Rounded corners for a fancy look
|
||||
winblend = 10, -- Slight transparency for a modern look
|
||||
winhighlight = 'Normal:BlinkCmpMenu,FloatBorder:BlinkCmpMenuBorder,CursorLine:BlinkCmpMenuSelection,Search:None',
|
||||
scrolloff = 2,
|
||||
},
|
||||
opts = {
|
||||
servers = {
|
||||
rust_analyzer = {},
|
||||
clangd = {},
|
||||
basedpyright = {},
|
||||
lua_ls = {},
|
||||
bashls = {},
|
||||
yamlls = {},
|
||||
gopls = {
|
||||
cmd = {"gopls"},
|
||||
filetypes = {"go", "gomod", "gowork", "gotmpl"},
|
||||
},
|
||||
html = {},
|
||||
cssls = {},
|
||||
},
|
||||
|
||||
documentation = {
|
||||
auto_show = true,
|
||||
window = {
|
||||
border = 'rounded',
|
||||
winblend = 10,
|
||||
winhighlight = 'Normal:BlinkCmpDoc,FloatBorder:BlinkCmpDocBorder,CursorLine:BlinkCmpDocCursorLine,Search:None',
|
||||
},
|
||||
},
|
||||
config = function (_, opts)
|
||||
local lspconfig = require('lspconfig')
|
||||
for server, config in pairs(opts.servers) do
|
||||
-- passing config.capabilities to blink.cmp merges with the capabilities in your
|
||||
-- `opts[server].capabilities, if you've defined it
|
||||
config.capabilities = require('blink.cmp').get_lsp_capabilities(config.capabilities)
|
||||
lspconfig[server].setup(config)
|
||||
end
|
||||
end,
|
||||
ghost_text = { enabled = true },
|
||||
accept = { auto_brackets = { enabled = true } },
|
||||
-- signature = {
|
||||
-- enabled = true,
|
||||
-- }
|
||||
},
|
||||
|
||||
sources = {
|
||||
default = { 'lsp', 'path', 'snippets', 'buffer' },
|
||||
},
|
||||
|
||||
fuzzy = { implementation = "prefer_rust_with_warning" }
|
||||
},
|
||||
{
|
||||
'nvimdev/lspsaga.nvim',
|
||||
config = function()
|
||||
require('lspsaga').setup({
|
||||
diagnostic = {
|
||||
keys = {
|
||||
quit = { 'q', '<ESC>' }
|
||||
}
|
||||
},
|
||||
rename = {
|
||||
keys = {
|
||||
quit = {'<ESC>'}
|
||||
}
|
||||
},
|
||||
finder = {
|
||||
keys = {
|
||||
quit = '<ESC>',
|
||||
close = '<ESC>',
|
||||
toggle_or_open = '<CR>'
|
||||
}
|
||||
},
|
||||
outline = {
|
||||
close_after_jump = true,
|
||||
keys = {
|
||||
quit = { 'q', '<ESC>' },
|
||||
jump = { 'e', '<CR>' },
|
||||
toggle_or_jump = { 'o', '<TAB>' }
|
||||
}
|
||||
},
|
||||
lightbulb = {
|
||||
enable = false
|
||||
}
|
||||
})
|
||||
end,
|
||||
dependencies = {
|
||||
'nvim-treesitter/nvim-treesitter', -- optional
|
||||
'nvim-tree/nvim-web-devicons', -- optional
|
||||
}
|
||||
}
|
||||
opts_extend = { "sources.default" }
|
||||
},
|
||||
{
|
||||
'neovim/nvim-lspconfig',
|
||||
dependencies = {
|
||||
{ 'williamboman/mason.nvim', config = true },
|
||||
'williamboman/mason-lspconfig.nvim',
|
||||
},
|
||||
|
||||
opts = {
|
||||
servers = {
|
||||
lua_ls = {},
|
||||
clangd = {},
|
||||
rust_analyzer = {},
|
||||
yamlls = {},
|
||||
gopls = {},
|
||||
html = {}
|
||||
}
|
||||
},
|
||||
config = function(_, opts)
|
||||
local lspconfig = require('lspconfig')
|
||||
for server, config in pairs(opts.servers) do
|
||||
-- passing config.capabilities to blink.cmp merges with the capabilities in your
|
||||
-- `opts[server].capabilities, if you've defined it
|
||||
config.capabilities = require('blink.cmp').get_lsp_capabilities(config.capabilities)
|
||||
lspconfig[server].setup(config)
|
||||
end
|
||||
end
|
||||
},
|
||||
}
|
||||
|
||||
23
nvim/lua/plugins/markview.lua
Normal file
23
nvim/lua/plugins/markview.lua
Normal file
@@ -0,0 +1,23 @@
|
||||
return {
|
||||
{ -- Highlight, edit, and navigate code
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
build = ':TSInstall markdown markdown_inline html latex typst yaml',
|
||||
branch = 'master',
|
||||
lazy = false,
|
||||
},
|
||||
{
|
||||
"OXY2DEV/markview.nvim",
|
||||
lazy = false,
|
||||
|
||||
-- For `nvim-treesitter` users.
|
||||
priority = 49,
|
||||
|
||||
-- For blink.cmp's completion
|
||||
-- source
|
||||
dependencies = {
|
||||
"saghen/blink.cmp",
|
||||
"echasnovski/mini.icons",
|
||||
"nvim-tree/nvim-web-devicons"
|
||||
}
|
||||
}
|
||||
};
|
||||
34
nvim/lua/plugins/mini.lua
Normal file
34
nvim/lua/plugins/mini.lua
Normal file
@@ -0,0 +1,34 @@
|
||||
return { -- Collection of various small independent plugins/modules
|
||||
'echasnovski/mini.nvim',
|
||||
config = function()
|
||||
-- Better Around/Inside textobjects
|
||||
--
|
||||
-- Examples:
|
||||
-- - va) - [V]isually select [A]round [)]paren
|
||||
-- - yinq - [Y]ank [I]nside [N]ext [Q]uote
|
||||
-- - ci' - [C]hange [I]nside [']quote
|
||||
require('mini.ai').setup { n_lines = 500 }
|
||||
|
||||
-- Add/delete/replace surroundings (brackets, quotes, etc.)
|
||||
-- - saiw) - [S]urround [A]dd [I]nner [W]ord [)]Paren
|
||||
-- - sd' - [S]urround [D]elete [']quotes
|
||||
-- - sr)' - [S]urround [R]eplace [)] [']
|
||||
require('mini.surround').setup()
|
||||
|
||||
-- Simple and easy statusline.
|
||||
-- You could remove this setup call if you don't like it,
|
||||
-- and try some other statusline plugin
|
||||
local statusline = require 'mini.statusline'
|
||||
-- set use_icons to true if you have a Nerd Font
|
||||
statusline.setup { use_icons = vim.g.have_nerd_font }
|
||||
|
||||
-- You can configure sections in the statusline by overriding their
|
||||
-- default behavior. For example, here we set the section for
|
||||
-- cursor location to LINE:COLUMN
|
||||
---@diagnostic disable-next-line: duplicate-set-field
|
||||
statusline.section_location = function()
|
||||
return '%2l:%-2v'
|
||||
end
|
||||
-- https://github.com/echasnovski/mini.nvim
|
||||
end,
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
-- Neo-tree is a Neovim plugin to browse the file system
|
||||
-- https://github.com/nvim-neo-tree/neo-tree.nvim
|
||||
|
||||
-- Disable netrw for neo-tree
|
||||
vim.g.loaded_netrw = 1
|
||||
vim.g.loaded_netrwPlugin = 1
|
||||
|
||||
return {
|
||||
'nvim-neo-tree/neo-tree.nvim',
|
||||
version = '*',
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended
|
||||
'MunifTanjim/nui.nvim',
|
||||
},
|
||||
cmd = 'Neotree',
|
||||
keys = {
|
||||
{ '<leader>e', ':Neotree reveal action=focus toggle=true<CR>', silent=true }
|
||||
},
|
||||
init = function()
|
||||
if vim.fn.argc(-1) == 1 then
|
||||
local stat = vim.loop.fs_stat(vim.fn.argv(0))
|
||||
if stat and stat.type == "directory" then
|
||||
require("neo-tree")
|
||||
end
|
||||
end
|
||||
end,
|
||||
opts = {
|
||||
filesystem = {
|
||||
filtered_items = {
|
||||
hide_dotfiles = false,
|
||||
hide_gitignored = false,
|
||||
hide_by_name = {
|
||||
'.git',
|
||||
}
|
||||
},
|
||||
never_show = {},
|
||||
window = {
|
||||
mappings = {
|
||||
['\\'] = 'close_window',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
42
nvim/lua/plugins/neotree.lua
Normal file
42
nvim/lua/plugins/neotree.lua
Normal file
@@ -0,0 +1,42 @@
|
||||
|
||||
vim.g.loaded_netrw = 1
|
||||
vim.g.loaded_netrwPlugin = 1
|
||||
|
||||
return {
|
||||
'nvim-neo-tree/neo-tree.nvim',
|
||||
version = '*',
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended
|
||||
'MunifTanjim/nui.nvim',
|
||||
},
|
||||
cmd = 'Neotree',
|
||||
keys = {
|
||||
{ '<leader>e', ':Neotree reveal action=focus toggle=true<CR>', silent=true }
|
||||
},
|
||||
init = function()
|
||||
if vim.fn.argc(-1) == 1 then
|
||||
local stat = vim.loop.fs_stat(vim.fn.argv(0))
|
||||
if stat and stat.type == "directory" then
|
||||
require("neo-tree")
|
||||
end
|
||||
end
|
||||
end,
|
||||
opts = {
|
||||
filesystem = {
|
||||
filtered_items = {
|
||||
hide_dotfiles = false,
|
||||
hide_gitignored = false,
|
||||
hide_by_name = {
|
||||
'.git',
|
||||
}
|
||||
},
|
||||
never_show = {},
|
||||
window = {
|
||||
mappings = {
|
||||
['\\'] = 'close_window',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
7
nvim/lua/plugins/notify.lua
Normal file
7
nvim/lua/plugins/notify.lua
Normal file
@@ -0,0 +1,7 @@
|
||||
return {
|
||||
'rcarriga/nvim-notify',
|
||||
config = function(_, opts)
|
||||
vim.notify = require("notify")
|
||||
vim.opt.termguicolors = true
|
||||
end,
|
||||
}
|
||||
@@ -1,114 +0,0 @@
|
||||
return { -- Autocompletion
|
||||
'hrsh7th/nvim-cmp',
|
||||
enabled = false,
|
||||
event = 'InsertEnter',
|
||||
dependencies = {
|
||||
-- Snippet Engine & its associated nvim-cmp source
|
||||
{
|
||||
'L3MON4D3/LuaSnip',
|
||||
build = (function()
|
||||
-- Build Step is needed for regex support in snippets.
|
||||
-- This step is not supported in many windows environments.
|
||||
-- Remove the below condition to re-enable on windows.
|
||||
if vim.fn.has 'win32' == 1 or vim.fn.executable 'make' == 0 then
|
||||
return
|
||||
end
|
||||
return 'make install_jsregexp'
|
||||
end)(),
|
||||
dependencies = {
|
||||
-- `friendly-snippets` contains a variety of premade snippets.
|
||||
-- See the README about individual language/framework/plugin snippets:
|
||||
-- https://github.com/rafamadriz/friendly-snippets
|
||||
-- {
|
||||
-- 'rafamadriz/friendly-snippets',
|
||||
-- config = function()
|
||||
-- require('luasnip.loaders.from_vscode').lazy_load()
|
||||
-- end,
|
||||
-- },
|
||||
},
|
||||
},
|
||||
'saadparwaiz1/cmp_luasnip',
|
||||
|
||||
-- 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-path',
|
||||
},
|
||||
|
||||
config = function()
|
||||
-- See `:help cmp`
|
||||
local cmp = require 'cmp'
|
||||
local luasnip = require 'luasnip'
|
||||
luasnip.config.setup {}
|
||||
cmp.setup {
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
window = {
|
||||
completion = cmp.config.window.bordered(),
|
||||
documentation = cmp.config.window.bordered({
|
||||
winhighlight = "Normal:Pmenu,FloatBorder:Pmenu,CursorLine:PmenuSel,Search:None",
|
||||
}),
|
||||
},
|
||||
},
|
||||
completion = { completeopt = 'menu,menuone,noinsert' },
|
||||
|
||||
-- For an understanding of why these mappings were
|
||||
-- chosen, you will need to read `:help ins-completion`
|
||||
--
|
||||
-- No, but seriously. Please read `:help ins-completion`, it is really good!
|
||||
mapping = cmp.mapping.preset.insert {
|
||||
-- Select the [n]ext item
|
||||
['<C-n>'] = cmp.mapping.select_next_item(),
|
||||
-- Select the [p]revious item
|
||||
['<C-p>'] = cmp.mapping.select_prev_item(),
|
||||
|
||||
-- Scroll the documentation window [b]ack / [f]orward
|
||||
-- ['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
||||
-- ['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
|
||||
-- Accept ([y]es) the completion.
|
||||
-- This will auto-import if your LSP supports it.
|
||||
-- This will expand snippets if the LSP sent a snippet.
|
||||
['<C-y>'] = cmp.mapping.confirm { select = true },
|
||||
|
||||
['<C-CR>'] = cmp.mapping.confirm { select = true },
|
||||
['<Tab>'] = cmp.mapping.select_next_item(),
|
||||
['<S-Tab>'] = cmp.mapping.select_prev_item(),
|
||||
|
||||
-- Manually trigger a completion from nvim-cmp.
|
||||
-- Generally you don't need this, because nvim-cmp will display
|
||||
-- completions whenever it has completion options available.
|
||||
['<S-Space>'] = cmp.mapping.complete {},
|
||||
|
||||
-- <c-l> will move you to the right of each of the expansion locations.
|
||||
-- <c-h> is similar, except moving you backwards.
|
||||
-- ['<L>'] = cmp.mapping(function()
|
||||
-- if luasnip.expand_or_locally_jumpable() then
|
||||
-- luasnip.expand_or_jump()
|
||||
-- end
|
||||
-- end, { 'i', 's' }),
|
||||
-- ['<H>'] = cmp.mapping(function()
|
||||
-- if luasnip.locally_jumpable(-1) then
|
||||
-- luasnip.jump(-1)
|
||||
-- end
|
||||
-- end, { 'i', 's' }),
|
||||
|
||||
-- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see:
|
||||
-- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps
|
||||
},
|
||||
sources = {
|
||||
{
|
||||
name = 'lazydev',
|
||||
-- set group index to 0 to skip loading LuaLS completions as lazydev recommends it
|
||||
group_index = 0,
|
||||
},
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'luasnip' },
|
||||
{ name = 'path' },
|
||||
},
|
||||
}
|
||||
end,
|
||||
}
|
||||
39
nvim/lua/plugins/tabline.lua
Normal file
39
nvim/lua/plugins/tabline.lua
Normal file
@@ -0,0 +1,39 @@
|
||||
local map = vim.api.nvim_set_keymap
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
||||
-- Move to previous/next
|
||||
map('n', 'H', '<Cmd>BufferPrevious<CR>', opts)
|
||||
map('n', 'L', '<Cmd>BufferNext<CR>', opts)
|
||||
map('n', 'Q', '<cmd>BufferClose<CR>', opts)
|
||||
map('n', 'T', '<cmd>BufferRestore<CR>', opts)
|
||||
|
||||
return {
|
||||
'romgrk/barbar.nvim',
|
||||
dependencies = {
|
||||
'lewis6991/gitsigns.nvim', -- OPTIONAL: for git status
|
||||
'nvim-tree/nvim-web-devicons', -- OPTIONAL: for file icons
|
||||
},
|
||||
init = function() vim.g.barbar_auto_setup = false end,
|
||||
opts = {
|
||||
sidebar_filetypes = {
|
||||
-- Use the default values: {event = 'BufWinLeave', text = '', align = 'left'}
|
||||
NvimTree = true,
|
||||
-- Or, specify the text used for the offset:
|
||||
undotree = {
|
||||
text = 'undotree',
|
||||
align = 'center', -- *optionally* specify an alignment (either 'left', 'center', or 'right')
|
||||
},
|
||||
-- Or, specify the event which the sidebar executes when leaving:
|
||||
['neo-tree'] = {event = 'BufWipeout'},
|
||||
-- Or, specify all three
|
||||
Outline = {event = 'BufWinLeave', text = 'symbols-outline', align = 'right'},
|
||||
},
|
||||
keys = {
|
||||
{ 'L', '<cmd>BufferNext<CR>' },
|
||||
{ 'H', '<cmd>BufferPrevious<CR>' },
|
||||
{ 'Q', '<cmd>BufferClose<CR>' },
|
||||
{ 'T', '<cmd>BufferRestore<CR>' }
|
||||
}
|
||||
},
|
||||
version = '^1.0.0'
|
||||
}
|
||||
96
nvim/lua/plugins/telescope.lua
Normal file
96
nvim/lua/plugins/telescope.lua
Normal file
@@ -0,0 +1,96 @@
|
||||
return { -- Fuzzy Finder (files, lsp, etc)
|
||||
'nvim-telescope/telescope.nvim',
|
||||
event = 'VimEnter',
|
||||
branch = '0.1.x',
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
"debugloop/telescope-undo.nvim",
|
||||
{
|
||||
'nvim-telescope/telescope-fzf-native.nvim',
|
||||
build = 'make',
|
||||
cond = function()
|
||||
return vim.fn.executable 'make' == 1
|
||||
end,
|
||||
},
|
||||
{ 'nvim-telescope/telescope-ui-select.nvim' },
|
||||
{ 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font },
|
||||
},
|
||||
config = function(_, opts)
|
||||
local actions = require('telescope.actions')
|
||||
require('telescope').setup({
|
||||
defaults = {
|
||||
mappings = {
|
||||
i = {
|
||||
-- ['<c-enter>'] = 'to_fuzzy_refine'
|
||||
['<esc>'] = actions.close
|
||||
},
|
||||
},
|
||||
find_command = { 'rg', '--files', '--follow' }, -- or 'fd' with '--follow' if you use fd as the search tool
|
||||
},
|
||||
-- pickers = {}
|
||||
extensions = {
|
||||
['ui-select'] = {
|
||||
require('telescope.themes').get_dropdown(),
|
||||
},
|
||||
undo = {
|
||||
side_by_side = true,
|
||||
layout_strategy = "vertical",
|
||||
layout_config = {
|
||||
preview_height = 0.8,
|
||||
},
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
-- Enable Telescope extensions if they are installed
|
||||
pcall(require('telescope').load_extension, 'fzf')
|
||||
pcall(require('telescope').load_extension, 'ui-select')
|
||||
pcall(require('telescope').load_extension, 'undo')
|
||||
|
||||
vim.keymap.set("n", "<leader>u", "<cmd>Telescope undo<cr>")
|
||||
|
||||
local builtin = require 'telescope.builtin'
|
||||
vim.keymap.set('n', '<leader>fh', builtin.help_tags, { desc = '[F]ind [H]elp' })
|
||||
vim.keymap.set('n', '<leader>fk', builtin.keymaps, { desc = '[F]ind [K]eymaps' })
|
||||
vim.keymap.set('n', '<leader>ff', builtin.find_files, { desc = '[F]ind [F]iles' })
|
||||
vim.keymap.set('n', '<leader>fs', builtin.builtin, { desc = '[F]ind [S]elect Telescope' })
|
||||
vim.keymap.set('n', '<leader>fw', builtin.grep_string, { desc = '[F]ind current [W]ord' })
|
||||
vim.keymap.set('n', '<leader>fg', function()
|
||||
builtin.live_grep {
|
||||
additional_args = function()
|
||||
return { "--follow" }
|
||||
end,
|
||||
}
|
||||
end, { desc = '[F]ind by [G]rep' })
|
||||
vim.keymap.set('n', '<leader><leader>', function()
|
||||
builtin.live_grep {
|
||||
additional_args = function()
|
||||
return { "--follow" }
|
||||
end,
|
||||
}
|
||||
end, { desc = '[F]ind by [G]rep' })
|
||||
vim.keymap.set('n', '<leader>fd', builtin.diagnostics, { desc = '[F]ind [D]iagnostics' })
|
||||
vim.keymap.set('n', '<leader>df', builtin.diagnostics, { desc = '[D]iagnostic [F]ind Via Telescope' })
|
||||
vim.keymap.set('n', '<leader>fr', builtin.resume, { desc = '[F]ind [R]esume' })
|
||||
vim.keymap.set('n', '<leader>f.', builtin.oldfiles, { desc = '[F]ind Recent Files ("." for repeat)' })
|
||||
|
||||
vim.keymap.set('n', '<C-f>', function()
|
||||
builtin.current_buffer_fuzzy_find({
|
||||
winblend = 10,
|
||||
previewer = false,
|
||||
})
|
||||
end, { desc = '' })
|
||||
|
||||
vim.keymap.set('n', '<leader>fb', function()
|
||||
builtin.live_grep {
|
||||
grep_open_files = true,
|
||||
prompt_title = 'Live Grep in Open Files',
|
||||
}
|
||||
end, { desc = '[F]ind in [B]uffers' })
|
||||
|
||||
-- Shortcut for searching your Neovim configuration files
|
||||
vim.keymap.set('n', '<leader>fn', function()
|
||||
builtin.find_files { cwd = vim.fn.stdpath 'config' }
|
||||
end, { desc = '[F]ind [N]eovim files' })
|
||||
end,
|
||||
}
|
||||
9
nvim/lua/plugins/theme.lua
Normal file
9
nvim/lua/plugins/theme.lua
Normal file
@@ -0,0 +1,9 @@
|
||||
return {
|
||||
'catppuccin/nvim',
|
||||
priority = 1000, -- Make sure to load this before all the other start plugins.
|
||||
init = function()
|
||||
vim.cmd.colorscheme 'catppuccin-mocha'
|
||||
|
||||
vim.cmd.hi 'Comment gui=none'
|
||||
end,
|
||||
}
|
||||
53
nvim/lua/plugins/whichkey.lua
Normal file
53
nvim/lua/plugins/whichkey.lua
Normal file
@@ -0,0 +1,53 @@
|
||||
return { -- Shows Keybinds
|
||||
'folke/which-key.nvim',
|
||||
event = 'VimEnter', -- Sets the loading event to 'VimEnter'
|
||||
lazy = false,
|
||||
opts = {
|
||||
icons = {
|
||||
mappings = vim.g.have_nerd_font,
|
||||
keys = vim.g.have_nerd_font and {} or {
|
||||
Up = '<Up> ',
|
||||
Down = '<Down> ',
|
||||
Left = '<Left> ',
|
||||
Right = '<Right> ',
|
||||
C = '<C-…> ',
|
||||
M = '<M-…> ',
|
||||
D = '<D-…> ',
|
||||
S = '<S-…> ',
|
||||
CR = '<CR> ',
|
||||
Esc = '<Esc> ',
|
||||
ScrollWheelDown = '<ScrollWheelDown> ',
|
||||
ScrollWheelUp = '<ScrollWheelUp> ',
|
||||
NL = '<NL> ',
|
||||
BS = '<BS> ',
|
||||
Space = '<Space> ',
|
||||
Tab = '<Tab> ',
|
||||
F1 = '<F1>',
|
||||
F2 = '<F2>',
|
||||
F3 = '<F3>',
|
||||
F4 = '<F4>',
|
||||
F5 = '<F5>',
|
||||
F6 = '<F6>',
|
||||
F7 = '<F7>',
|
||||
F8 = '<F8>',
|
||||
F9 = '<F9>',
|
||||
F10 = '<F10>',
|
||||
F11 = '<F11>',
|
||||
F12 = '<F12>',
|
||||
},
|
||||
},
|
||||
|
||||
-- Document existing key chains
|
||||
spec = {
|
||||
{ '<leader>c', group = '[C]ode', mode = { 'n', 'x' } },
|
||||
{ '<leader>d', group = '[D]iagnostic' },
|
||||
{ '<leader>r', group = '[R]ename' },
|
||||
{ '<leader>f', group = '[F]ind' },
|
||||
{ '<leader>w', group = '[W]orkspace' },
|
||||
{ '<leader>t', group = '[T]oggle' },
|
||||
{ '<leader>q', group = 'Open quick [Q]uit menu' },
|
||||
{ '<leader>h', group = 'Git [H]unk', mode = { 'n', 'v' } },
|
||||
{ 's', group = '[S]urround' }
|
||||
},
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user