mirror of
https://github.com/mqttr/dotfiles.git
synced 2025-12-15 04:25:50 -06:00
Recreate neovim configuration
This commit is contained in:
@@ -1,6 +0,0 @@
|
||||
column_width = 160
|
||||
line_endings = "Unix"
|
||||
indent_type = "Spaces"
|
||||
indent_width = 2
|
||||
quote_style = "AutoPreferSingle"
|
||||
call_parentheses = "None"
|
||||
492
nvim/init.lua
492
nvim/init.lua
@@ -5,464 +5,80 @@ vim.g.mapleader = ' '
|
||||
vim.g.maplocalleader = ' '
|
||||
vim.g.have_nerd_font = true
|
||||
|
||||
-- Visual Things
|
||||
vim.opt.cmdheight = 0 -- Currently looking for a solution for searching with / and ?
|
||||
vim.opt.undofile = true
|
||||
vim.opt.updatetime = 250
|
||||
vim.opt.timeoutlen = 200
|
||||
|
||||
-- Sync clipboard between nvim and host
|
||||
vim.schedule(function()
|
||||
vim.opt.clipboard = 'unnamedplus'
|
||||
end)
|
||||
|
||||
-----------------------------
|
||||
-- Visual Settings
|
||||
-----------------------------
|
||||
vim.opt.cmdheight = 0
|
||||
vim.opt.number = true
|
||||
vim.opt.relativenumber = true
|
||||
vim.opt.mouse = 'a'
|
||||
vim.opt.showmode = false
|
||||
|
||||
-- Sync clipboard between OS and Neovim.
|
||||
-- Schedule the setting after `UiEnter` because it can increase startup-time.
|
||||
-- Remove this option if you want your OS clipboard to remain independent.
|
||||
-- See `:help 'clipboard'`
|
||||
-- It does get added to the @ register I believe?
|
||||
vim.schedule(function()
|
||||
vim.opt.clipboard = 'unnamedplus'
|
||||
end)
|
||||
vim.opt.cursorline = true
|
||||
vim.opt.conceallevel = 2
|
||||
vim.opt.scrolloff = 5
|
||||
|
||||
-- Enable break indent
|
||||
vim.opt.breakindent = true
|
||||
-- Enable word break instead of character break
|
||||
vim.opt.linebreak = true
|
||||
|
||||
-- Save undo history
|
||||
vim.opt.undofile = true
|
||||
|
||||
-- Case-insensitive searching UNLESS \C or one or more capital letters in the search term
|
||||
vim.opt.ignorecase = true
|
||||
vim.opt.smartcase = true
|
||||
|
||||
-- Keep signcolumn on by default
|
||||
vim.opt.signcolumn = 'yes'
|
||||
|
||||
-- Decrease update time
|
||||
vim.opt.updatetime = 250
|
||||
|
||||
-- Decrease mapped sequence wait time
|
||||
-- Displays which-key popup sooner
|
||||
vim.opt.timeoutlen = 200
|
||||
|
||||
-- Configure how new splits should be opened
|
||||
vim.opt.splitright = true
|
||||
vim.opt.splitbelow = true
|
||||
|
||||
-- Sets how neovim will display certain whitespace characters in the editor.
|
||||
-- See `:help 'list'`
|
||||
-- and `:help 'listchars'`
|
||||
-----------------------------
|
||||
-- Font & Text Settings
|
||||
-----------------------------
|
||||
|
||||
vim.opt.spell = true
|
||||
vim.opt.shiftwidth = 4
|
||||
vim.opt.expandtab = true
|
||||
vim.opt.linebreak = true
|
||||
vim.opt.breakindent = true
|
||||
|
||||
vim.opt.ignorecase = true
|
||||
vim.opt.smartcase = true
|
||||
|
||||
vim.opt.signcolumn = 'yes'
|
||||
|
||||
vim.opt.inccommand = 'split'
|
||||
|
||||
vim.opt.list = true
|
||||
vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' }
|
||||
|
||||
-- Preview substitutions live, as you type!
|
||||
vim.opt.inccommand = 'split'
|
||||
require 'config.keybinds'
|
||||
|
||||
-- Hides special characters in markdown
|
||||
vim.opt.conceallevel = 2
|
||||
|
||||
-- Show which line your cursor is on
|
||||
vim.opt.cursorline = true
|
||||
|
||||
-- Spelling Correction
|
||||
vim.opt.spell = true
|
||||
-- vim.opt.spelllang = 'en'
|
||||
|
||||
-- Tabulation Stuffs
|
||||
vim.opt.shiftwidth = 4
|
||||
vim.opt.expandtab = true
|
||||
|
||||
-- Minimal number of screen lines to keep above and below the cursor.
|
||||
vim.opt.scrolloff = 7
|
||||
|
||||
-----------------------------
|
||||
-- Quality of Life Keybinds:
|
||||
-----------------------------
|
||||
|
||||
vim.keymap.set('n', '<C-s>', '<cmd>w<CR>', { silent = true })
|
||||
vim.keymap.set('i', '<C-s>', '<cmd>w<CR>', { silent = true })
|
||||
|
||||
--------------------
|
||||
-- Quit Vim
|
||||
vim.keymap.set('n', '<leader>qa', '<cmd>qa!<CR>', { desc = 'Force quit without saving'})
|
||||
vim.keymap.set('n', '<leader>qx', '<cmd>xa!<CR>', { desc = 'Write to all then force quit'})
|
||||
|
||||
|
||||
--------------------
|
||||
-- Text Oriented
|
||||
vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')
|
||||
vim.keymap.set('v', 'R', 's')
|
||||
|
||||
--------------------
|
||||
-- Movement
|
||||
|
||||
-- Faster Window Navigation
|
||||
vim.keymap.set('n', '<C-h>', '<C-w><C-h>', { silent=true, desc = 'Move focus to the left window' })
|
||||
vim.keymap.set('n', '<C-l>', '<C-w><C-l>', { silent=true, desc = 'Move focus to the right window' })
|
||||
vim.keymap.set('n', '<C-j>', '<C-w><C-j>', { silent=true, desc = 'Move focus to the lower window' })
|
||||
vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { silent=true, desc = 'Move focus to the upper window' })
|
||||
|
||||
-- Terminal
|
||||
-- or just use <C-\><C-n> to exit terminal mode
|
||||
vim.keymap.set('t', '<C-x>', '<C-\\><C-n>', { silent=true, desc = 'Exit terminal mode' })
|
||||
|
||||
-- Skipping Sections
|
||||
vim.keymap.set('n', '<C-Up>', 'zz20kzz', { silent=true, desc = 'Skip Large Sections' })
|
||||
vim.keymap.set('n', '<C-Down>', 'zz20jzz', { silent=true, desc = 'Skip Large Sections' })
|
||||
|
||||
vim.keymap.set('i', '<C-Up>', '<C-o>2k', { silent=true, desc = 'Skip Large Sections' })
|
||||
vim.keymap.set('i', '<C-Down>', '<C-o>2j', { silent=true, desc = 'Skip Large Sections' })
|
||||
|
||||
vim.keymap.set('n', '<A-k>', 'zz20kzz', { silent=true, desc = 'Skip Large Sections' })
|
||||
vim.keymap.set('n', '<A-j>', 'zz20jzz', { silent=true, desc = 'Skip Large Sections' })
|
||||
vim.keymap.set('n', '<A-h>', '10h', { silent=true, desc = 'Skip Large Sections' })
|
||||
vim.keymap.set('n', '<A-l>', '10l', { silent=true, desc = 'Skip Large Sections' })
|
||||
|
||||
vim.keymap.set('i', '<A-k>', '<C-o>2k', { silent=true, desc = 'Skip Large Sections' })
|
||||
vim.keymap.set('i', '<A-j>', '<C-o>2j', { silent=true, desc = 'Skip Large Sections' })
|
||||
vim.keymap.set('i', '<A-l>', '<C-o>10l', { silent=true, desc = 'Skip Large Sections' })
|
||||
vim.keymap.set('i', '<A-h>', '<C-o>10h', { silent=true, desc = 'Skip Large Sections' })
|
||||
|
||||
--------------------
|
||||
-- Window Manipulation
|
||||
|
||||
vim.keymap.set('n', '<C-q>', '<CMD>q<CR>', { silent=true, desc='Close Window' })
|
||||
|
||||
--------------------
|
||||
-- Weird Sh*t Fixes
|
||||
vim.keymap.set('n', 's', '', {desc="[S]urround"}) -- Dunno but this is needed to stop some weird substitution thing
|
||||
vim.keymap.set('n', 'm', 'q', {desc="Macro"})
|
||||
vim.keymap.set('n', 'q', '') -- Record fights me so often
|
||||
|
||||
-- [[ Basic Autocommands ]]
|
||||
-- See `:help lua-guide-autocommands`
|
||||
|
||||
-- Highlight when yanking (copying) text
|
||||
-- Try it with `yap` in normal mode
|
||||
-- See `:help vim.highlight.on_yank()`
|
||||
vim.api.nvim_create_autocmd('TextYankPost', {
|
||||
desc = 'Highlight when yanking (copying) text',
|
||||
group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }),
|
||||
callback = function()
|
||||
vim.highlight.on_yank()
|
||||
end,
|
||||
})
|
||||
|
||||
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
|
||||
-- Bootstrap lazy.nvim
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||
local lazyrepo = 'https://github.com/folke/lazy.nvim.git'
|
||||
local out = vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath }
|
||||
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
||||
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
|
||||
if vim.v.shell_error ~= 0 then
|
||||
error('Error cloning lazy.nvim:\n' .. out)
|
||||
vim.api.nvim_echo({
|
||||
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
|
||||
{ out, "WarningMsg" },
|
||||
{ "\nPress any key to exit..." },
|
||||
}, true, {})
|
||||
vim.fn.getchar()
|
||||
os.exit(1)
|
||||
end
|
||||
end ---@diagnostic disable-next-line: undefined-field
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
-- vim.notify = function(msg, level, opts)
|
||||
-- if msg:match("blink.cmp") then
|
||||
-- return -- Ignore messages from blink.cmp
|
||||
-- end
|
||||
-- vim.fn.notify(msg, level, opts)
|
||||
-- end
|
||||
|
||||
require('lazy').setup({
|
||||
-- Was constantly fighting this. It get's it wrong istg ;-;
|
||||
-- 'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically
|
||||
|
||||
-- See `:help gitsigns` to understand what the configuration keys do
|
||||
{ -- Adds git related signs to the gutter, as well as utilities for managing changes
|
||||
'lewis6991/gitsigns.nvim',
|
||||
opts = {
|
||||
signs = {
|
||||
add = { text = '+' },
|
||||
change = { text = '~' },
|
||||
delete = { text = '_' },
|
||||
topdelete = { text = '‾' },
|
||||
changedelete = { text = '~' },
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
{ -- Shows Keybinds
|
||||
'folke/which-key.nvim',
|
||||
event = 'VimEnter', -- Sets the loading event to 'VimEnter'
|
||||
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
|
||||
-- Setup lazy.nvim
|
||||
require("lazy").setup({
|
||||
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' }
|
||||
},
|
||||
},
|
||||
-- import your plugins
|
||||
{ import = "plugins" },
|
||||
},
|
||||
|
||||
{ -- Fuzzy Finder (files, lsp, etc)
|
||||
'nvim-telescope/telescope.nvim',
|
||||
event = 'VimEnter',
|
||||
branch = '0.1.x',
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
{ -- If encountering errors, see telescope-fzf-native README for installation instructions
|
||||
'nvim-telescope/telescope-fzf-native.nvim',
|
||||
|
||||
-- `build` is used to run some command when the plugin is installed/updated.
|
||||
-- This is only run then, not every time Neovim starts up.
|
||||
build = 'make',
|
||||
|
||||
-- `cond` is a condition used to determine whether this plugin should be
|
||||
-- installed and loaded.
|
||||
cond = function()
|
||||
return vim.fn.executable 'make' == 1
|
||||
end,
|
||||
},
|
||||
{ 'nvim-telescope/telescope-ui-select.nvim' },
|
||||
|
||||
-- Useful for getting pretty icons, but requires a Nerd Font.
|
||||
{ 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font },
|
||||
},
|
||||
config = function()
|
||||
-- The easiest way to use Telescope, is to start by doing something like:
|
||||
-- :Telescope help_tags
|
||||
--
|
||||
-- Two important keymaps to use while in Telescope are:
|
||||
-- - Insert mode: <c-/>
|
||||
-- - Normal mode: ?
|
||||
--
|
||||
-- [[ Configure Telescope ]]
|
||||
-- See `:help telescope` and `:help telescope.setup()`
|
||||
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(),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
-- Enable Telescope extensions if they are installed
|
||||
pcall(require('telescope').load_extension, 'fzf')
|
||||
pcall(require('telescope').load_extension, 'ui-select')
|
||||
|
||||
-- See `:help telescope.builtin`
|
||||
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()
|
||||
require('telescope.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', '<leader><leader>', '<leader>fg', { desc = '[ ] Find Grep' })
|
||||
|
||||
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,
|
||||
},
|
||||
|
||||
{ -- You can easily change to a different colorscheme.
|
||||
-- Change the name of the colorscheme plugin below, and then
|
||||
-- change the command in the config to whatever the name of that colorscheme is.
|
||||
--
|
||||
-- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`.
|
||||
'catppuccin/nvim',
|
||||
priority = 1000, -- Make sure to load this before all the other start plugins.
|
||||
init = function()
|
||||
-- Load the colorscheme here.
|
||||
-- Like many other themes, this one has different styles, and you could load
|
||||
-- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'.
|
||||
vim.cmd.colorscheme 'catppuccin-mocha'
|
||||
|
||||
-- You can configure highlights by doing something like:
|
||||
vim.cmd.hi 'Comment gui=none'
|
||||
end,
|
||||
},
|
||||
require 'plugins.lsp',
|
||||
require 'plugins.autopairs',
|
||||
require 'plugins.neo-tree',
|
||||
require 'plugins.gitsigns',
|
||||
require 'plugins.barbar',
|
||||
require 'plugins.terminal',
|
||||
require 'plugins.venn',
|
||||
require 'plugins.blinkcmp',
|
||||
require 'plugins.colorful_indent',
|
||||
-- require 'plugins.debug',
|
||||
-- Highlight todo, notes, etc in comments
|
||||
{
|
||||
"OXY2DEV/markview.nvim",
|
||||
lazy = false, -- Recommended
|
||||
-- ft = "markdown" -- If you decide to lazy-load anyway
|
||||
|
||||
dependencies = {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
"nvim-tree/nvim-web-devicons"
|
||||
}
|
||||
},
|
||||
{
|
||||
'folke/todo-comments.nvim',
|
||||
event = 'VimEnter',
|
||||
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||
opts = { signs = false }
|
||||
},
|
||||
{ -- 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,
|
||||
},
|
||||
{ -- Highlight, edit, and navigate code
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
build = ':TSUpdate',
|
||||
main = 'nvim-treesitter.configs',
|
||||
opts = {
|
||||
ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'query', 'vim', 'vimdoc' },
|
||||
-- Autoinstall languages that are not installed
|
||||
auto_install = true,
|
||||
highlight = {
|
||||
enable = true,
|
||||
-- Some languages depend on vim's regex highlighting system (such as Ruby) for indent rules.
|
||||
-- If you are experiencing weird indenting issues, add the language to
|
||||
-- the list of additional_vim_regex_highlighting and disabled languages for indent.
|
||||
additional_vim_regex_highlighting = { 'ruby' },
|
||||
disable = { 'latex' }
|
||||
},
|
||||
indent = { enable = true, disable = { 'ruby' } },
|
||||
},
|
||||
-- - Incremental selection: Included, see `:help nvim-treesitter-incremental-selection-mod`
|
||||
-- - Show your current context: https://github.com/nvim-treesitter/nvim-treesitter-context
|
||||
-- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects
|
||||
},
|
||||
{
|
||||
'VonHeikemen/fine-cmdline.nvim',
|
||||
dependencies = {
|
||||
{'MunifTanjim/nui.nvim'}
|
||||
},
|
||||
cmdline = {
|
||||
smart_history = true
|
||||
},
|
||||
config = function()
|
||||
vim.api.nvim_set_keymap('n', ':', '<cmd>FineCmdline<CR>', {noremap = true})
|
||||
end
|
||||
},
|
||||
},
|
||||
{
|
||||
ui = {
|
||||
icons = vim.g.have_nerd_font and {} or {
|
||||
cmd = '⌘',
|
||||
config = '🛠',
|
||||
event = '📅',
|
||||
ft = '📂',
|
||||
init = '⚙',
|
||||
keys = '🗝',
|
||||
plugin = '🔌',
|
||||
runtime = '💻',
|
||||
require = '🌙',
|
||||
source = '📄',
|
||||
start = '🚀',
|
||||
task = '📌',
|
||||
lazy = '💤 ',
|
||||
},
|
||||
},
|
||||
-- colorscheme that will be used when installing plugins.
|
||||
install = { colorscheme = { "catppuccin-mocha" } },
|
||||
-- automatically check for plugin updates
|
||||
checker = { enabled = true },
|
||||
})
|
||||
|
||||
require('config')
|
||||
|
||||
@@ -1,31 +1,29 @@
|
||||
{
|
||||
"FTerm.nvim": { "branch": "master", "commit": "d1320892cc2ebab472935242d9d992a2c9570180" },
|
||||
"barbar.nvim": { "branch": "master", "commit": "53b5a2f34b68875898f0531032fbf090e3952ad7" },
|
||||
"blink.cmp": { "branch": "main", "commit": "485c03400608cb6534bbf84da8c1c471fc4808c0" },
|
||||
"fine-cmdline.nvim": { "branch": "main", "commit": "aec9efebf6f4606a5204d49ffa3ce2eeb7e08a3e" },
|
||||
"blink.cmp": { "branch": "main", "commit": "bae4bae0eedd1fa55f34b685862e94a222d5c6f8" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "43b0c856ae5f32a195d83f4a27fe21d63e6c966c" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "6e3c66548035e50db7bd8e360a29aec6620c3641" },
|
||||
"indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
|
||||
"lspsaga.nvim": { "branch": "main", "commit": "920b1253e1a26732e53fac78412f6da7f674671d" },
|
||||
"markview.nvim": { "branch": "main", "commit": "3fd645600961781966adcfc1c77a6af8730042d7" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "d39a75bbce4b8aad5d627191ea915179c77c100f" },
|
||||
"mason.nvim": { "branch": "main", "commit": "7c7318e8bae7e3536ef6b9e86b9e38e74f2e125e" },
|
||||
"mini.nvim": { "branch": "main", "commit": "c665f30bb372c2ec8cfd61f7531098d3658b6634" },
|
||||
"neo-tree.nvim": { "branch": "main", "commit": "f481de16a0eb59c985abac8985e3f2e2f75b4875" },
|
||||
"nui.nvim": { "branch": "main", "commit": "f535005e6ad1016383f24e39559833759453564e" },
|
||||
"nvim": { "branch": "main", "commit": "1bf070129c0b6f77cc23f6a2212dcdc868308c52" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "4d74e75913832866aa7de35e4202463ddf6efd1b" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "61e5109c8cf24807e4ae29813a3a82b31821dd45" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "28d480e0624b259095e56f353ec911f9f2a0f404" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "f1420728f59843eb2ef084406b3d0201a0a0932d" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
|
||||
"schemastore.nvim": { "branch": "main", "commit": "df87d16fc4ea7c2c67cfc00b513861738693fe07" },
|
||||
"markview.nvim": { "branch": "main", "commit": "13746a05ea207bcbb432231eb9f0d09f71abc0a6" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "1ec4da522fa49dcecee8d190efda273464dd2192" },
|
||||
"mason.nvim": { "branch": "main", "commit": "7dc4facca9702f95353d5a1f87daf23d78e31c2a" },
|
||||
"mini.icons": { "branch": "main", "commit": "b8f6fa6f5a3fd0c56936252edcd691184e5aac0c" },
|
||||
"mini.nvim": { "branch": "main", "commit": "e38547768b2e12bdd48b16b8cfdca2e3b7543e22" },
|
||||
"neo-tree.nvim": { "branch": "main", "commit": "cea666ef965884414b1b71f6b39a537f9238bdb2" },
|
||||
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
|
||||
"nvim": { "branch": "main", "commit": "30fa4d122d9b22ad8b2e0ab1b533c8c26c4dde86" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "aaa807fb2ea8d3caf41c153a174c6b7e472a8428" },
|
||||
"nvim-notify": { "branch": "master", "commit": "397c7c1184745fca649e5104de659e6392ef5a4d" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "c2599a81ecabaae07c49ff9b45dcd032a8d90f1a" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" },
|
||||
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
|
||||
"telescope-undo.nvim": { "branch": "main", "commit": "928d0c2dc9606e01e2cc547196f48d2eaecf58e5" },
|
||||
"telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" },
|
||||
"venn.nvim": { "branch": "main", "commit": "b09c2f36ddf70b498281845109bedcf08a7e0de0" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" }
|
||||
"which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" },
|
||||
"wilder.nvim": { "branch": "master", "commit": "679f348dc90d80ff9ba0e7c470c40a4d038dcecf" }
|
||||
}
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
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 } }
|
||||
@@ -1,2 +0,0 @@
|
||||
require 'config.lsp'
|
||||
require 'config.colorful_indent'
|
||||
50
nvim/lua/config/keybinds.lua
Normal file
50
nvim/lua/config/keybinds.lua
Normal file
@@ -0,0 +1,50 @@
|
||||
vim.keymap.set('n', '<C-s>', '<cmd>w<CR>', { silent = true })
|
||||
vim.keymap.set('i', '<C-s>', '<cmd>w<CR>', { silent = true })
|
||||
|
||||
vim.keymap.set('n', '<leader>qa', '<cmd>qa!<CR>', { desc = 'Force quit without saving'})
|
||||
vim.keymap.set('n', '<leader>qx', '<cmd>xa!<CR>', { desc = 'Write to all then force quit'})
|
||||
|
||||
vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')
|
||||
vim.keymap.set('v', 'R', 's')
|
||||
|
||||
-- Faster Window Navigation
|
||||
vim.keymap.set('n', '<C-h>', '<C-w><C-h>', { silent=true, desc = 'Move focus to the left window' })
|
||||
vim.keymap.set('n', '<C-l>', '<C-w><C-l>', { silent=true, desc = 'Move focus to the right window' })
|
||||
vim.keymap.set('n', '<C-j>', '<C-w><C-j>', { silent=true, desc = 'Move focus to the lower window' })
|
||||
vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { silent=true, desc = 'Move focus to the upper window' })
|
||||
|
||||
-- Terminal
|
||||
-- or just use <C-\><C-n> to exit terminal mode
|
||||
vim.keymap.set('t', '<C-x>', '<C-\\><C-n>', { silent=true, desc = 'Exit terminal mode' })
|
||||
|
||||
-- Skipping Sections
|
||||
vim.keymap.set('n', '<C-Up>', 'zz20kzz', { silent=true, desc = 'Skip Large Sections' })
|
||||
vim.keymap.set('n', '<C-Down>', 'zz20jzz', { silent=true, desc = 'Skip Large Sections' })
|
||||
|
||||
vim.keymap.set('i', '<C-Up>', '<C-o>2k', { silent=true, desc = 'Skip Large Sections' })
|
||||
vim.keymap.set('i', '<C-Down>', '<C-o>2j', { silent=true, desc = 'Skip Large Sections' })
|
||||
|
||||
vim.keymap.set('n', '<A-k>', 'zz20kzz', { silent=true, desc = 'Skip Large Sections' })
|
||||
vim.keymap.set('n', '<A-j>', 'zz20jzz', { silent=true, desc = 'Skip Large Sections' })
|
||||
vim.keymap.set('n', '<A-h>', '10h', { silent=true, desc = 'Skip Large Sections' })
|
||||
vim.keymap.set('n', '<A-l>', '10l', { silent=true, desc = 'Skip Large Sections' })
|
||||
|
||||
vim.keymap.set('i', '<A-k>', '<C-o>2k', { silent=true, desc = 'Skip Large Sections' })
|
||||
vim.keymap.set('i', '<A-j>', '<C-o>2j', { silent=true, desc = 'Skip Large Sections' })
|
||||
vim.keymap.set('i', '<A-l>', '<C-o>10l', { silent=true, desc = 'Skip Large Sections' })
|
||||
vim.keymap.set('i', '<A-h>', '<C-o>10h', { silent=true, desc = 'Skip Large Sections' })
|
||||
|
||||
vim.keymap.set('n', '<C-q>', '<CMD>q<CR>', { silent=true, desc='Close Window' })
|
||||
|
||||
vim.keymap.set('n', 's', '', {desc="[S]urround"}) -- Dunno but this is needed to stop some weird substitution thing
|
||||
vim.keymap.set('n', 'm', 'q', {desc="Macro"})
|
||||
vim.keymap.set('n', 'q', '') -- Record fights me so often
|
||||
|
||||
-- Highlight when yanking
|
||||
vim.api.nvim_create_autocmd('TextYankPost', {
|
||||
desc = 'Highlight when yanking (copying) text',
|
||||
group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }),
|
||||
callback = function()
|
||||
vim.highlight.on_yank()
|
||||
end,
|
||||
})
|
||||
@@ -1,65 +0,0 @@
|
||||
-- Disable Virtual Text Warnings and Errors
|
||||
vim.diagnostic.config({
|
||||
-- virtual_text = false,
|
||||
signs = true,
|
||||
float = { border = "single" },
|
||||
})
|
||||
|
||||
local lsp = vim.lsp
|
||||
local handlers = lsp.handlers
|
||||
|
||||
-- Hover doc popup
|
||||
local pop_opts = { border = "rounded", max_width = 80 }
|
||||
handlers["textDocument/hover"] = lsp.with(handlers.hover, pop_opts)
|
||||
handlers["textDocument/signatureHelp"] = lsp.with(handlers.signature_help, pop_opts)
|
||||
|
||||
-- Quick Keybinds via g
|
||||
vim.keymap.set('n', 'gr', "<cmd>Lspsaga rename<cr>", {silent = true, noremap = true, desc = 'Lsp Saga Rename'})
|
||||
vim.keymap.set('n', 'gx', "<cmd>Lspsaga code_action<cr>", {silent = true, noremap = true, desc = 'Lsp Saga Code Action'})
|
||||
vim.keymap.set('n', 'gs', "<cmd>Lspsaga finder<cr>", { silent = true, noremap = true, desc = 'Lsp Saga Usage Finder' })
|
||||
vim.keymap.set('n', 'gg', "<cmd>Lspsaga hover_doc<cr>", { silent = true, noremap = true, desc = 'Lsp Saga Hover Doc' })
|
||||
vim.keymap.set('n', 'go', "<cmd>Lspsaga outline<cr>", { silent = true, noremap = true, desc = 'Lsp Saga Outline' })
|
||||
|
||||
-- Diagnostic Specific Keybinds with Leader
|
||||
vim.keymap.set('n', '<leader>dr', "<cmd>Lspsaga rename<cr>", {silent = true, noremap = true, desc = 'Lsp Saga Rename'})
|
||||
vim.keymap.set('n', '<leader>dx', "<cmd>Lspsaga code_action<cr>", {silent = true, noremap = true, desc = 'Lsp Saga Code Action'})
|
||||
vim.keymap.set('n', '<leader>ds', "<cmd>Lspsaga finder<cr>", { silent = true, noremap = true, desc = 'Lsp Saga Usage Finder' })
|
||||
vim.keymap.set('n', '<leader>dg', "<cmd>Lspsaga hover_doc<cr>", { silent = true, noremap = true, desc = 'Lsp Saga Hover Doc' })
|
||||
vim.keymap.set('n', '<leader>do', "<cmd>Lspsaga outline<cr>", { silent = true, noremap = true, desc = 'Lsp Saga Outline' })
|
||||
|
||||
vim.keymap.set('n', '<leader>da', "<cmd>Lspsaga show_workspace_diagnostics<cr>", { silent = true, noremap = true, desc = 'Lsp Saga Show Workspace Diagnostic' })
|
||||
vim.keymap.set('n', '<leader>dd', "<cmd>Lspsaga show_line_diagnostics<cr>", { silent = true, noremap = true, desc = 'Lsp Saga Show Line Diagnostic' })
|
||||
|
||||
|
||||
for _, method in ipairs({ 'textDocument/diagnostic', 'workspace/diagnostic' }) do
|
||||
local default_diagnostic_handler = vim.lsp.handlers[method]
|
||||
vim.lsp.handlers[method] = function(err, result, context, config)
|
||||
if err ~= nil and err.code == -32802 then
|
||||
return
|
||||
end
|
||||
return default_diagnostic_handler(err, result, context, config)
|
||||
end
|
||||
end
|
||||
|
||||
require('lspconfig').jsonls.setup {
|
||||
settings = {
|
||||
json = {
|
||||
schemas = require('schemastore').json.schemas(),
|
||||
validate = { enable = true },
|
||||
},
|
||||
},
|
||||
}
|
||||
require('lspconfig').yamlls.setup {
|
||||
settings = {
|
||||
yaml = {
|
||||
schemaStore = {
|
||||
-- You must disable built-in schemaStore support if you want to use
|
||||
-- this plugin and its advanced options like `ignore`.
|
||||
enable = false,
|
||||
-- Avoid TypeError: Cannot read properties of undefined (reading 'length')
|
||||
url = "",
|
||||
},
|
||||
schemas = require('schemastore').yaml.schemas(),
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -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,
|
||||
signs = {
|
||||
add = { text = '+' },
|
||||
change = { text = '~' },
|
||||
delete = { text = '_' },
|
||||
topdelete = { text = '‾' },
|
||||
changedelete = { text = '~' },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -1,62 +1,83 @@
|
||||
local servers = {
|
||||
"rust_analyzer",
|
||||
"clangd",
|
||||
"basedpyright",
|
||||
"lua_ls",
|
||||
'bashls',
|
||||
'yamlls',
|
||||
'gopls',
|
||||
'html',
|
||||
'cssls',
|
||||
}
|
||||
|
||||
return {
|
||||
"b0o/schemastore.nvim",
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
ensure_installed = servers
|
||||
'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'
|
||||
},
|
||||
-- {
|
||||
-- "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
|
||||
|
||||
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,
|
||||
-- }
|
||||
-- end
|
||||
-- end,
|
||||
--
|
||||
-- automatic_installation = true,
|
||||
-- },
|
||||
},
|
||||
|
||||
sources = {
|
||||
default = { 'lsp', 'path', 'snippets', 'buffer' },
|
||||
},
|
||||
|
||||
fuzzy = { implementation = "prefer_rust_with_warning" }
|
||||
},
|
||||
opts_extend = { "sources.default" }
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
'neovim/nvim-lspconfig',
|
||||
dependencies = {
|
||||
{ 'williamboman/mason.nvim', config = true },
|
||||
'williamboman/mason-lspconfig.nvim',
|
||||
'saghen/blink.cmp',
|
||||
},
|
||||
|
||||
opts = {
|
||||
servers = {
|
||||
rust_analyzer = {},
|
||||
clangd = {},
|
||||
basedpyright = {},
|
||||
lua_ls = {},
|
||||
bashls = {},
|
||||
clangd = {},
|
||||
rust_analyzer = {},
|
||||
yamlls = {},
|
||||
gopls = {
|
||||
cmd = {"gopls"},
|
||||
filetypes = {"go", "gomod", "gowork", "gotmpl"},
|
||||
gopls = {},
|
||||
html = {}
|
||||
}
|
||||
},
|
||||
html = {},
|
||||
cssls = {},
|
||||
},
|
||||
},
|
||||
config = function (_, opts)
|
||||
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
|
||||
@@ -64,45 +85,6 @@ return {
|
||||
config.capabilities = require('blink.cmp').get_lsp_capabilities(config.capabilities)
|
||||
lspconfig[server].setup(config)
|
||||
end
|
||||
end,
|
||||
end
|
||||
},
|
||||
{
|
||||
'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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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