Compare commits
8 Commits
b78b742927
...
8f8c1a3c50
| Author | SHA1 | Date | |
|---|---|---|---|
| 8f8c1a3c50 | |||
| 86e7005fe2 | |||
| 690be51f5c | |||
| bc9105f382 | |||
| 43fa666cff | |||
| 484ec01d5a | |||
| f9d087055d | |||
| 9ef40d822d |
@@ -1,5 +1,5 @@
|
||||
# Theme
|
||||
theme = dark:Gruvbox Dark Hard,light:Atom One Light
|
||||
theme = dark:everforest-dark-hard,light:Atom One Light
|
||||
|
||||
# Font
|
||||
font-family = IosevkaDT Nerd Font
|
||||
|
||||
22
.config/ghostty/themes/everforest-dark-hard
Normal file
22
.config/ghostty/themes/everforest-dark-hard
Normal file
@@ -0,0 +1,22 @@
|
||||
background = #272E33
|
||||
foreground = #D3C6AA
|
||||
cursor-color = #D3C6AA
|
||||
selection-foreground = #272E33
|
||||
selection-background = #D3C6AA
|
||||
|
||||
palette = 0=#7A8478
|
||||
palette = 1=#E67E80
|
||||
palette = 2=#A7C080
|
||||
palette = 3=#DBBC7F
|
||||
palette = 4=#7FBBB3
|
||||
palette = 5=#D699B6
|
||||
palette = 6=#83C092
|
||||
palette = 7=#D3C6AA
|
||||
palette = 8=#859289
|
||||
palette = 9=#E67E80
|
||||
palette = 10=#A7C080
|
||||
palette = 11=#DBBC7F
|
||||
palette = 12=#7FBBB3
|
||||
palette = 13=#D699B6
|
||||
palette = 14=#83C092
|
||||
palette = 15=#D3C6AA
|
||||
22
.config/ghostty/themes/everforest-dark-medium
Normal file
22
.config/ghostty/themes/everforest-dark-medium
Normal file
@@ -0,0 +1,22 @@
|
||||
background = #2D353B
|
||||
foreground = #D3C6AA
|
||||
cursor-color = #D3C6AA
|
||||
selection-foreground = #2D353B
|
||||
selection-background = #D3C6AA
|
||||
|
||||
palette = 0=#7A8478
|
||||
palette = 1=#E67E80
|
||||
palette = 2=#A7C080
|
||||
palette = 3=#DBBC7F
|
||||
palette = 4=#7FBBB3
|
||||
palette = 5=#D699B6
|
||||
palette = 6=#83C092
|
||||
palette = 7=#D3C6AA
|
||||
palette = 8=#859289
|
||||
palette = 9=#E67E80
|
||||
palette = 10=#A7C080
|
||||
palette = 11=#DBBC7F
|
||||
palette = 12=#7FBBB3
|
||||
palette = 13=#D699B6
|
||||
palette = 14=#83C092
|
||||
palette = 15=#D3C6AA
|
||||
22
.config/ghostty/themes/everforest-dark-soft
Normal file
22
.config/ghostty/themes/everforest-dark-soft
Normal file
@@ -0,0 +1,22 @@
|
||||
background = #333C43
|
||||
foreground = #D3C6AA
|
||||
cursor-color = #D3C6AA
|
||||
selection-foreground = #333C43
|
||||
selection-background = #D3C6AA
|
||||
|
||||
palette = 0=#7A8478
|
||||
palette = 1=#E67E80
|
||||
palette = 2=#A7C080
|
||||
palette = 3=#DBBC7F
|
||||
palette = 4=#7FBBB3
|
||||
palette = 5=#D699B6
|
||||
palette = 6=#83C092
|
||||
palette = 7=#D3C6AA
|
||||
palette = 8=#859289
|
||||
palette = 9=#E67E80
|
||||
palette = 10=#A7C080
|
||||
palette = 11=#DBBC7F
|
||||
palette = 12=#7FBBB3
|
||||
palette = 13=#D699B6
|
||||
palette = 14=#83C092
|
||||
palette = 15=#D3C6AA
|
||||
@@ -1,21 +0,0 @@
|
||||
palette = 0=#7a8478
|
||||
palette = 1=#e67e80
|
||||
palette = 2=#a7c080
|
||||
palette = 3=#dbbc7f
|
||||
palette = 4=#7fbbb3
|
||||
palette = 5=#d699b6
|
||||
palette = 6=#83c092
|
||||
palette = 7=#f2efdf
|
||||
palette = 8=#a6b0a0
|
||||
palette = 9=#f85552
|
||||
palette = 10=#8da101
|
||||
palette = 11=#dfa000
|
||||
palette = 12=#3a94c5
|
||||
palette = 13=#df69ba
|
||||
palette = 14=#35a77c
|
||||
palette = 15=#fffbef
|
||||
background = #272e33
|
||||
foreground = #d3c6aa
|
||||
cursor-color = #e69875
|
||||
selection-background = #4c3743
|
||||
selection-foreground = #d3c6aa
|
||||
22
.config/ghostty/themes/everforest-light-hard
Normal file
22
.config/ghostty/themes/everforest-light-hard
Normal file
@@ -0,0 +1,22 @@
|
||||
background = #FFFBEF
|
||||
foreground = #5C6A72
|
||||
cursor-color = #5C6A72
|
||||
selection-foreground = #FFFBEF
|
||||
selection-background = #5C6A72
|
||||
|
||||
palette = 0=#5C6A72
|
||||
palette = 1=#F85552
|
||||
palette = 2=#8DA101
|
||||
palette = 3=#DFA000
|
||||
palette = 4=#3A94C5
|
||||
palette = 5=#DF69BA
|
||||
palette = 6=#35A77C
|
||||
palette = 7=#DFDDC7
|
||||
palette = 8=#708387
|
||||
palette = 9=#F85552
|
||||
palette = 10=#8DA101
|
||||
palette = 11=#DFA000
|
||||
palette = 12=#3A94C5
|
||||
palette = 13=#DF69BA
|
||||
palette = 14=#35A77C
|
||||
palette = 15=#F0F0E2
|
||||
22
.config/ghostty/themes/everforest-light-medium
Normal file
22
.config/ghostty/themes/everforest-light-medium
Normal file
@@ -0,0 +1,22 @@
|
||||
background = #FDF6E3
|
||||
foreground = #5C6A72
|
||||
cursor-color = #5C6A72
|
||||
selection-foreground = #FDF6E3
|
||||
selection-background = #5C6A72
|
||||
|
||||
palette = 0=#5C6A72
|
||||
palette = 1=#F85552
|
||||
palette = 2=#8DA101
|
||||
palette = 3=#DFA000
|
||||
palette = 4=#3A94C5
|
||||
palette = 5=#DF69BA
|
||||
palette = 6=#35A77C
|
||||
palette = 7=#DFDDC7
|
||||
palette = 8=#708387
|
||||
palette = 9=#F85552
|
||||
palette = 10=#8DA101
|
||||
palette = 11=#DFA000
|
||||
palette = 12=#3A94C5
|
||||
palette = 13=#DF69BA
|
||||
palette = 14=#35A77C
|
||||
palette = 15=#F0F0E2
|
||||
22
.config/ghostty/themes/everforest-light-soft
Normal file
22
.config/ghostty/themes/everforest-light-soft
Normal file
@@ -0,0 +1,22 @@
|
||||
background = #F3EAD3
|
||||
foreground = #5C6A72
|
||||
cursor-color = #5C6A72
|
||||
selection-foreground = #F3EAD3
|
||||
selection-background = #5C6A72
|
||||
|
||||
palette = 0=#5C6A72
|
||||
palette = 1=#F85552
|
||||
palette = 2=#8DA101
|
||||
palette = 3=#DFA000
|
||||
palette = 4=#3A94C5
|
||||
palette = 5=#DF69BA
|
||||
palette = 6=#35A77C
|
||||
palette = 7=#DFDDC7
|
||||
palette = 8=#708387
|
||||
palette = 9=#F85552
|
||||
palette = 10=#8DA101
|
||||
palette = 11=#DFA000
|
||||
palette = 12=#3A94C5
|
||||
palette = 13=#DF69BA
|
||||
palette = 14=#35A77C
|
||||
palette = 15=#F0F0E2
|
||||
@@ -1,21 +0,0 @@
|
||||
palette = 0=#7a8478
|
||||
palette = 1=#e67e80
|
||||
palette = 2=#a7c080
|
||||
palette = 3=#dbbc7f
|
||||
palette = 4=#7fbbb3
|
||||
palette = 5=#d699b6
|
||||
palette = 6=#83c092
|
||||
palette = 7=#f2efdf
|
||||
palette = 8=#a6b0a0
|
||||
palette = 9=#f85552
|
||||
palette = 10=#8da101
|
||||
palette = 11=#dfa000
|
||||
palette = 12=#3a94c5
|
||||
palette = 13=#df69ba
|
||||
palette = 14=#35a77c
|
||||
palette = 15=#fffbef
|
||||
background = #2d353b
|
||||
foreground = #d3c6aa
|
||||
cursor-color = #e69875
|
||||
selection-background = #543a48
|
||||
selection-foreground = #d3c6aa
|
||||
@@ -1,21 +0,0 @@
|
||||
palette = 0=#7a8478
|
||||
palette = 1=#e67e80
|
||||
palette = 2=#a7c080
|
||||
palette = 3=#dbbc7f
|
||||
palette = 4=#7fbbb3
|
||||
palette = 5=#d699b6
|
||||
palette = 6=#83c092
|
||||
palette = 7=#f2efdf
|
||||
palette = 8=#a6b0a0
|
||||
palette = 9=#f85552
|
||||
palette = 10=#8da101
|
||||
palette = 11=#dfa000
|
||||
palette = 12=#3a94c5
|
||||
palette = 13=#df69ba
|
||||
palette = 14=#35a77c
|
||||
palette = 15=#fffbef
|
||||
background = #333c43
|
||||
foreground = #d3c6aa
|
||||
cursor-color = #e69875
|
||||
selection-background = #5c3f4f
|
||||
selection-foreground = #d3c6aa
|
||||
@@ -964,13 +964,13 @@
|
||||
{
|
||||
"identifiers": { "is_keyboard": true },
|
||||
"simple_modifications": [
|
||||
{
|
||||
"from": { "key_code": "right_option" },
|
||||
"to": [{ "apple_vendor_top_case_key_code": "keyboard_fn" }]
|
||||
},
|
||||
{
|
||||
"from": { "apple_vendor_top_case_key_code": "keyboard_fn" },
|
||||
"to": [{ "key_code": "left_control" }]
|
||||
},
|
||||
{
|
||||
"from": { "key_code": "right_option" },
|
||||
"to": [{ "apple_vendor_top_case_key_code": "keyboard_fn" }]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
git:
|
||||
paging:
|
||||
colorArg: always
|
||||
pager: delta --features lazygit
|
||||
useConfig: false
|
||||
autoFetch: false
|
||||
git:
|
||||
pagers:
|
||||
- pager: delta --features lazygit
|
||||
colorArg: always
|
||||
useConfig: false
|
||||
autoFetch: false
|
||||
gui:
|
||||
nerdFontsVersion: 3
|
||||
|
||||
customCommands:
|
||||
- key: "C"
|
||||
command: "git commit -m '{{ .Form.Type }}{{if .Form.Scopes}}({{ .Form.Scopes }}){{end}}: {{ .Form.Description }}'"
|
||||
|
||||
2
.config/nvim/.gitignore
vendored
2
.config/nvim/.gitignore
vendored
@@ -1,2 +0,0 @@
|
||||
lazy-lock.json
|
||||
lua/dev
|
||||
@@ -1,11 +0,0 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
|
||||
"runtime.version": "LuaJIT",
|
||||
"diagnostics.globals": [
|
||||
"vim",
|
||||
"numbers"
|
||||
],
|
||||
"diagnostics.disable": [
|
||||
"missing-fields"
|
||||
]
|
||||
}
|
||||
@@ -1,5 +1,622 @@
|
||||
require("core.variables")
|
||||
require("core.keymaps")
|
||||
require("core.autocmds")
|
||||
require('core.package_manager')
|
||||
require('winbar')
|
||||
-- Set the leader key
|
||||
vim.g.mapleader = " "
|
||||
-- Appearance
|
||||
vim.opt.termguicolors = true -- Enable 24-bit colors
|
||||
vim.opt.number = true -- Show line numbers
|
||||
vim.opt.relativenumber = true -- Show relative line numbers
|
||||
vim.opt.wrap = false -- Disable line wrapping
|
||||
vim.opt.conceallevel = 2 -- Hide Org mode links (assuming you use Org mode)
|
||||
vim.opt.concealcursor = 'nc' -- Conceal text in normal mode only
|
||||
vim.opt.signcolumn = "yes" -- Always show the sign column
|
||||
vim.o.laststatus = 1 -- Always show the status line
|
||||
vim.o.winborder = nil -- Use default border for floating windows
|
||||
-- Indentation
|
||||
vim.opt.tabstop = 4 -- Number of spaces a tab represents
|
||||
vim.opt.softtabstop = 4 -- Number of spaces a <Tab> in Insert mode equals
|
||||
vim.opt.shiftwidth = 4 -- Number of spaces to use for autoindent
|
||||
vim.opt.expandtab = true -- Use spaces instead of tabs
|
||||
vim.opt.smartindent = true -- Smart auto-indenting
|
||||
-- Searching
|
||||
vim.opt.hlsearch = false -- Disable highlighting of search matches
|
||||
vim.opt.incsearch = true -- Show partial matches while typing
|
||||
-- Behavior and Navigation
|
||||
vim.opt.iskeyword:append("_") -- Add '_' to the list of keyword characters
|
||||
vim.opt.scrolloff = 10 -- Keep 10 lines above/below cursor when scrolling
|
||||
vim.opt.sidescrolloff = 10
|
||||
vim.opt.smoothscroll = true
|
||||
-- File Management
|
||||
vim.opt.undodir = os.getenv("XDG_STATE_HOME") .. "/nvim/undodir" -- Directory for undo files
|
||||
vim.opt.undofile = true -- Save undo history
|
||||
vim.opt.backup = true -- Create backup files
|
||||
vim.opt.backupdir = os.getenv("XDG_STATE_HOME") .. "/nvim/backupdir" -- Directory for backup files
|
||||
vim.opt.autoread = true -- Automatically reload changed files
|
||||
vim.opt.swapfile = false -- Disable swap files
|
||||
-- Formatting
|
||||
vim.opt.formatoptions:remove("ro") -- Remove 'ro' from formatoptions
|
||||
-- Clipboard (testing unnamedplus... might like it)
|
||||
vim.opt.clipboard = "unnamedplus"
|
||||
|
||||
--Move lines
|
||||
vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv")
|
||||
vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv")
|
||||
--quickfix keybinds
|
||||
vim.keymap.set("n", "<C-p>", "<cmd>cprev<CR>zz")
|
||||
vim.keymap.set("n", "<C-n>", "<cmd>cnext<CR>zz")
|
||||
--buffer keybinds
|
||||
vim.keymap.set("n", "<A-h>", "<cmd>bp<CR>")
|
||||
vim.keymap.set("n", "<A-l>", "<cmd>bn<CR>")
|
||||
--jk as escape
|
||||
vim.keymap.set("i", "jk", "<esc>")
|
||||
-- Copy to system clipboard
|
||||
vim.keymap.set({ 'n', 'x' }, 'gy', '"+y', { desc = 'Copy to system clipboard' })
|
||||
-- Paste from system clipboard in normal mode
|
||||
vim.keymap.set('n', 'gp', '"+p', { desc = 'Paste from system clipboard' })
|
||||
-- Paste from system clipboard in visual mode without overwriting the clipboard
|
||||
vim.keymap.set('x', 'gp', '"+P', { desc = 'Paste from system clipboard' })
|
||||
--Center screen after some motions
|
||||
vim.keymap.set("n", "<C-d>", "<C-d>zz", { desc = "Center cursor after moving down half-page" })
|
||||
vim.keymap.set("n", "<C-u>", "<C-u>zz", { desc = "Center cursor after moving down half-page" })
|
||||
vim.keymap.set("n", "G", "Gzz", { desc = "Center cursor after moving down half-page" })
|
||||
--Run lua stuff (ty teej)
|
||||
vim.keymap.set("n", "<space><space>x", "<cmd>source %<CR>")
|
||||
vim.keymap.set("n", "<space>x", ":.lua<CR>")
|
||||
vim.keymap.set("v", "<space>x", ":lua<CR>")
|
||||
|
||||
-- autocmds --
|
||||
vim.api.nvim_create_autocmd("VimLeavePre", {
|
||||
pattern = "*",
|
||||
callback = function()
|
||||
if vim.g.savesession then
|
||||
vim.api.nvim_command("mks! .session.vim")
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
-- pack --
|
||||
vim.api.nvim_create_autocmd('PackChanged', {
|
||||
callback = function(ev)
|
||||
local name, kind = ev.data.spec.name, ev.data.kind
|
||||
if name == 'nvim-treesitter' and kind == 'update' then
|
||||
if not ev.data.active then vim.cmd.packadd('nvim-treesitter') end
|
||||
vim.cmd('TSUpdate')
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
vim.pack.add({
|
||||
'https://github.com/sainnhe/gruvbox-material',
|
||||
'https://github.com/sainnhe/everforest',
|
||||
'https://github.com/navarasu/onedark.nvim',
|
||||
{ src = 'https://github.com/echasnovski/mini.icons', version = vim.version.range('*') },
|
||||
'https://github.com/folke/snacks.nvim',
|
||||
'https://github.com/rachartier/tiny-glimmer.nvim',
|
||||
{ src = 'https://github.com/echasnovski/mini.surround', version = vim.version.range('*') },
|
||||
{ src = 'https://github.com/echasnovski/mini.pairs', version = vim.version.range('*') },
|
||||
{ src = 'https://github.com/echasnovski/mini.ai', version = vim.version.range('*') },
|
||||
-- Adds S in regex to handle case conversion
|
||||
'https://github.com/tpope/vim-abolish',
|
||||
'https://github.com/mbbill/undotree',
|
||||
{ src = 'https://github.com/ThePrimeagen/harpoon', version = 'harpoon2' },
|
||||
'https://github.com/stevearc/oil.nvim',
|
||||
'https://github.com/mrjones2014/smart-splits.nvim',
|
||||
'https://github.com/ibhagwan/fzf-lua',
|
||||
'https://github.com/nvim-treesitter/nvim-treesitter',
|
||||
'https://github.com/nvim-treesitter/nvim-treesitter-textobjects',
|
||||
'https://github.com/neovim/nvim-lspconfig',
|
||||
'https://github.com/folke/lazydev.nvim',
|
||||
'https://github.com/smjonas/inc-rename.nvim',
|
||||
'https://github.com/williamboman/mason.nvim',
|
||||
{ src = 'https://github.com/saghen/blink.cmp', version = vim.version.range('*') },
|
||||
'https://github.com/rafamadriz/friendly-snippets',
|
||||
'https://github.com/stevearc/conform.nvim',
|
||||
'https://github.com/mfussenegger/nvim-lint',
|
||||
'https://github.com/barreiroleo/ltex-extra.nvim',
|
||||
'https://github.com/mfussenegger/nvim-dap',
|
||||
'https://github.com/igorlfs/nvim-dap-view',
|
||||
'https://github.com/lervag/vimtex',
|
||||
{ src = 'https://github.com/chomosuke/typst-preview.nvim', version = vim.version.range('1.*') },
|
||||
'https://github.com/tpope/vim-fugitive',
|
||||
'https://github.com/FabijanZulj/blame.nvim',
|
||||
'https://github.com/folke/todo-comments.nvim',
|
||||
'https://github.com/nvim-lua/plenary.nvim',
|
||||
'https://github.com/nvim-tree/nvim-web-devicons',
|
||||
})
|
||||
|
||||
-- colorscheme --
|
||||
require('onedark').setup({ style = 'dark' })
|
||||
require('onedark').load()
|
||||
|
||||
-- mini --
|
||||
require('mini.icons').setup()
|
||||
require('mini.surround').setup()
|
||||
|
||||
require('mini.pairs').setup({
|
||||
mappings = {
|
||||
-- Prevents the action if the cursor is just before any character or next to a "\".
|
||||
["("] = { action = "open", pair = "()", neigh_pattern = "[^\\][%s%)%]%}]" },
|
||||
["["] = { action = "open", pair = "[]", neigh_pattern = "[^\\][%s%)%]%}]" },
|
||||
["{"] = { action = "open", pair = "{}", neigh_pattern = "[^\\][%s%)%]%}]" },
|
||||
-- This is default (prevents the action if the cursor is just next to a "\").
|
||||
[")"] = { action = "close", pair = "()", neigh_pattern = "[^\\]." },
|
||||
["]"] = { action = "close", pair = "[]", neigh_pattern = "[^\\]." },
|
||||
["}"] = { action = "close", pair = "{}", neigh_pattern = "[^\\]." },
|
||||
-- Prevents the action if the cursor is just before or next to any character.
|
||||
['"'] = { action = "closeopen", pair = '""', neigh_pattern = "[^%w][^%w]", register = { cr = false } },
|
||||
["'"] = { action = "closeopen", pair = "''", neigh_pattern = "[^%w][^%w]", register = { cr = false } },
|
||||
["`"] = { action = "closeopen", pair = "``", neigh_pattern = "[^%w][^%w]", register = { cr = false } },
|
||||
},
|
||||
})
|
||||
|
||||
local gen_spec = require('mini.ai').gen_spec
|
||||
require('mini.ai').setup({
|
||||
custom_textobjects = {
|
||||
F = gen_spec.treesitter({ a = '@function.outer', i = '@function.inner' }),
|
||||
},
|
||||
n_lines = 1000
|
||||
})
|
||||
|
||||
-- snacks --
|
||||
require('snacks').setup({
|
||||
bigfile = { enabled = true },
|
||||
notifier = { enabled = true },
|
||||
notify = { enabled = true },
|
||||
quickfile = { enabled = true },
|
||||
statuscolumn = { enabled = true },
|
||||
input = { enabled = true },
|
||||
image = {
|
||||
doc = {
|
||||
inline = false,
|
||||
float = true,
|
||||
max_width = 10,
|
||||
max_height = 5,
|
||||
}
|
||||
},
|
||||
words = {
|
||||
debounce = 10
|
||||
}
|
||||
})
|
||||
|
||||
-- tiny-glimmer --
|
||||
require('tiny-glimmer').setup({
|
||||
overwrite = {
|
||||
search = { enabled = true },
|
||||
undo = { enabled = true },
|
||||
redo = { enabled = true },
|
||||
}
|
||||
})
|
||||
|
||||
-- fzf-lua --
|
||||
local fzflua = require('fzf-lua')
|
||||
fzflua.register_ui_select()
|
||||
fzflua.setup({
|
||||
defaults = {
|
||||
winopts = {
|
||||
border = "rounded",
|
||||
width = 0.6,
|
||||
height = 0.5,
|
||||
},
|
||||
},
|
||||
files = {
|
||||
previewer = false,
|
||||
winopts = { width = 0.5, height = 0.5 },
|
||||
},
|
||||
grep = {
|
||||
winopts = {
|
||||
width = 0.7,
|
||||
preview = {
|
||||
layout = "horizontal",
|
||||
horizontal = "right:40%",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
vim.keymap.set('n', '<leader>ff', fzflua.files)
|
||||
vim.keymap.set('n', '<leader>fe', fzflua.diagnostics_workspace)
|
||||
vim.keymap.set('n', '<leader>fg', fzflua.live_grep)
|
||||
vim.keymap.set('n', '<leader>fb', fzflua.buffers)
|
||||
vim.keymap.set('n', '<leader>fh', fzflua.help_tags)
|
||||
vim.keymap.set({ 'n', 'v' }, '<leader>fc', fzflua.commands)
|
||||
|
||||
-- lsp --
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = "lua",
|
||||
callback = function()
|
||||
require('lazydev').setup({
|
||||
library = {
|
||||
{ path = "${3rd}/luv/library", words = { "vim%.uv" } },
|
||||
},
|
||||
})
|
||||
end,
|
||||
})
|
||||
|
||||
require('inc_rename').setup({ save_in_cmdline_history = false })
|
||||
require('mason').setup()
|
||||
|
||||
vim.api.nvim_create_autocmd("LspAttach", {
|
||||
group = vim.api.nvim_create_augroup("UserLspConfig", {}),
|
||||
callback = function(ev)
|
||||
local conform = require("conform")
|
||||
|
||||
local function jumpWithVirtLineDiags(jumpCount)
|
||||
pcall(vim.api.nvim_del_augroup_by_name, "jumpWithVirtLineDiags")
|
||||
vim.diagnostic.jump({ count = jumpCount })
|
||||
local initialVirtTextConf = vim.diagnostic.config().virtual_text
|
||||
vim.diagnostic.config({
|
||||
virtual_text = false,
|
||||
virtual_lines = { current_line = true },
|
||||
})
|
||||
vim.defer_fn(function()
|
||||
vim.api.nvim_create_autocmd("CursorMoved", {
|
||||
once = true,
|
||||
group = vim.api.nvim_create_augroup("jumpWithVirtLineDiags", {}),
|
||||
callback = function()
|
||||
vim.diagnostic.config({ virtual_lines = false, virtual_text = initialVirtTextConf })
|
||||
end,
|
||||
})
|
||||
end, 1)
|
||||
end
|
||||
|
||||
local bufopts = { noremap = true, silent = true, buffer = ev.buf }
|
||||
vim.keymap.set("n", "<space>e", vim.diagnostic.open_float, bufopts)
|
||||
vim.keymap.set("n", "<space>q", vim.diagnostic.setloclist, bufopts)
|
||||
vim.keymap.set("n", "gD", vim.lsp.buf.declaration, bufopts)
|
||||
vim.keymap.set("n", "gd", vim.lsp.buf.definition, bufopts)
|
||||
vim.keymap.set("n", "gr", fzflua.lsp_references, bufopts)
|
||||
vim.keymap.set("n", "K", vim.lsp.buf.hover, bufopts)
|
||||
vim.keymap.set("n", "gi", fzflua.lsp_implementations, bufopts)
|
||||
vim.keymap.set("n", "<space>k", vim.lsp.buf.signature_help, bufopts)
|
||||
vim.keymap.set("n", "<space>D", vim.lsp.buf.type_definition, bufopts)
|
||||
vim.keymap.set("n", "<space>rn", function() return ":IncRename " .. vim.fn.expand("<cword>") end, { expr = true })
|
||||
vim.keymap.set({ "n", "v" }, "<space>ca", vim.lsp.buf.code_action, bufopts)
|
||||
vim.keymap.set("n", "<space>ge", function() jumpWithVirtLineDiags(1) end, bufopts)
|
||||
vim.keymap.set("n", "<space>gE", function() jumpWithVirtLineDiags(-1) end, bufopts)
|
||||
vim.keymap.set("n", "<space>fo", function() conform.format({ lsp_fallback = true }) end, bufopts)
|
||||
end,
|
||||
})
|
||||
|
||||
local capabilities = require('blink.cmp').get_lsp_capabilities(nil, true)
|
||||
|
||||
vim.lsp.config["gopls"] = {
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
gopls = {
|
||||
["ui.completion.usePlaceholders"] = true,
|
||||
["ui.diagnostic.staticcheck"] = true,
|
||||
["ui.inlayhint.hints"] = {
|
||||
assignVariablesTypes = true,
|
||||
compositeLiteralFields = true,
|
||||
compositeLiteralTypes = true,
|
||||
completeUnimported = true,
|
||||
constantValues = true,
|
||||
functionTypeParameters = true,
|
||||
parameterNames = true,
|
||||
rangeVariableTypes = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
vim.lsp.enable('gopls')
|
||||
|
||||
vim.lsp.config["lua_ls"] = {
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
Lua = { hint = { enable = true } },
|
||||
},
|
||||
}
|
||||
vim.lsp.enable('lua_ls')
|
||||
|
||||
vim.lsp.config["ltex"] = {
|
||||
capabilities = capabilities,
|
||||
on_attach = function() require("ltex_extra").setup() end,
|
||||
settings = {
|
||||
ltex = {
|
||||
language = "en-GB",
|
||||
additionalRules = {
|
||||
enablePickyRules = true,
|
||||
languageModel = '~/Downloads/ngrams/',
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
vim.lsp.enable('ltex')
|
||||
|
||||
vim.lsp.config["hls"] = {
|
||||
capabilities = capabilities,
|
||||
filetypes = { 'haskell', 'lhaskell', 'cabal' },
|
||||
}
|
||||
vim.lsp.enable('hls')
|
||||
|
||||
vim.lsp.config["texlab"] = { capabilities = capabilities }
|
||||
vim.lsp.enable('texlab')
|
||||
|
||||
vim.lsp.config["bashls"] = { capabilities = capabilities }
|
||||
vim.lsp.enable('bashls')
|
||||
|
||||
vim.lsp.config["zls"] = { capabilities = capabilities }
|
||||
vim.lsp.enable('zls')
|
||||
|
||||
vim.lsp.config["pyright"] = { capabilities = capabilities }
|
||||
vim.lsp.enable('pyright')
|
||||
|
||||
vim.lsp.config['clangd'] = { capabilities = capabilities }
|
||||
vim.lsp.enable('clangd')
|
||||
|
||||
vim.lsp.config['nil_ls'] = { capabilities = capabilities }
|
||||
vim.lsp.enable('nil_ls')
|
||||
|
||||
-- vimtex --
|
||||
if vim.loop.os_uname().sysname == "Darwin" then
|
||||
vim.g.vimtex_view_method = 'sioyek'
|
||||
else
|
||||
vim.g.vimtex_view_method = 'zathura'
|
||||
end
|
||||
vim.g.vimtex_quickfix_ignore_filters = { 'Overfull', 'Underfull' }
|
||||
vim.g.vimtex_quickfix_open_on_warning = 0
|
||||
vim.g.vimtex_compiler_method = 'latexmk'
|
||||
vim.g.vimtex_compiler_latexmk = {
|
||||
out_dir = 'build',
|
||||
options = {
|
||||
"-verbose",
|
||||
"-shell-escape",
|
||||
"-file-line-error",
|
||||
"-synctex=1",
|
||||
"-interaction=nonstopmode",
|
||||
},
|
||||
}
|
||||
vim.g.vimtex_view_automatic = 1
|
||||
|
||||
|
||||
-- blink.cmp --
|
||||
require('blink.cmp').setup({
|
||||
keymap = {
|
||||
preset = 'default',
|
||||
['<Up>'] = {},
|
||||
['<Down>'] = {},
|
||||
['<C-u>'] = { 'scroll_documentation_up', 'fallback' },
|
||||
['<C-d>'] = { 'scroll_documentation_down', 'fallback' },
|
||||
},
|
||||
appearance = {
|
||||
use_nvim_cmp_as_default = true,
|
||||
nerd_font_variant = 'mono',
|
||||
},
|
||||
sources = {
|
||||
default = { 'lsp', 'path', 'snippets', 'buffer' },
|
||||
providers = {
|
||||
lazydev = {
|
||||
name = "LazyDev",
|
||||
module = "lazydev.integrations.blink",
|
||||
fallbacks = { "lsp" },
|
||||
},
|
||||
},
|
||||
},
|
||||
signature = {
|
||||
enabled = true,
|
||||
window = { show_documentation = false },
|
||||
},
|
||||
cmdline = {
|
||||
completion = { menu = { auto_show = true } },
|
||||
},
|
||||
completion = {
|
||||
accept = { auto_brackets = { enabled = true } },
|
||||
menu = {
|
||||
border = "single",
|
||||
winhighlight = "Normal:Normal,FloatBorder:Normal,CursorLine:Visual,Search:None",
|
||||
winblend = 0,
|
||||
draw = {
|
||||
treesitter = { 'lsp' },
|
||||
columns = { { 'kind_icon' }, { 'label' } },
|
||||
components = {
|
||||
kind_icon = {
|
||||
ellipsis = false,
|
||||
text = function(ctx)
|
||||
local kind_icon, _, _ = require('mini.icons').get('lsp', ctx.kind)
|
||||
return kind_icon
|
||||
end,
|
||||
highlight = function(ctx)
|
||||
local _, hl, _ = require('mini.icons').get('lsp', ctx.kind)
|
||||
return hl
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
documentation = {
|
||||
auto_show = true,
|
||||
window = {
|
||||
border = 'single',
|
||||
max_width = 160,
|
||||
max_height = 30,
|
||||
winblend = 0,
|
||||
winhighlight = "Normal:Normal,FloatBorder:Normal,CursorLine:Visual,Search:None",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- conform --
|
||||
require('conform').setup({
|
||||
formatters_by_ft = {
|
||||
python = { "black" },
|
||||
haskell = { "fourmolu" },
|
||||
javascript = { "prettierd" },
|
||||
markdown = { "mdformat" },
|
||||
rust = { "rustfmt" },
|
||||
go = { "gofmt" },
|
||||
json = { "jq" },
|
||||
bash = { "shfmt", "beautysh" },
|
||||
zsh = { "beautysh" },
|
||||
},
|
||||
})
|
||||
|
||||
-- lint --
|
||||
local lint = require('lint')
|
||||
lint.linters_by_ft = { go = { "golangcilint" } }
|
||||
|
||||
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
|
||||
group = vim.api.nvim_create_augroup("lint", { clear = true }),
|
||||
callback = function() lint.try_lint() end,
|
||||
})
|
||||
|
||||
-- dap --
|
||||
local dap = require('dap')
|
||||
|
||||
-- LLDB adapter (codelldb)
|
||||
dap.adapters.codelldb = {
|
||||
type = "server",
|
||||
port = "${port}",
|
||||
executable = {
|
||||
command = vim.fn.expand("~/.local/share/nvim/mason/bin/codelldb"),
|
||||
args = { "--port", "${port}" },
|
||||
},
|
||||
}
|
||||
|
||||
-- C/C++ configuration
|
||||
dap.configurations.c = {
|
||||
{
|
||||
name = "Launch",
|
||||
type = "codelldb",
|
||||
request = "launch",
|
||||
program = function()
|
||||
return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file")
|
||||
end,
|
||||
cwd = "${workspaceFolder}",
|
||||
stopOnEntry = false,
|
||||
},
|
||||
}
|
||||
dap.configurations.cpp = dap.configurations.c
|
||||
|
||||
require('dap-view').setup({
|
||||
winbar = { controls = { enabled = true } },
|
||||
auto_toggle = true,
|
||||
})
|
||||
|
||||
-- harpoon --
|
||||
local harpoon = require('harpoon')
|
||||
harpoon:setup()
|
||||
vim.keymap.set("n", "<leader>a", function() harpoon:list():add() end)
|
||||
vim.keymap.set("n", "<C-e>", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end)
|
||||
vim.keymap.set("n", "<C-h>", function() harpoon:list():select(1) end)
|
||||
vim.keymap.set("n", "<C-j>", function() harpoon:list():select(2) end)
|
||||
vim.keymap.set("n", "<C-k>", function() harpoon:list():select(3) end)
|
||||
vim.keymap.set("n", "<C-l>", function() harpoon:list():select(4) end)
|
||||
|
||||
-- oil --
|
||||
require('oil').setup({
|
||||
float = { preview_split = "right" },
|
||||
})
|
||||
vim.api.nvim_set_keymap('n', '<leader>o', ':lua require("oil").open_float()<CR>', { noremap = true, silent = true })
|
||||
|
||||
-- smart-splits --
|
||||
local splits = require('smart-splits')
|
||||
splits.setup({})
|
||||
vim.keymap.set('n', '<S-F5>', splits.resize_left)
|
||||
vim.keymap.set('n', '<S-F6>', splits.resize_down)
|
||||
vim.keymap.set('n', '<S-F7>', splits.resize_up)
|
||||
vim.keymap.set('n', '<S-F8>', splits.resize_right)
|
||||
vim.keymap.set('n', '<F5>', splits.move_cursor_left)
|
||||
vim.keymap.set('n', '<F6>', splits.move_cursor_down)
|
||||
vim.keymap.set('n', '<F7>', splits.move_cursor_up)
|
||||
vim.keymap.set('n', '<F8>', splits.move_cursor_right)
|
||||
|
||||
-- git --
|
||||
require('blame').setup()
|
||||
require('todo-comments').setup()
|
||||
|
||||
-- dev plugins --
|
||||
vim.cmd.packadd("osc11.nvim")
|
||||
require('osc11').setup({
|
||||
on_dark = function()
|
||||
require('onedark').setup({ style = 'dark' })
|
||||
require('onedark').load()
|
||||
end,
|
||||
on_light = function()
|
||||
require('onedark').setup({ style = 'light' })
|
||||
require('onedark').load()
|
||||
end,
|
||||
})
|
||||
|
||||
vim.cmd.packadd("worktrees.nvim")
|
||||
require('worktrees').setup({
|
||||
mappings = {
|
||||
create = "<leader>wtc",
|
||||
delete = "<leader>wtd",
|
||||
switch = "<leader>wts",
|
||||
},
|
||||
})
|
||||
|
||||
-- winbar --
|
||||
|
||||
function RenderWinbar()
|
||||
-- Get the path and expand variables.
|
||||
local path = vim.fs.normalize(vim.fn.expand '%:p' --[[@as string]])
|
||||
|
||||
-- No special styling for diff views.
|
||||
if vim.startswith(path, 'diffview') then
|
||||
return string.format('%%#Winbar#%s', path)
|
||||
end
|
||||
|
||||
-- Replace slashes by arrows.
|
||||
local separator = ' %#WinbarSeparator# '
|
||||
|
||||
local prefix, prefix_path = '', ''
|
||||
local folder_icon = ''
|
||||
|
||||
-- If the window gets too narrow, shorten the path and drop the prefix.
|
||||
if vim.api.nvim_win_get_width(0) < math.floor(vim.o.columns / 3) then
|
||||
path = vim.fn.pathshorten(path)
|
||||
else
|
||||
-- For some special folders, add a prefix instead of the full path (making
|
||||
-- sure to pick the longest prefix).
|
||||
---@type table<string, string>
|
||||
local special_dirs = {
|
||||
DOTFILES = vim.env.XDG_CONFIG_HOME,
|
||||
GITS = vim.env.HOME .. '/gits',
|
||||
HOME = vim.env.HOME,
|
||||
PROJECTS = vim.env.HOME .. '/projects',
|
||||
}
|
||||
for dir_name, dir_path in pairs(special_dirs) do
|
||||
if vim.startswith(path, vim.fs.normalize(dir_path)) and #dir_path > #prefix_path then
|
||||
prefix, prefix_path, folder_icon = dir_name, dir_path, MiniIcons.get('file',path)
|
||||
end
|
||||
end
|
||||
if prefix ~= '' then
|
||||
path = path:gsub('^' .. prefix_path, '')
|
||||
prefix = string.format('%%#WinBarFile#%s %s%s', folder_icon, prefix, separator)
|
||||
end
|
||||
end
|
||||
|
||||
-- Remove leading slash.
|
||||
path = path:gsub('^/', '')
|
||||
|
||||
vim.api.nvim_set_hl(0, "Winbar", { link = "Normal" })
|
||||
vim.api.nvim_set_hl(0, "WinbarSeparator", { link = "Normal" })
|
||||
vim.api.nvim_set_hl(0, "WinBarFile", { link = "Normal" })
|
||||
|
||||
return table.concat {
|
||||
' ',
|
||||
prefix,
|
||||
table.concat(
|
||||
vim.iter(vim.split(path, '/'))
|
||||
:map(function(segment)
|
||||
return string.format('%%#Winbar#%s', segment)
|
||||
end)
|
||||
:totable(),
|
||||
separator
|
||||
),
|
||||
}
|
||||
end
|
||||
|
||||
vim.api.nvim_create_autocmd('BufWinEnter', {
|
||||
group = vim.api.nvim_create_augroup('afonso/winbar', { clear = true }),
|
||||
desc = 'Attach winbar',
|
||||
callback = function(args)
|
||||
if
|
||||
not vim.api.nvim_win_get_config(0).zindex -- Not a floating window
|
||||
and vim.bo[args.buf].buftype == '' -- Normal buffer
|
||||
and vim.api.nvim_buf_get_name(args.buf) ~= '' -- Has a file name
|
||||
and not vim.wo[0].diff -- Not in diff mode
|
||||
then
|
||||
vim.wo.winbar = "%{%v:lua.RenderWinbar()%}"
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
vim.api.nvim_create_autocmd("VimLeavePre", {
|
||||
pattern = "*",
|
||||
callback = function()
|
||||
if vim.g.savesession then
|
||||
vim.api.nvim_command("mks! .session.vim")
|
||||
end
|
||||
end
|
||||
})
|
||||
@@ -1,31 +0,0 @@
|
||||
--Move lines
|
||||
vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv")
|
||||
vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv")
|
||||
--quickfix keybinds
|
||||
vim.keymap.set("n", "<C-p>", "<cmd>cprev<CR>zz")
|
||||
vim.keymap.set("n", "<C-n>", "<cmd>cnext<CR>zz")
|
||||
--buffer keybinds
|
||||
vim.keymap.set("n", "<A-h>", "<cmd>bp<CR>")
|
||||
vim.keymap.set("n", "<A-l>", "<cmd>bn<CR>")
|
||||
--jk as escape
|
||||
vim.keymap.set("i", "jk", "<esc>")
|
||||
-- Copy to system clipboard
|
||||
vim.keymap.set({ 'n', 'x' }, 'gy', '"+y', { desc = 'Copy to system clipboard' })
|
||||
-- Paste from system clipboard in normal mode
|
||||
vim.keymap.set('n', 'gp', '"+p', { desc = 'Paste from system clipboard' })
|
||||
-- Paste from system clipboard in visual mode without overwriting the clipboard
|
||||
vim.keymap.set('x', 'gp', '"+P', { desc = 'Paste from system clipboard' })
|
||||
--Center screen after some motions
|
||||
vim.keymap.set("n", "<C-d>", "<C-d>zz", { desc = "Center cursor after moving down half-page" })
|
||||
vim.keymap.set("n", "<C-u>", "<C-u>zz", { desc = "Center cursor after moving down half-page" })
|
||||
vim.keymap.set("n", "G", "Gzz", { desc = "Center cursor after moving down half-page" })
|
||||
--Run lua stuff (ty teej)
|
||||
vim.keymap.set("n", "<space><space>x", "<cmd>source %<CR>")
|
||||
vim.keymap.set("n", "<space>x", ":.lua<CR>")
|
||||
vim.keymap.set("v", "<space>x", ":lua<CR>")
|
||||
--Merge lines in visual mode
|
||||
vim.keymap.set("v", "<A-J>", function()
|
||||
for _ = 1, vim.fn.getpos("'>")[2] - vim.fn.getpos("'<")[2] - 1 do
|
||||
vim.api.nvim_command("normal! J")
|
||||
end
|
||||
end)
|
||||
@@ -1,27 +0,0 @@
|
||||
-- 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 })
|
||||
if vim.v.shell_error ~= 0 then
|
||||
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
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
--Call lazy config here
|
||||
local lazy = require("lazy")
|
||||
lazy.setup({
|
||||
spec = {
|
||||
{ import = "plugins" }
|
||||
},
|
||||
dev = {
|
||||
path = vim.fn.stdpath("config") .. "/lua/dev"
|
||||
}
|
||||
})
|
||||
@@ -1,41 +0,0 @@
|
||||
-- Set the leader key
|
||||
vim.g.mapleader = " "
|
||||
|
||||
-- Appearance
|
||||
vim.opt.termguicolors = true -- Enable 24-bit colors
|
||||
vim.opt.number = true -- Show line numbers
|
||||
vim.opt.relativenumber = true -- Show relative line numbers
|
||||
vim.opt.wrap = false -- Disable line wrapping
|
||||
vim.opt.conceallevel = 2 -- Hide Org mode links (assuming you use Org mode)
|
||||
vim.opt.concealcursor = 'nc' -- Conceal text in normal mode only
|
||||
vim.opt.signcolumn = "yes" -- Always show the sign column
|
||||
vim.o.laststatus = 1 -- Always show the status line
|
||||
vim.o.winborder = nil -- Use default border for floating windows
|
||||
|
||||
-- Indentation
|
||||
vim.opt.tabstop = 4 -- Number of spaces a tab represents
|
||||
vim.opt.softtabstop = 4 -- Number of spaces a <Tab> in Insert mode equals
|
||||
vim.opt.shiftwidth = 4 -- Number of spaces to use for autoindent
|
||||
vim.opt.expandtab = true -- Use spaces instead of tabs
|
||||
vim.opt.smartindent = true -- Smart auto-indenting
|
||||
|
||||
-- Searching
|
||||
vim.opt.hlsearch = false -- Disable highlighting of search matches
|
||||
vim.opt.incsearch = true -- Show partial matches while typing
|
||||
|
||||
-- Behavior and Navigation
|
||||
vim.opt.iskeyword:append("_") -- Add '_' to the list of keyword characters
|
||||
vim.opt.scrolloff = 10 -- Keep 10 lines above/below cursor when scrolling
|
||||
vim.opt.sidescrolloff = 10
|
||||
vim.opt.smoothscroll = true
|
||||
|
||||
-- File Management
|
||||
vim.opt.undodir = os.getenv("XDG_STATE_HOME") .. "/nvim/undodir" -- Directory for undo files
|
||||
vim.opt.undofile = true -- Save undo history
|
||||
vim.opt.backup = true -- Create backup files
|
||||
vim.opt.backupdir = os.getenv("XDG_STATE_HOME") .. "/nvim/backupdir" -- Directory for backup files
|
||||
vim.opt.autoread = true -- Automatically reload changed files
|
||||
vim.opt.swapfile = false -- Disable swap files
|
||||
|
||||
-- Formatting
|
||||
vim.opt.formatoptions:remove("ro") -- Remove 'ro' from formatoptions
|
||||
@@ -1,86 +0,0 @@
|
||||
return {
|
||||
{
|
||||
'saghen/blink.cmp',
|
||||
lazy = false,
|
||||
dependencies = {
|
||||
'rafamadriz/friendly-snippets',
|
||||
{ 'echasnovski/mini.icons', version = '*' },
|
||||
},
|
||||
version = '*',
|
||||
opts = {
|
||||
keymap = {
|
||||
preset = 'default',
|
||||
['<Up>'] = {},
|
||||
['<Down>'] = {},
|
||||
['<C-u>'] = { 'scroll_documentation_up', 'fallback' },
|
||||
['<C-d>'] = { 'scroll_documentation_down', 'fallback' },
|
||||
},
|
||||
appearance = {
|
||||
use_nvim_cmp_as_default = true,
|
||||
nerd_font_variant = 'mono'
|
||||
},
|
||||
sources = {
|
||||
default = { 'lsp', 'path', 'snippets', 'buffer' },
|
||||
providers = {
|
||||
lazydev = {
|
||||
name = "LazyDev",
|
||||
module = "lazydev.integrations.blink",
|
||||
fallbacks = { "lsp" }
|
||||
},
|
||||
},
|
||||
},
|
||||
signature = {
|
||||
enabled = true,
|
||||
window = {
|
||||
show_documentation = false,
|
||||
}
|
||||
},
|
||||
cmdline = {
|
||||
completion = {
|
||||
menu = {
|
||||
auto_show = true
|
||||
}
|
||||
}
|
||||
},
|
||||
completion = {
|
||||
accept = {
|
||||
auto_brackets = {
|
||||
enabled = true
|
||||
}
|
||||
},
|
||||
menu = {
|
||||
border = "single",
|
||||
winhighlight = "Normal:Normal,FloatBorder:Normal,CursorLine:Visual,Search:None",
|
||||
winblend = 0,
|
||||
draw = {
|
||||
treesitter = { 'lsp' },
|
||||
columns = { { 'kind_icon' }, { 'label' } },
|
||||
components = {
|
||||
kind_icon = {
|
||||
ellipsis = false,
|
||||
text = function(ctx)
|
||||
local kind_icon, _, _ = require('mini.icons').get('lsp', ctx.kind)
|
||||
return kind_icon
|
||||
end,
|
||||
highlight = function(ctx)
|
||||
local _, hl, _ = require('mini.icons').get('lsp', ctx.kind)
|
||||
return hl
|
||||
end,
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
documentation = {
|
||||
auto_show = true,
|
||||
window = {
|
||||
border = 'single',
|
||||
max_width = 160,
|
||||
max_height = 30,
|
||||
winblend = 0,
|
||||
winhighlight = "Normal:Normal,FloatBorder:Normal,CursorLine:Visual,Search:None",
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
return {
|
||||
{
|
||||
"sainnhe/gruvbox-material",
|
||||
event = "VeryLazy",
|
||||
priority = 1000,
|
||||
},
|
||||
{
|
||||
"EdenEast/nightfox.nvim",
|
||||
event = "VeryLazy",
|
||||
priority = 1000
|
||||
},
|
||||
{ "blazkowolf/gruber-darker.nvim" },
|
||||
{ "sainnhe/everforest" },
|
||||
{
|
||||
"navarasu/onedark.nvim",
|
||||
priority = 1000,
|
||||
}
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
return {
|
||||
{
|
||||
"mbbill/undotree",
|
||||
event = "VeryLazy",
|
||||
},
|
||||
{
|
||||
'echasnovski/mini.surround',
|
||||
version = '*',
|
||||
opts = {}
|
||||
},
|
||||
{
|
||||
'echasnovski/mini.pairs',
|
||||
version = '*',
|
||||
config = function()
|
||||
vim.api.nvim_set_keymap('n', 'S', 'saiw', { silent = true })
|
||||
require("mini.pairs").setup({
|
||||
mappings = {
|
||||
-- Prevents the action if the cursor is just before any character or next to a "\".
|
||||
["("] = { action = "open", pair = "()", neigh_pattern = "[^\\][%s%)%]%}]" },
|
||||
["["] = { action = "open", pair = "[]", neigh_pattern = "[^\\][%s%)%]%}]" },
|
||||
["{"] = { action = "open", pair = "{}", neigh_pattern = "[^\\][%s%)%]%}]" },
|
||||
-- This is default (prevents the action if the cursor is just next to a "\").
|
||||
[")"] = { action = "close", pair = "()", neigh_pattern = "[^\\]." },
|
||||
["]"] = { action = "close", pair = "[]", neigh_pattern = "[^\\]." },
|
||||
["}"] = { action = "close", pair = "{}", neigh_pattern = "[^\\]." },
|
||||
-- Prevents the action if the cursor is just before or next to any character.
|
||||
['"'] = { action = "closeopen", pair = '""', neigh_pattern = "[^%w][^%w]", register = { cr = false } },
|
||||
["'"] = { action = "closeopen", pair = "''", neigh_pattern = "[^%w][^%w]", register = { cr = false } },
|
||||
["`"] = { action = "closeopen", pair = "``", neigh_pattern = "[^%w][^%w]", register = { cr = false } },
|
||||
},
|
||||
})
|
||||
end
|
||||
},
|
||||
|
||||
-- Adds S in regex replace and change camelCase to snake_case, etc
|
||||
"tpope/vim-abolish"
|
||||
}
|
||||
@@ -1,271 +0,0 @@
|
||||
return {
|
||||
{
|
||||
"folke/lazydev.nvim",
|
||||
ft = "lua",
|
||||
opts = {
|
||||
library = {
|
||||
{ path = "${3rd}/luv/library", words = { "vim%.uv" } }
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"smjonas/inc-rename.nvim",
|
||||
opts = {
|
||||
save_in_cmdline_history = false,
|
||||
}
|
||||
},
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {}
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = {
|
||||
"saghen/blink.cmp",
|
||||
"ibhagwan/fzf-lua",
|
||||
"stevearc/conform.nvim",
|
||||
},
|
||||
event = { "BufReadPost", "BufNewFile" },
|
||||
config = function()
|
||||
local lspconfig = require("lspconfig")
|
||||
-- Use an on_attach function to only map the following keys
|
||||
-- after the language server attaches to the current buffer
|
||||
vim.api.nvim_create_autocmd("LspAttach", {
|
||||
group = vim.api.nvim_create_augroup("UserLspConfig", {}),
|
||||
callback = function(ev)
|
||||
local fzflua = require("fzf-lua")
|
||||
local conform = require("conform")
|
||||
|
||||
local function jumpWithVirtLineDiags(jumpCount)
|
||||
pcall(vim.api.nvim_del_augroup_by_name, "jumpWithVirtLineDiags")
|
||||
|
||||
vim.diagnostic.jump { count = jumpCount }
|
||||
|
||||
local initialVirtTextConf = vim.diagnostic.config().virtual_text
|
||||
vim.diagnostic.config {
|
||||
virtual_text = false,
|
||||
virtual_lines = { current_line = true },
|
||||
}
|
||||
|
||||
vim.defer_fn(function()
|
||||
vim.api.nvim_create_autocmd("CursorMoved", {
|
||||
desc = "User(once): Reset diagnostics virtual lines",
|
||||
once = true,
|
||||
group = vim.api.nvim_create_augroup("jumpWithVirtLineDiags", {}),
|
||||
callback = function()
|
||||
vim.diagnostic.config { virtual_lines = false, virtual_text = initialVirtTextConf }
|
||||
end,
|
||||
})
|
||||
end, 1)
|
||||
end
|
||||
|
||||
local rename_func = function()
|
||||
return ":IncRename " .. vim.fn.expand("<cword>")
|
||||
end
|
||||
|
||||
local bufopts = { noremap = true, silent = true, buffer = ev.buf }
|
||||
local bufopts_expr = { expr = true }
|
||||
vim.keymap.set("n", "<space>e", vim.diagnostic.open_float, bufopts)
|
||||
vim.keymap.set("n", "<space>q", vim.diagnostic.setloclist, bufopts)
|
||||
vim.keymap.set("n", "gD", vim.lsp.buf.declaration, bufopts)
|
||||
vim.keymap.set("n", "gd", vim.lsp.buf.definition, bufopts)
|
||||
vim.keymap.set("n", "gr", fzflua.lsp_references, bufopts)
|
||||
vim.keymap.set("n", "K", vim.lsp.buf.hover, bufopts)
|
||||
vim.keymap.set("n", "gi", fzflua.lsp_implementations, bufopts)
|
||||
vim.keymap.set("n", "<space>k", vim.lsp.buf.signature_help, bufopts)
|
||||
vim.keymap.set("n", "<space>D", vim.lsp.buf.type_definition, bufopts)
|
||||
vim.keymap.set("n", "<space>rn", rename_func, bufopts_expr)
|
||||
vim.keymap.set({ "n", "v" }, "<space>ca", vim.lsp.buf.code_action, bufopts)
|
||||
vim.keymap.set("n", "<space>ge", function() jumpWithVirtLineDiags(1) end, bufopts)
|
||||
vim.keymap.set("n", "<space>gE", function() jumpWithVirtLineDiags(-1) end, bufopts)
|
||||
vim.keymap.set("n", "<space>fo", function() conform.format({ lsp_fallback = true }) end, bufopts)
|
||||
end,
|
||||
})
|
||||
local capabilities = require('blink.cmp').get_lsp_capabilities(nil, true)
|
||||
lspconfig["gopls"].setup({
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
gopls = {
|
||||
["ui.completion.usePlaceholders"] = true,
|
||||
["ui.diagnostic.staticcheck"] = true,
|
||||
["ui.inlayhint.hints"] = {
|
||||
assignVariablesTypes = true,
|
||||
compositeLiteralFields = true,
|
||||
compositeLiteralTypes = true,
|
||||
completeUnimported = true,
|
||||
constantValues = true,
|
||||
functionTypeParameters = true,
|
||||
parameterNames = true,
|
||||
rangeVariableTypes = true,
|
||||
analyses = {
|
||||
unusedparams = true,
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
})
|
||||
lspconfig["lua_ls"].setup({
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
Lua = {
|
||||
hint = { enable = true },
|
||||
},
|
||||
},
|
||||
})
|
||||
lspconfig["ltex"].setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = function(_, _)
|
||||
require("ltex_extra").setup()
|
||||
end,
|
||||
settings = {
|
||||
ltex = {
|
||||
language = "en-GB",
|
||||
additionalRules = {
|
||||
enablePickyRules = true,
|
||||
languageModel = '~/Downloads/ngrams/',
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
lspconfig["hls"].setup({
|
||||
capabilities = capabilities,
|
||||
filetypes = { 'haskell', 'lhaskell', 'cabal' },
|
||||
})
|
||||
vim.lsp.config['clangd'].capabilities = capabilities
|
||||
vim.lsp.enable('clangd')
|
||||
|
||||
lspconfig["texlab"].setup({
|
||||
capabilities = capabilities,
|
||||
})
|
||||
lspconfig["bashls"].setup({
|
||||
capabilities = capabilities,
|
||||
})
|
||||
lspconfig["zls"].setup({
|
||||
capabilities = capabilities,
|
||||
})
|
||||
lspconfig["pyright"].setup({
|
||||
capabilities = capabilities,
|
||||
})
|
||||
vim.lsp.config["tinymist"] = {
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
-- exportPdf = "onType",
|
||||
-- outputPath = "$root/$name",
|
||||
formatterMode = "typstyle",
|
||||
fontPaths = {
|
||||
"./fonts"
|
||||
}
|
||||
},
|
||||
on_attach = function(client, bufnr)
|
||||
vim.keymap.set("n", "<leader>tp", function()
|
||||
client:exec_cmd({
|
||||
title = "pin",
|
||||
command = "tinymist.pinMain",
|
||||
arguments = { vim.api.nvim_buf_get_name(0) },
|
||||
}, { bufnr = bufnr })
|
||||
end, { desc = "[T]inymist [P]in", noremap = true })
|
||||
vim.keymap.set("n", "<leader>tu", function()
|
||||
client:exec_cmd({
|
||||
title = "unpin",
|
||||
command = "tinymist.pinMain",
|
||||
arguments = { vim.v.null },
|
||||
}, { bufnr = bufnr })
|
||||
end, { desc = "[T]inymist [U]npin", noremap = true })
|
||||
end,
|
||||
|
||||
}
|
||||
vim.lsp.enable("tinymist")
|
||||
vim.lsp.config['nil_ls'].capabilities = capabilities
|
||||
vim.lsp.enable('nil_ls')
|
||||
end,
|
||||
},
|
||||
{
|
||||
'chomosuke/typst-preview.nvim',
|
||||
ft = 'typst',
|
||||
version = '1.*',
|
||||
opts = {
|
||||
extra_args = {"--font-path=fonts"},
|
||||
invert_colors = '{"rest": "auto","image": "never"}'
|
||||
},
|
||||
},
|
||||
{
|
||||
"stevearc/conform.nvim",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("conform").setup({
|
||||
formatters_by_ft = {
|
||||
python = { "black" },
|
||||
haskell = { "fourmolu" },
|
||||
javascript = { "prettierd" },
|
||||
markdown = { "mdformat" },
|
||||
rust = { "rustfmt" },
|
||||
go = { "gofmt" },
|
||||
json = { "jq" },
|
||||
bash = { "shfmt", "beautysh" },
|
||||
zsh = { "beautysh" }
|
||||
}
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
'mfussenegger/nvim-lint',
|
||||
config = function()
|
||||
local lint = require("lint")
|
||||
|
||||
lint.linters_by_ft = {
|
||||
go = { "golangcilint" },
|
||||
}
|
||||
|
||||
local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true })
|
||||
|
||||
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
|
||||
group = lint_augroup,
|
||||
callback = function()
|
||||
lint.try_lint()
|
||||
end,
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "<leader>li", function()
|
||||
lint.try_lint()
|
||||
end, { desc = "Trigger linting for current file" })
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"lervag/vimtex",
|
||||
filetypes = { "tex" },
|
||||
config = function()
|
||||
if vim.loop.os_uname().sysname == "Darwin" then
|
||||
vim.g.vimtex_view_method = 'sioyek'
|
||||
else
|
||||
vim.g.vimtex_view_method = 'zathura'
|
||||
end
|
||||
vim.g.vimtex_quickfix_ignore_filters = {
|
||||
"warning",
|
||||
"Warning"
|
||||
}
|
||||
vim.g.vimtex_quickfix_open_on_warning = 0
|
||||
vim.g.vimtex_quickfix_ignore_filters = {
|
||||
'Overfull',
|
||||
'Underfull',
|
||||
}
|
||||
vim.g.vimtex_compiler_method = 'latexmk'
|
||||
vim.g.vimtex_compiler_latexmk = {
|
||||
out_dir = 'build',
|
||||
options = {
|
||||
"-verbose",
|
||||
"-shell-escape",
|
||||
"-file-line-error",
|
||||
"-synctex=1",
|
||||
"-interaction=nonstopmode",
|
||||
}
|
||||
}
|
||||
vim.g.vimtex_view_automatic = 1
|
||||
end,
|
||||
},
|
||||
{
|
||||
"barreiroleo/ltex-extra.nvim",
|
||||
event = "VeryLazy",
|
||||
},
|
||||
}
|
||||
@@ -1,93 +0,0 @@
|
||||
return {
|
||||
{
|
||||
"folke/todo-comments.nvim",
|
||||
event = "VeryLazy",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
opts = {
|
||||
vim.keymap.set("n", "]t", function()
|
||||
require("todo-comments").jump_next()
|
||||
end, { desc = "Next todo comment" }),
|
||||
|
||||
vim.keymap.set("n", "[t", function()
|
||||
require("todo-comments").jump_prev()
|
||||
end, { desc = "Previous todo comment" })
|
||||
},
|
||||
},
|
||||
{
|
||||
"folke/snacks.nvim",
|
||||
priority = 1000,
|
||||
lazy = false,
|
||||
opts = {
|
||||
bigfile = { enabled = true },
|
||||
notifier = { enabled = true },
|
||||
notify = { enabled = true },
|
||||
quickfile = { enabled = true },
|
||||
statuscolumn = { enabled = true },
|
||||
dashboard = { enabled = true },
|
||||
input = { enabled = true },
|
||||
image = {
|
||||
doc = {
|
||||
inline = false,
|
||||
float = true,
|
||||
max_width = 10,
|
||||
max_height = 5,
|
||||
}
|
||||
},
|
||||
lazygit = {
|
||||
vim.keymap.set('n', '<leader>lg', function()
|
||||
Snacks.lazygit.open()
|
||||
end)
|
||||
},
|
||||
words = {
|
||||
debounce = 10,
|
||||
vim.keymap.set('n', '<leader>gn', function()
|
||||
Snacks.words.jump(1, true)
|
||||
end)
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"FabijanZulj/blame.nvim",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("blame").setup()
|
||||
end
|
||||
},
|
||||
"tpope/vim-fugitive",
|
||||
{
|
||||
"afonsofrancof/worktrees.nvim",
|
||||
dev = true,
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
mappings = {
|
||||
create = "<leader>wtc",
|
||||
delete = "<leader>wtd",
|
||||
switch = "<leader>wts",
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"afonsofrancof/osc11.nvim",
|
||||
dev = false,
|
||||
dependencies = {
|
||||
"navarasu/onedark.nvim",
|
||||
},
|
||||
opts = {
|
||||
on_dark = function()
|
||||
vim.g.gruvbox_material_better_performance = 1
|
||||
vim.g.gruvbox_material_background = "hard"
|
||||
vim.g.gruvbox_material_foreground = "original"
|
||||
vim.g.gruvbox_material_transparent_background = 2
|
||||
vim.opt.background = "dark"
|
||||
vim.cmd('colorscheme gruvbox-material')
|
||||
end,
|
||||
on_light = function()
|
||||
require('onedark').setup {
|
||||
style = 'light'
|
||||
}
|
||||
-- Enable theme
|
||||
require('onedark').load()
|
||||
end,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
return {
|
||||
{
|
||||
"ThePrimeagen/harpoon",
|
||||
event = "VeryLazy",
|
||||
branch = "harpoon2",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
config = function()
|
||||
local harpoon = require("harpoon")
|
||||
harpoon.setup()
|
||||
vim.keymap.set("n", "<leader>a", function() harpoon:list():add() end)
|
||||
vim.keymap.set("n", "<C-e>", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end)
|
||||
|
||||
vim.keymap.set("n", "<C-h>", function() harpoon:list():select(1) end)
|
||||
vim.keymap.set("n", "<C-j>", function() harpoon:list():select(2) end)
|
||||
vim.keymap.set("n", "<C-k>", function() harpoon:list():select(3) end)
|
||||
vim.keymap.set("n", "<C-l>", function() harpoon:list():select(4) end)
|
||||
end
|
||||
},
|
||||
{
|
||||
"stevearc/oil.nvim",
|
||||
config = function()
|
||||
require("oil").setup({
|
||||
float = {
|
||||
preview_split = "right"
|
||||
},
|
||||
})
|
||||
-- Function to open oil.nvim in a vertical split
|
||||
local function open_oil_split()
|
||||
-- Calculate the width for the split (20% of the total width)
|
||||
local width = math.floor(vim.o.columns * 0.2) -- 20% of total width
|
||||
-- Create a vertical split and set width
|
||||
vim.cmd("vsplit") -- Create a vertical split
|
||||
vim.cmd(string.format("vertical resize %d", width)) -- Resize to 20%
|
||||
-- Open oil in the new split
|
||||
require("oil").open() -- Use open() to open oil.nvim
|
||||
end
|
||||
|
||||
-- Key mapping to open oil in a vertical split
|
||||
vim.api.nvim_set_keymap('n', '<leader>o', ':lua require("oil").open_float()<CR>', { noremap = true, silent = true })
|
||||
vim.keymap.set('n', '<leader>O', open_oil_split, { noremap = true, silent = true })
|
||||
|
||||
end
|
||||
},
|
||||
{
|
||||
'mrjones2014/smart-splits.nvim',
|
||||
config = function()
|
||||
require('smart-splits').setup({})
|
||||
--Resize
|
||||
vim.keymap.set('n', '<S-F5>', require('smart-splits').resize_left)
|
||||
vim.keymap.set('n', '<S-F6>', require('smart-splits').resize_down)
|
||||
vim.keymap.set('n', '<S-F7>', require('smart-splits').resize_up)
|
||||
vim.keymap.set('n', '<S-F8>', require('smart-splits').resize_right)
|
||||
--Move
|
||||
vim.keymap.set('n', '<F5>', require('smart-splits').move_cursor_left)
|
||||
vim.keymap.set('n', '<F6>', require('smart-splits').move_cursor_down)
|
||||
vim.keymap.set('n', '<F7>', require('smart-splits').move_cursor_up)
|
||||
vim.keymap.set('n', '<F8>', require('smart-splits').move_cursor_right)
|
||||
end
|
||||
},
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
return {
|
||||
{
|
||||
"ibhagwan/fzf-lua",
|
||||
event = "VeryLazy",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
config = function()
|
||||
local fzflua = require('fzf-lua')
|
||||
fzflua.register_ui_select()
|
||||
fzflua.setup({
|
||||
defaults = {
|
||||
winopts = {
|
||||
border = "rounded",
|
||||
width = 0.6,
|
||||
height = 0.5,
|
||||
},
|
||||
},
|
||||
files = {
|
||||
previewer = false,
|
||||
winopts = {
|
||||
width = 0.5,
|
||||
height = 0.5,
|
||||
}
|
||||
},
|
||||
grep = {
|
||||
winopts = {
|
||||
width = 0.7,
|
||||
preview = {
|
||||
layout = "horizontal",
|
||||
horizontal = "right:40%"
|
||||
}
|
||||
},
|
||||
}
|
||||
})
|
||||
vim.keymap.set('n', '<leader>ff', fzflua.files, {})
|
||||
vim.keymap.set('n', '<leader>fe', fzflua.diagnostics_workspace, {})
|
||||
vim.keymap.set('n', '<leader>fg', fzflua.live_grep, {})
|
||||
vim.keymap.set('n', '<leader>fb', fzflua.buffers, {})
|
||||
vim.keymap.set('n', '<leader>fh', fzflua.help_tags, {})
|
||||
vim.keymap.set({'n','v'}, '<leader>fc', fzflua.commands, {})
|
||||
end
|
||||
}
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
return {
|
||||
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
event = { "BufReadPost", "BufNewFile" },
|
||||
dependencies = {
|
||||
'nvim-treesitter/nvim-treesitter-textobjects'
|
||||
},
|
||||
config = function()
|
||||
local treesitter = require("nvim-treesitter.configs")
|
||||
|
||||
require('nvim-treesitter.install').update({ with_sync = true })
|
||||
|
||||
|
||||
local options = {
|
||||
auto_install = true,
|
||||
highlight = {
|
||||
enable = true,
|
||||
disable = { "latex" },
|
||||
use_languagetree = true,
|
||||
},
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = "gnn",
|
||||
node_incremental = "grn",
|
||||
scope_incremental = "grc",
|
||||
node_decremental = "grm",
|
||||
},
|
||||
},
|
||||
indent = {
|
||||
enable = true,
|
||||
},
|
||||
}
|
||||
|
||||
treesitter.setup(options)
|
||||
end
|
||||
},
|
||||
{
|
||||
'echasnovski/mini.ai',
|
||||
event = "VeryLazy",
|
||||
version = false,
|
||||
dependencies = {
|
||||
'nvim-treesitter/nvim-treesitter-textobjects'
|
||||
},
|
||||
config = function()
|
||||
local gen_spec = require('mini.ai').gen_spec
|
||||
require('mini.ai').setup({
|
||||
custom_textobjects = {
|
||||
F = gen_spec.treesitter({ a = '@function.outer', i = '@function.inner' }),
|
||||
},
|
||||
n_lines = 1000
|
||||
})
|
||||
end
|
||||
},
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
return {
|
||||
|
||||
{
|
||||
"folke/noice.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
cmdline = {
|
||||
enabled = true,
|
||||
view = "cmdline",
|
||||
},
|
||||
lsp = {
|
||||
override = {
|
||||
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
|
||||
["vim.lsp.util.stylize_markdown"] = true,
|
||||
},
|
||||
signature = {
|
||||
enabled = false
|
||||
}
|
||||
},
|
||||
presets = {
|
||||
inc_rename = true,
|
||||
},
|
||||
},
|
||||
dependencies = {
|
||||
"MunifTanjim/nui.nvim",
|
||||
}
|
||||
},
|
||||
{
|
||||
"OXY2DEV/markview.nvim",
|
||||
ft = "markdown",
|
||||
dependencies = {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
"nvim-tree/nvim-web-devicons"
|
||||
}
|
||||
},
|
||||
{
|
||||
'norcalli/nvim-colorizer.lua',
|
||||
config = function()
|
||||
require 'colorizer'.setup()
|
||||
end
|
||||
},
|
||||
}
|
||||
@@ -1,81 +0,0 @@
|
||||
local M = {}
|
||||
local icons = require("mini.icons")
|
||||
|
||||
--- Window bar that shows the current file path (in a fancy way).
|
||||
---@return string
|
||||
function M.render()
|
||||
-- Get the path and expand variables.
|
||||
local path = vim.fs.normalize(vim.fn.expand '%:p' --[[@as string]])
|
||||
|
||||
-- No special styling for diff views.
|
||||
if vim.startswith(path, 'diffview') then
|
||||
return string.format('%%#Winbar#%s', path)
|
||||
end
|
||||
|
||||
-- Replace slashes by arrows.
|
||||
local separator = ' %#WinbarSeparator# '
|
||||
|
||||
local prefix, prefix_path = '', ''
|
||||
local folder_icon = ''
|
||||
|
||||
-- If the window gets too narrow, shorten the path and drop the prefix.
|
||||
if vim.api.nvim_win_get_width(0) < math.floor(vim.o.columns / 3) then
|
||||
path = vim.fn.pathshorten(path)
|
||||
else
|
||||
-- For some special folders, add a prefix instead of the full path (making
|
||||
-- sure to pick the longest prefix).
|
||||
---@type table<string, string>
|
||||
local special_dirs = {
|
||||
DOTFILES = vim.env.XDG_CONFIG_HOME,
|
||||
GITS = vim.env.HOME .. '/gits',
|
||||
HOME = vim.env.HOME,
|
||||
PROJECTS = vim.env.HOME .. '/projects',
|
||||
}
|
||||
for dir_name, dir_path in pairs(special_dirs) do
|
||||
if vim.startswith(path, vim.fs.normalize(dir_path)) and #dir_path > #prefix_path then
|
||||
prefix, prefix_path, folder_icon = dir_name, dir_path, icons.get('file',path)
|
||||
end
|
||||
end
|
||||
if prefix ~= '' then
|
||||
path = path:gsub('^' .. prefix_path, '')
|
||||
prefix = string.format('%%#WinBarFile#%s %s%s', folder_icon, prefix, separator)
|
||||
end
|
||||
end
|
||||
|
||||
-- Remove leading slash.
|
||||
path = path:gsub('^/', '')
|
||||
|
||||
vim.api.nvim_set_hl(0, "Winbar", { link = "Normal" })
|
||||
vim.api.nvim_set_hl(0, "WinbarSeparator", { link = "Normal" })
|
||||
vim.api.nvim_set_hl(0, "WinBarFile", { link = "Normal" })
|
||||
|
||||
return table.concat {
|
||||
' ',
|
||||
prefix,
|
||||
table.concat(
|
||||
vim.iter(vim.split(path, '/'))
|
||||
:map(function(segment)
|
||||
return string.format('%%#Winbar#%s', segment)
|
||||
end)
|
||||
:totable(),
|
||||
separator
|
||||
),
|
||||
}
|
||||
end
|
||||
|
||||
vim.api.nvim_create_autocmd('BufWinEnter', {
|
||||
group = vim.api.nvim_create_augroup('afonso/winbar', { clear = true }),
|
||||
desc = 'Attach winbar',
|
||||
callback = function(args)
|
||||
if
|
||||
not vim.api.nvim_win_get_config(0).zindex -- Not a floating window
|
||||
and vim.bo[args.buf].buftype == '' -- Normal buffer
|
||||
and vim.api.nvim_buf_get_name(args.buf) ~= '' -- Has a file name
|
||||
and not vim.wo[0].diff -- Not in diff mode
|
||||
then
|
||||
vim.wo.winbar = "%{%v:lua.require'winbar'.render()%}"
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
return M
|
||||
151
.config/nvim/nvim-pack-lock.json
Normal file
151
.config/nvim/nvim-pack-lock.json
Normal file
@@ -0,0 +1,151 @@
|
||||
{
|
||||
"plugins": {
|
||||
"blame.nvim": {
|
||||
"rev": "179da7aaacce7c52874af636255ede72dd6fe796",
|
||||
"src": "https://github.com/FabijanZulj/blame.nvim"
|
||||
},
|
||||
"blink.cmp": {
|
||||
"rev": "451168851e8e2466bc97ee3e026c3dcb9141ce07",
|
||||
"src": "https://github.com/saghen/blink.cmp",
|
||||
"version": ">=0.0.0"
|
||||
},
|
||||
"conform.nvim": {
|
||||
"rev": "086a40dc7ed8242c03be9f47fbcee68699cc2395",
|
||||
"src": "https://github.com/stevearc/conform.nvim"
|
||||
},
|
||||
"everforest": {
|
||||
"rev": "b03a03148c8b34c24c96960b93da9c8883d11f54",
|
||||
"src": "https://github.com/sainnhe/everforest"
|
||||
},
|
||||
"friendly-snippets": {
|
||||
"rev": "6cd7280adead7f586db6fccbd15d2cac7e2188b9",
|
||||
"src": "https://github.com/rafamadriz/friendly-snippets"
|
||||
},
|
||||
"fzf-lua": {
|
||||
"rev": "6e41ba7505f35a6f054ca682b043aa0cea36c2ef",
|
||||
"src": "https://github.com/ibhagwan/fzf-lua"
|
||||
},
|
||||
"gruvbox-material": {
|
||||
"rev": "790afe9dd085aa04eccd1da3626c5fa05c620e53",
|
||||
"src": "https://github.com/sainnhe/gruvbox-material"
|
||||
},
|
||||
"harpoon": {
|
||||
"rev": "87b1a3506211538f460786c23f98ec63ad9af4e5",
|
||||
"src": "https://github.com/ThePrimeagen/harpoon",
|
||||
"version": "'harpoon2'"
|
||||
},
|
||||
"inc-rename.nvim": {
|
||||
"rev": "0074b551a17338ccdcd299bd86687cc651bcb33d",
|
||||
"src": "https://github.com/smjonas/inc-rename.nvim"
|
||||
},
|
||||
"lazydev.nvim": {
|
||||
"rev": "ff2cbcba459b637ec3fd165a2be59b7bbaeedf0d",
|
||||
"src": "https://github.com/folke/lazydev.nvim"
|
||||
},
|
||||
"ltex-extra.nvim": {
|
||||
"rev": "49ea83c231139d98b7c9668c99e7b4591421b056",
|
||||
"src": "https://github.com/barreiroleo/ltex-extra.nvim"
|
||||
},
|
||||
"mason.nvim": {
|
||||
"rev": "44d1e90e1f66e077268191e3ee9d2ac97cc18e65",
|
||||
"src": "https://github.com/williamboman/mason.nvim"
|
||||
},
|
||||
"mini.ai": {
|
||||
"rev": "4b0a6207341d895b6cfe9bcb1e4d3e8607bfe4f4",
|
||||
"src": "https://github.com/echasnovski/mini.ai",
|
||||
"version": ">=0.0.0"
|
||||
},
|
||||
"mini.icons": {
|
||||
"rev": "ff2e4f1d29f659cc2bad0f9256f2f6195c6b2428",
|
||||
"src": "https://github.com/echasnovski/mini.icons",
|
||||
"version": ">=0.0.0"
|
||||
},
|
||||
"mini.pairs": {
|
||||
"rev": "d5a29b6254dad07757832db505ea5aeab9aad43a",
|
||||
"src": "https://github.com/echasnovski/mini.pairs",
|
||||
"version": ">=0.0.0"
|
||||
},
|
||||
"mini.surround": {
|
||||
"rev": "88c52297ed3e69ecf9f8652837888ecc727a28ee",
|
||||
"src": "https://github.com/echasnovski/mini.surround",
|
||||
"version": ">=0.0.0"
|
||||
},
|
||||
"nvim-dap": {
|
||||
"rev": "a9d8cb68ee7184111dc66156c4a2ebabfbe01bc5",
|
||||
"src": "https://github.com/mfussenegger/nvim-dap"
|
||||
},
|
||||
"nvim-dap-view": {
|
||||
"rev": "1b538131335f807ab54baa2bc06b811d5dd75079",
|
||||
"src": "https://github.com/igorlfs/nvim-dap-view"
|
||||
},
|
||||
"nvim-lint": {
|
||||
"rev": "606b823a57b027502a9ae00978ebf4f5d5158098",
|
||||
"src": "https://github.com/mfussenegger/nvim-lint"
|
||||
},
|
||||
"nvim-lspconfig": {
|
||||
"rev": "dd261ad5266ab5bbec249d21efeceda98ff3e1a6",
|
||||
"src": "https://github.com/neovim/nvim-lspconfig"
|
||||
},
|
||||
"nvim-treesitter": {
|
||||
"rev": "2f5d4c3f3c675962242096bcc8e586d76dd72eb2",
|
||||
"src": "https://github.com/nvim-treesitter/nvim-treesitter"
|
||||
},
|
||||
"nvim-treesitter-textobjects": {
|
||||
"rev": "4e91b5d0394329a229725b021a8ea217099826ef",
|
||||
"src": "https://github.com/nvim-treesitter/nvim-treesitter-textobjects"
|
||||
},
|
||||
"nvim-web-devicons": {
|
||||
"rev": "d7462543c9e366c0d196c7f67a945eaaf5d99414",
|
||||
"src": "https://github.com/nvim-tree/nvim-web-devicons"
|
||||
},
|
||||
"oil.nvim": {
|
||||
"rev": "0fcc83805ad11cf714a949c98c605ed717e0b83e",
|
||||
"src": "https://github.com/stevearc/oil.nvim"
|
||||
},
|
||||
"onedark.nvim": {
|
||||
"rev": "213c23ae45a04797572242568d5d51937181792d",
|
||||
"src": "https://github.com/navarasu/onedark.nvim"
|
||||
},
|
||||
"plenary.nvim": {
|
||||
"rev": "b9fd5226c2f76c951fc8ed5923d85e4de065e509",
|
||||
"src": "https://github.com/nvim-lua/plenary.nvim"
|
||||
},
|
||||
"smart-splits.nvim": {
|
||||
"rev": "82d01bb71bc051955654b3af68355f783d872fe0",
|
||||
"src": "https://github.com/mrjones2014/smart-splits.nvim"
|
||||
},
|
||||
"snacks.nvim": {
|
||||
"rev": "a049339328e2599ad6e85a69fa034ac501e921b2",
|
||||
"src": "https://github.com/folke/snacks.nvim"
|
||||
},
|
||||
"tiny-glimmer.nvim": {
|
||||
"rev": "932e6c2cc4a43ce578f007db1f8f61ad6798f938",
|
||||
"src": "https://github.com/rachartier/tiny-glimmer.nvim"
|
||||
},
|
||||
"todo-comments.nvim": {
|
||||
"rev": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668",
|
||||
"src": "https://github.com/folke/todo-comments.nvim"
|
||||
},
|
||||
"typst-preview.nvim": {
|
||||
"rev": "e123a7ab64e52d836e00dea9251e85b201f38966",
|
||||
"src": "https://github.com/chomosuke/typst-preview.nvim",
|
||||
"version": "1.0.0 - 2.0.0"
|
||||
},
|
||||
"undotree": {
|
||||
"rev": "6fa6b57cda8459e1e4b2ca34df702f55242f4e4d",
|
||||
"src": "https://github.com/mbbill/undotree"
|
||||
},
|
||||
"vim-abolish": {
|
||||
"rev": "dcbfe065297d31823561ba787f51056c147aa682",
|
||||
"src": "https://github.com/tpope/vim-abolish"
|
||||
},
|
||||
"vim-fugitive": {
|
||||
"rev": "3b753cf8c6a4dcde6edee8827d464ba9b8c4a6f0",
|
||||
"src": "https://github.com/tpope/vim-fugitive"
|
||||
},
|
||||
"vimtex": {
|
||||
"rev": "82d2305ff71dfb3bd91602534cc9bb9a195bcb38",
|
||||
"src": "https://github.com/lervag/vimtex"
|
||||
}
|
||||
}
|
||||
}
|
||||
1
.config/nvim/pack/local/opt/osc11.nvim
Submodule
1
.config/nvim/pack/local/opt/osc11.nvim
Submodule
Submodule .config/nvim/pack/local/opt/osc11.nvim added at 548380b6ef
1
.config/nvim/pack/local/opt/worktrees.nvim
Submodule
1
.config/nvim/pack/local/opt/worktrees.nvim
Submodule
Submodule .config/nvim/pack/local/opt/worktrees.nvim added at 8707262707
@@ -4,6 +4,8 @@ if [[ -o interactive ]]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
bindkey -e
|
||||
|
||||
source $ZDOTDIR/setup-history.zsh
|
||||
source $ZDOTDIR/prompts/simple-two-line.zsh
|
||||
source $ZDOTDIR/functions.zsh
|
||||
|
||||
@@ -36,9 +36,18 @@ alias nvim_update='nvim --headless "+Lazy! sync" +qa'
|
||||
|
||||
alias ..="cd .."
|
||||
|
||||
function cd()
|
||||
{
|
||||
function cd(){
|
||||
builtin cd "$@" && ls;
|
||||
}
|
||||
|
||||
alias bb="brew bundle --file=~/Brewfile"
|
||||
|
||||
function ssh(){
|
||||
if [ -n "$TMUX" ]; then
|
||||
tmux rename-window "$(echo "$@" | awk '{print $NF}' | sed 's/.*@//')"
|
||||
command ssh "$@"
|
||||
tmux set-window-option automatic-rename on >/dev/null
|
||||
else
|
||||
command ssh "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
Submodule .config/zsh/prompts/pure deleted from 5c2158096c
10
.gitmodules
vendored
10
.gitmodules
vendored
@@ -18,10 +18,6 @@
|
||||
path = .config/zsh/plugins/zsh-vi-mode
|
||||
url = https://github.com/jeffreytse/zsh-vi-mode
|
||||
branch = master
|
||||
[submodule ".config/zsh/prompts/pure"]
|
||||
path = .config/zsh/prompts/pure
|
||||
url = https://github.com/sindresorhus/pure
|
||||
branch = main
|
||||
[submodule ".config/tmux/plugins/tpm"]
|
||||
path = .config/tmux/plugins/tpm
|
||||
url = https://github.com/tmux-plugins/tpm
|
||||
@@ -38,3 +34,9 @@
|
||||
path = .config/xmobar/xmobar-git
|
||||
url = https://codeberg.org/xmobar/xmobar
|
||||
branch = master
|
||||
[submodule ".config/nvim/pack/local/opt/worktrees.nvim"]
|
||||
path = .config/nvim/pack/local/opt/worktrees.nvim
|
||||
url = git@github.com:afonsofrancof/worktrees.nvim
|
||||
[submodule ".config/nvim/pack/local/opt/osc11.nvim"]
|
||||
path = .config/nvim/pack/local/opt/osc11.nvim
|
||||
url = git@github.com:afonsofrancof/osc11.nvim
|
||||
|
||||
14
.ssh/config
14
.ssh/config
@@ -6,12 +6,12 @@ ControlMaster auto
|
||||
ControlPath ~/.ssh/session.%r@%h:%p
|
||||
ControlPersist 5m
|
||||
|
||||
Host git.olympuslab.net gon
|
||||
HostName git.olympuslab.net
|
||||
User git
|
||||
Port 522
|
||||
Host git.francof.net gf
|
||||
HostName git.francof.net
|
||||
User git
|
||||
Port 522
|
||||
|
||||
Host github.com gh
|
||||
HostName github.com
|
||||
User git
|
||||
Port 22
|
||||
HostName github.com
|
||||
User git
|
||||
Port 22
|
||||
|
||||
Reference in New Issue
Block a user