Updated config
This commit is contained in:
parent
285360a1dc
commit
557f33c14a
35 changed files with 159 additions and 694 deletions
|
@ -1,79 +1,111 @@
|
||||||
# Git
|
# Git
|
||||||
alias g "git"
|
if command -q git
|
||||||
alias gc "git clone"
|
alias g "git"
|
||||||
alias gd "git diff --ignore-space-at-eol"
|
alias gc "git clone"
|
||||||
alias gl "git log --oneline"
|
alias gd "git diff --ignore-space-at-eol"
|
||||||
alias gp "git pull"
|
alias gl "git log --oneline"
|
||||||
alias gs "git status"
|
alias gp "git pull"
|
||||||
|
alias gs "git status"
|
||||||
|
alias home "git --git-dir=$HOME/.home/ --work-tree=$HOME"
|
||||||
|
alias homeinit "git clone --bare https://git.urbach.dev/sys/home $HOME/.home && home checkout"
|
||||||
|
alias h "home"
|
||||||
|
alias hs "home status"
|
||||||
|
alias hd "home diff --ignore-space-at-eol"
|
||||||
|
alias hp "home pull"
|
||||||
|
end
|
||||||
|
|
||||||
# Go
|
# Go
|
||||||
alias gb "go build -v"
|
if command -q go
|
||||||
alias godeps "go list -f '{{ join .Deps \"\n\"}}' ."
|
alias gb "go build -v"
|
||||||
alias gt "go test -v"
|
alias godeps "go list -f '{{ join .Deps \"\n\"}}' ."
|
||||||
alias gts "gotestsum"
|
alias gt "go test -v"
|
||||||
|
alias gts "gotestsum"
|
||||||
# Home
|
end
|
||||||
alias home "git --git-dir=$HOME/.home/ --work-tree=$HOME"
|
|
||||||
alias homeinit "git clone --bare https://git.urbach.dev/sys/home $HOME/.home && home checkout"
|
|
||||||
alias h "home"
|
|
||||||
alias hs "home status"
|
|
||||||
alias hd "home diff --ignore-space-at-eol"
|
|
||||||
alias hp "home pull"
|
|
||||||
|
|
||||||
# Hyperfine
|
# Hyperfine
|
||||||
alias bench "hyperfine --shell=none"
|
if command -q hyperfine
|
||||||
|
alias bench "hyperfine --shell=none"
|
||||||
|
end
|
||||||
|
|
||||||
# Kernel
|
# Kernel
|
||||||
alias kerr "sudo dmesg --level=emerg,alert,crit,err"
|
if command -q dmesg
|
||||||
alias klog "sudo dmesg"
|
alias kerr "sudo dmesg --level=emerg,alert,crit,err"
|
||||||
|
alias klog "sudo dmesg"
|
||||||
|
end
|
||||||
|
|
||||||
# List
|
# List
|
||||||
alias l "ls"
|
if command -q ls
|
||||||
alias ll "ls -l"
|
alias l "ls"
|
||||||
alias l2 "ls -T -L2"
|
alias ll "ls -l"
|
||||||
alias lu "ls -l --total-size --sort=size --reverse --no-permissions --no-user --no-time"
|
alias l2 "ls -T -L2"
|
||||||
alias lp "ls -l --no-filesize --no-time"
|
alias lu "ls -l --total-size --sort=size --reverse --no-permissions --no-user --no-time"
|
||||||
|
alias lp "ls -l --no-filesize --no-time"
|
||||||
|
end
|
||||||
|
|
||||||
# Lsof
|
# Lsof
|
||||||
alias tcp "lsof -PniTCP"
|
if command -q lsof
|
||||||
alias udp "lsof -PniUDP"
|
alias tcp "lsof -PniTCP"
|
||||||
|
alias udp "lsof -PniUDP"
|
||||||
|
end
|
||||||
|
|
||||||
# Neovim
|
# Neovim
|
||||||
alias e "nvim"
|
if command -q nvim
|
||||||
alias n "nvim"
|
alias e "nvim"
|
||||||
|
alias n "nvim"
|
||||||
|
end
|
||||||
|
|
||||||
# Pacman
|
# Pacman
|
||||||
alias p "pacman"
|
if command -q apk
|
||||||
alias pi "sudo pacman -S"
|
alias p "apk"
|
||||||
alias pr "sudo pacman -Rs"
|
alias pi "sudo apk add"
|
||||||
alias pu "sudo pacman -Syu"
|
alias pr "sudo apk del"
|
||||||
alias pl "pacman -Qq"
|
alias pu "sudo apk update"
|
||||||
alias pe "pacman -Qe"
|
alias pl "apk info"
|
||||||
alias pc "sudo pacman -Sc"
|
alias powner "apk info --who-owns"
|
||||||
alias paur "pacman -Qm"
|
else if command -q pacman
|
||||||
alias pfiles "pacman -Ql"
|
alias p "pacman"
|
||||||
alias porphan "pacman -Qtdq"
|
alias pi "sudo pacman -S"
|
||||||
alias powner "pacman -Qo"
|
alias pr "sudo pacman -Rs"
|
||||||
|
alias pu "sudo pacman -Syu"
|
||||||
|
alias pl "pacman -Qq"
|
||||||
|
alias pe "pacman -Qe"
|
||||||
|
alias pc "sudo pacman -Sc"
|
||||||
|
alias paur "pacman -Qm"
|
||||||
|
alias pfiles "pacman -Ql"
|
||||||
|
alias porphan "pacman -Qtdq"
|
||||||
|
alias powner "pacman -Qo"
|
||||||
|
end
|
||||||
|
|
||||||
|
# Sudo
|
||||||
|
if command -q doas
|
||||||
|
alias sudo "doas"
|
||||||
|
end
|
||||||
|
|
||||||
# Systemctl
|
# Systemctl
|
||||||
alias start "sudo systemctl start"
|
if command -q service
|
||||||
alias stop "sudo systemctl stop"
|
alias services "service -l"
|
||||||
alias enable "sudo systemctl enable"
|
else if command -q systemctl
|
||||||
alias disable "sudo systemctl disable"
|
alias start "sudo systemctl start"
|
||||||
alias restart "sudo systemctl restart"
|
alias stop "sudo systemctl stop"
|
||||||
alias running "systemctl list-units --type=service --state=running"
|
alias enable "sudo systemctl enable"
|
||||||
alias disabled "systemctl list-unit-files --type=service --state=disabled"
|
alias disable "sudo systemctl disable"
|
||||||
alias enabled "systemctl list-unit-files --type=service --state=enabled"
|
alias restart "sudo systemctl restart"
|
||||||
alias timers "systemctl list-timers"
|
alias running "systemctl list-units --type=service --state=running"
|
||||||
|
alias disabled "systemctl list-unit-files --type=service --state=disabled"
|
||||||
|
alias enabled "systemctl list-unit-files --type=service --state=enabled"
|
||||||
|
alias timers "systemctl list-timers"
|
||||||
|
alias bios "systemctl reboot --firmware-setup"
|
||||||
|
end
|
||||||
|
|
||||||
# Tmux
|
# Tmux
|
||||||
alias ta "tmux attach"
|
if command -q tmux
|
||||||
alias td "tmux detach"
|
alias ta "tmux attach"
|
||||||
alias tl "tmux ls"
|
alias td "tmux detach"
|
||||||
alias tk "tmux kill-server"
|
alias tl "tmux ls"
|
||||||
|
alias tk "tmux kill-server"
|
||||||
|
end
|
||||||
|
|
||||||
# ...
|
# ...
|
||||||
alias bios "systemctl reboot --firmware-setup"
|
|
||||||
alias cfg "config"
|
alias cfg "config"
|
||||||
alias cls "clear"
|
alias cls "clear"
|
||||||
alias debug "blinkenlights"
|
alias debug "blinkenlights"
|
||||||
|
|
|
@ -3,10 +3,10 @@ if status is-interactive
|
||||||
source $HOME/.config/fish/alias.fish
|
source $HOME/.config/fish/alias.fish
|
||||||
end
|
end
|
||||||
|
|
||||||
# PATH: Add scripts
|
# Add scripts to PATH
|
||||||
fish_add_path $XDG_CONFIG_HOME/fish/scripts
|
fish_add_path $XDG_CONFIG_HOME/fish/scripts
|
||||||
|
|
||||||
# PATH: Add Go binaries
|
# Add Go binaries to PATH
|
||||||
if command -q go
|
if command -q go
|
||||||
fish_add_path (go env GOPATH)/bin
|
fish_add_path (go env GOPATH)/bin
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function config
|
function config
|
||||||
$EDITOR $HOME/.config/$argv
|
f $HOME/.config/$argv
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,8 +1,19 @@
|
||||||
function f
|
function f --wraps nnn --description 'support nnn quit and change directory'
|
||||||
set tmp (mktemp -t "yazi-cwd.XXXXXX")
|
if test -n "$NNNLVL" -a "$NNNLVL" -ge 1
|
||||||
yazi $argv --cwd-file="$tmp"
|
echo "nnn is already running"
|
||||||
if set cwd (command cat -- "$tmp"); and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ]
|
return
|
||||||
builtin cd -- "$cwd"
|
end
|
||||||
|
|
||||||
|
if test -n "$XDG_CONFIG_HOME"
|
||||||
|
set -x NNN_TMPFILE "$XDG_CONFIG_HOME/nnn/.lastd"
|
||||||
|
else
|
||||||
|
set -x NNN_TMPFILE "$HOME/.config/nnn/.lastd"
|
||||||
|
end
|
||||||
|
|
||||||
|
command nnn $argv
|
||||||
|
|
||||||
|
if test -e $NNN_TMPFILE
|
||||||
|
source $NNN_TMPFILE
|
||||||
|
rm -- $NNN_TMPFILE
|
||||||
end
|
end
|
||||||
rm -f -- "$tmp"
|
|
||||||
end
|
end
|
|
@ -1,4 +1,4 @@
|
||||||
function ls
|
function ls --wraps eza
|
||||||
if command -q eza
|
if command -q eza
|
||||||
eza --group-directories-first --time-style relative -T -L1 $argv
|
eza --group-directories-first --time-style relative -T -L1 $argv
|
||||||
else
|
else
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
|
require("boot")
|
||||||
require("settings")
|
require("settings")
|
||||||
require("lsp")
|
require("lsp")
|
||||||
require("packages")
|
|
||||||
require("keys")
|
require("keys")
|
||||||
require("autocmds")
|
require("autocmds")
|
||||||
require("usercmds")
|
require("usercmds")
|
|
@ -64,7 +64,7 @@ on({ "VimEnter" }, {
|
||||||
end
|
end
|
||||||
|
|
||||||
if is_directory ~= 0 then
|
if is_directory ~= 0 then
|
||||||
require("telescope.builtin").find_files()
|
--require("telescope.builtin").find_files()
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
46
.config/nvim/lua/boot.lua
Normal file
46
.config/nvim/lua/boot.lua
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
-- Disable providers
|
||||||
|
local disabled_providers = {
|
||||||
|
"node",
|
||||||
|
"perl",
|
||||||
|
"python3",
|
||||||
|
"ruby",
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, provider in ipairs(disabled_providers) do
|
||||||
|
vim.g["loaded_" .. provider .. "_provider"] = 0
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Disable plugins
|
||||||
|
local disabled_plugins = {
|
||||||
|
"2html_plugin",
|
||||||
|
"tohtml",
|
||||||
|
"getscript",
|
||||||
|
"getscriptPlugin",
|
||||||
|
"gzip",
|
||||||
|
"logipat",
|
||||||
|
"netrw",
|
||||||
|
"netrwPlugin",
|
||||||
|
"netrwSettings",
|
||||||
|
"netrwFileHandlers",
|
||||||
|
"matchit",
|
||||||
|
"tar",
|
||||||
|
"tarPlugin",
|
||||||
|
"rrhelper",
|
||||||
|
"spellfile_plugin",
|
||||||
|
"vimball",
|
||||||
|
"vimballPlugin",
|
||||||
|
"zip",
|
||||||
|
"zipPlugin",
|
||||||
|
"tutor",
|
||||||
|
"rplugin",
|
||||||
|
"syntax",
|
||||||
|
"synmenu",
|
||||||
|
"optwin",
|
||||||
|
"compiler",
|
||||||
|
"bugreport",
|
||||||
|
"ftplugin",
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, plugin in ipairs(disabled_plugins) do
|
||||||
|
vim.g["loaded_" .. plugin] = 1
|
||||||
|
end
|
|
@ -1,101 +0,0 @@
|
||||||
local icons = {
|
|
||||||
Namespace = "",
|
|
||||||
Text = "",
|
|
||||||
Method = "",
|
|
||||||
Function = "",
|
|
||||||
Constructor = "",
|
|
||||||
Field = "",
|
|
||||||
Variable = "",
|
|
||||||
Class = "",
|
|
||||||
Interface = "",
|
|
||||||
Module = "",
|
|
||||||
Property = "",
|
|
||||||
Unit = "",
|
|
||||||
Value = "",
|
|
||||||
Enum = "",
|
|
||||||
Keyword = "",
|
|
||||||
Snippet = "",
|
|
||||||
Color = "",
|
|
||||||
File = "",
|
|
||||||
Reference = "",
|
|
||||||
Folder = "",
|
|
||||||
EnumMember = "",
|
|
||||||
Constant = "",
|
|
||||||
Struct = "",
|
|
||||||
Event = "",
|
|
||||||
Operator = "",
|
|
||||||
TypeParameter = "",
|
|
||||||
Table = "",
|
|
||||||
Object = "",
|
|
||||||
Tag = "",
|
|
||||||
Array = "[]",
|
|
||||||
Boolean = "",
|
|
||||||
Number = "",
|
|
||||||
Null = "",
|
|
||||||
String = "",
|
|
||||||
Calendar = "",
|
|
||||||
Watch = "",
|
|
||||||
Package = "",
|
|
||||||
Copilot = "",
|
|
||||||
Codeium = "",
|
|
||||||
TabNine = "",
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
"hrsh7th/nvim-cmp",
|
|
||||||
event = "InsertEnter",
|
|
||||||
dependencies = {
|
|
||||||
-- "hrsh7th/cmp-nvim-lsp",
|
|
||||||
-- "hrsh7th/cmp-buffer",
|
|
||||||
-- "hrsh7th/cmp-path",
|
|
||||||
-- "L3MON4D3/LuaSnip",
|
|
||||||
},
|
|
||||||
opts = {
|
|
||||||
completion = {
|
|
||||||
autocomplete = true,
|
|
||||||
completeopt = "menu,menuone,noinsert",
|
|
||||||
},
|
|
||||||
formatting = {
|
|
||||||
fields = { "abbr", "kind", "menu" },
|
|
||||||
format = function(_, item)
|
|
||||||
local icon = icons[item.kind] or ""
|
|
||||||
item.kind = string.format(" %s %s", icon, item.kind)
|
|
||||||
return item
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
-- snippet = {
|
|
||||||
-- expand = function(args)
|
|
||||||
-- require("luasnip").lsp_expand(args.body)
|
|
||||||
-- end,
|
|
||||||
-- },
|
|
||||||
-- preselect = cmp.PreselectMode.None,
|
|
||||||
sources = {
|
|
||||||
-- { name = "nvim_lsp" },
|
|
||||||
-- { name = "luasnip" },
|
|
||||||
{ name = "buffer" },
|
|
||||||
-- { name = "path" },
|
|
||||||
},
|
|
||||||
window = {
|
|
||||||
completion = {
|
|
||||||
border = "rounded",
|
|
||||||
scrollbar = false,
|
|
||||||
},
|
|
||||||
documentation = {
|
|
||||||
border = "rounded",
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
config = function(_, opts)
|
|
||||||
local cmp = require("cmp")
|
|
||||||
|
|
||||||
opts.mapping = {
|
|
||||||
["<C-space>"] = cmp.mapping.complete(),
|
|
||||||
["<C-up>"] = cmp.mapping.select_prev_item(),
|
|
||||||
["<C-down>"] = cmp.mapping.select_next_item(),
|
|
||||||
["<C-x>"] = cmp.mapping.abort(),
|
|
||||||
["<cr>"] = cmp.mapping.confirm({ select = true }),
|
|
||||||
}
|
|
||||||
|
|
||||||
cmp.setup(opts)
|
|
||||||
end,
|
|
||||||
}
|
|
|
@ -1,11 +0,0 @@
|
||||||
return {
|
|
||||||
"j-hui/fidget.nvim",
|
|
||||||
opts = {
|
|
||||||
integration = {
|
|
||||||
["nvim-tree"] = {
|
|
||||||
enable = true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
config = true,
|
|
||||||
}
|
|
|
@ -1,15 +0,0 @@
|
||||||
return {
|
|
||||||
"lukas-reineke/indent-blankline.nvim",
|
|
||||||
event = "VeryLazy",
|
|
||||||
main = "ibl",
|
|
||||||
opts = {
|
|
||||||
indent = {
|
|
||||||
char = "▏",
|
|
||||||
},
|
|
||||||
scope = {
|
|
||||||
enabled = true,
|
|
||||||
show_start = false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
config = true,
|
|
||||||
}
|
|
|
@ -1,4 +0,0 @@
|
||||||
return {
|
|
||||||
"mrded/nvim-lsp-notify",
|
|
||||||
config = true,
|
|
||||||
}
|
|
|
@ -1,103 +0,0 @@
|
||||||
return {
|
|
||||||
"neovim/nvim-lspconfig",
|
|
||||||
event = { "BufReadPre", "BufNewFile" },
|
|
||||||
opts = {
|
|
||||||
servers = {
|
|
||||||
clangd = {},
|
|
||||||
gdscript = {},
|
|
||||||
gopls = {},
|
|
||||||
lua_ls = {
|
|
||||||
settings = {
|
|
||||||
Lua = {
|
|
||||||
completion = {
|
|
||||||
callSnippet = "Replace",
|
|
||||||
},
|
|
||||||
runtime = {
|
|
||||||
version = "LuaJIT",
|
|
||||||
},
|
|
||||||
workspace = {
|
|
||||||
checkThirdParty = false,
|
|
||||||
library = {
|
|
||||||
"${3rd}/luv/library",
|
|
||||||
unpack(vim.api.nvim_get_runtime_file("", true)),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
rust_analyzer = {
|
|
||||||
settings = {
|
|
||||||
["rust-analyzer"] = {
|
|
||||||
imports = {
|
|
||||||
granularity = {
|
|
||||||
group = "module",
|
|
||||||
},
|
|
||||||
prefix = "self",
|
|
||||||
},
|
|
||||||
cargo = {
|
|
||||||
buildScripts = {
|
|
||||||
enable = true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
procMacro = {
|
|
||||||
enable = true
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
config = function(_, opts)
|
|
||||||
-- Servers
|
|
||||||
local servers = opts.servers
|
|
||||||
|
|
||||||
for server, server_opts in pairs(servers) do
|
|
||||||
require("lspconfig")[server].setup(server_opts)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Icons
|
|
||||||
local icons = {
|
|
||||||
Error = " ",
|
|
||||||
Warn = " ",
|
|
||||||
Hint = " ",
|
|
||||||
Info = " ",
|
|
||||||
}
|
|
||||||
|
|
||||||
for name, icon in pairs(icons) do
|
|
||||||
name = "DiagnosticSign" .. name
|
|
||||||
vim.fn.sign_define(name, { text = icon, texthl = name, numhl = "" })
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Runs when the LSP is attached
|
|
||||||
vim.api.nvim_create_autocmd("LspAttach", {
|
|
||||||
group = vim.api.nvim_create_augroup("lsp-attach", { clear = true }),
|
|
||||||
callback = function(event)
|
|
||||||
local function map(mode, lhs, rhs, info)
|
|
||||||
vim.keymap.set(mode, lhs, rhs, { buffer = event.buf, desc = "LSP: " .. info })
|
|
||||||
end
|
|
||||||
|
|
||||||
map("n", "gr", require("telescope.builtin").lsp_references, "References")
|
|
||||||
map("n", "gd", require("telescope.builtin").lsp_definitions, "Definition")
|
|
||||||
map({ "n", "i" }, "<f1>", vim.lsp.buf.hover, "Hover")
|
|
||||||
map({ "n", "i" }, "<f2>", vim.lsp.buf.rename, "Rename")
|
|
||||||
map({ "n", "i" }, "<C-f>", vim.lsp.buf.format, "Format")
|
|
||||||
map("n", "<leader>ca", vim.lsp.buf.code_action, "Code action")
|
|
||||||
|
|
||||||
-- Highlight the word your cursor is on
|
|
||||||
-- local client = vim.lsp.get_client_by_id(event.data.client_id)
|
|
||||||
--
|
|
||||||
-- if client and client.server_capabilities.documentHighlightProvider then
|
|
||||||
-- vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, {
|
|
||||||
-- buffer = event.buf,
|
|
||||||
-- callback = vim.lsp.buf.document_highlight,
|
|
||||||
-- })
|
|
||||||
--
|
|
||||||
-- vim.api.nvim_create_autocmd({ "CursorMoved", "CursorMovedI" }, {
|
|
||||||
-- buffer = event.buf,
|
|
||||||
-- callback = vim.lsp.buf.clear_references,
|
|
||||||
-- })
|
|
||||||
-- end
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
}
|
|
|
@ -1,11 +0,0 @@
|
||||||
return {
|
|
||||||
"L3MON4D3/LuaSnip",
|
|
||||||
dependencies = {
|
|
||||||
"rafamadriz/friendly-snippets"
|
|
||||||
},
|
|
||||||
event = "InsertEnter",
|
|
||||||
version = "v2.*",
|
|
||||||
config = function()
|
|
||||||
require("luasnip.loaders.from_vscode").lazy_load()
|
|
||||||
end,
|
|
||||||
}
|
|
|
@ -1,8 +0,0 @@
|
||||||
return {
|
|
||||||
"echasnovski/mini.completion",
|
|
||||||
event = "InsertEnter",
|
|
||||||
opts = {
|
|
||||||
set_vim_settings = false,
|
|
||||||
},
|
|
||||||
config = true,
|
|
||||||
}
|
|
|
@ -1,18 +0,0 @@
|
||||||
return {
|
|
||||||
"echasnovski/mini.surround",
|
|
||||||
event = { "BufReadPost", "BufNewFile" },
|
|
||||||
opts = {
|
|
||||||
mappings = {
|
|
||||||
add = 'gsa',
|
|
||||||
delete = 'gsd',
|
|
||||||
find = 'gsf',
|
|
||||||
find_left = 'gsF',
|
|
||||||
highlight = 'gsh',
|
|
||||||
replace = 'gsr',
|
|
||||||
update_n_lines = 'gsn',
|
|
||||||
suffix_last = '',
|
|
||||||
suffix_next = '',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
config = true,
|
|
||||||
}
|
|
|
@ -1,14 +0,0 @@
|
||||||
return {
|
|
||||||
"mg979/vim-visual-multi",
|
|
||||||
keys = {
|
|
||||||
{ "<C-d>", mode = { "n", "x" }, desc = "Multicursor (word)" },
|
|
||||||
{ "<C-Up>", mode = { "n", "x" }, desc = "Multicursor (next line)" },
|
|
||||||
{ "<C-Down>", mode = { "n", "x" }, desc = "Multicursor (previous line)" },
|
|
||||||
},
|
|
||||||
init = function()
|
|
||||||
vim.g.VM_maps = {
|
|
||||||
["Find Under"] = "<C-d>",
|
|
||||||
["Find Subword Under"] = "<C-d>",
|
|
||||||
}
|
|
||||||
end,
|
|
||||||
}
|
|
|
@ -1,17 +0,0 @@
|
||||||
return {
|
|
||||||
"folke/noice.nvim",
|
|
||||||
event = "VeryLazy",
|
|
||||||
dependencies = {
|
|
||||||
"MunifTanjim/nui.nvim",
|
|
||||||
},
|
|
||||||
opts = {
|
|
||||||
lsp = {
|
|
||||||
override = {
|
|
||||||
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
|
|
||||||
["vim.lsp.util.stylize_markdown"] = true,
|
|
||||||
["cmp.entry.get_documentation"] = true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
config = true,
|
|
||||||
}
|
|
|
@ -1,11 +0,0 @@
|
||||||
return {
|
|
||||||
"rcarriga/nvim-notify",
|
|
||||||
event = "VeryLazy",
|
|
||||||
opts = {
|
|
||||||
background_colour = "#000000",
|
|
||||||
fps = 60,
|
|
||||||
render = "compact",
|
|
||||||
timeout = 0,
|
|
||||||
},
|
|
||||||
config = true,
|
|
||||||
}
|
|
|
@ -1,7 +0,0 @@
|
||||||
return {
|
|
||||||
"NvChad/nvterm",
|
|
||||||
keys = {
|
|
||||||
{ "<A-i>", "<cmd>lua require('nvterm.terminal').toggle('float')<cr>", mode = { "n", "t" }, desc = "Toggle terminal" },
|
|
||||||
},
|
|
||||||
config = true,
|
|
||||||
}
|
|
|
@ -1,19 +0,0 @@
|
||||||
return {
|
|
||||||
"navarasu/onedark.nvim",
|
|
||||||
lazy = false,
|
|
||||||
priority = 1000,
|
|
||||||
opts = {
|
|
||||||
style = "dark",
|
|
||||||
transparent = true,
|
|
||||||
term_colors = true,
|
|
||||||
highlights = {
|
|
||||||
["StatusLine"] = {fg = "$bg3", bg = "Normal"},
|
|
||||||
["StatusLineNC"] = {fg = "$bg3", bg = "Normal"},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
config = function(_, opts)
|
|
||||||
local theme = require("onedark")
|
|
||||||
theme.setup(opts)
|
|
||||||
theme.load()
|
|
||||||
end,
|
|
||||||
}
|
|
|
@ -1,10 +0,0 @@
|
||||||
return {
|
|
||||||
"folke/snacks.nvim",
|
|
||||||
event = "BufReadPre",
|
|
||||||
opts = {
|
|
||||||
explorer = {
|
|
||||||
replace_netrw = true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
config = true,
|
|
||||||
}
|
|
|
@ -1,7 +0,0 @@
|
||||||
return {
|
|
||||||
"nvim-pack/nvim-spectre",
|
|
||||||
keys = {
|
|
||||||
{ "<leader>sr", function() require("spectre").open() end, desc = "Replace in files (Spectre)" },
|
|
||||||
},
|
|
||||||
config = true,
|
|
||||||
}
|
|
|
@ -1,73 +0,0 @@
|
||||||
local function on_attach(bufnr)
|
|
||||||
local api = require("nvim-tree.api")
|
|
||||||
|
|
||||||
-- default mappings
|
|
||||||
api.config.mappings.default_on_attach(bufnr)
|
|
||||||
|
|
||||||
local function opts(desc)
|
|
||||||
return { desc = "nvim-tree: " .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true }
|
|
||||||
end
|
|
||||||
|
|
||||||
-- navigation
|
|
||||||
vim.keymap.set("n", "<C-Up>", api.tree.change_root_to_parent, opts("Up"))
|
|
||||||
vim.keymap.set("n", "<C-Left>", api.tree.change_root_to_parent, opts("Up"))
|
|
||||||
vim.keymap.set("n", "<C-Down>", api.tree.change_root_to_node, opts("Enter"))
|
|
||||||
vim.keymap.set("n", "<C-Right>", api.tree.change_root_to_node, opts("Enter"))
|
|
||||||
|
|
||||||
-- open folders with a single click
|
|
||||||
vim.keymap.set("n", "<LeftRelease>", function()
|
|
||||||
vim.defer_fn(function ()
|
|
||||||
local win = vim.api.nvim_get_current_win()
|
|
||||||
local view = require("nvim-tree.view")
|
|
||||||
if view.get_winnr() ~= win then return end
|
|
||||||
|
|
||||||
api.node.open.edit()
|
|
||||||
api.tree.focus()
|
|
||||||
end, 10)
|
|
||||||
end, opts("Open folder/file"))
|
|
||||||
end
|
|
||||||
|
|
||||||
return {
|
|
||||||
"nvim-tree/nvim-tree.lua",
|
|
||||||
event = "VeryLazy",
|
|
||||||
dependencies = {
|
|
||||||
"nvim-tree/nvim-web-devicons",
|
|
||||||
},
|
|
||||||
keys = {
|
|
||||||
{ "<leader>e", function() require("nvim-tree.api").tree.toggle() end, desc = "Toggle files" },
|
|
||||||
},
|
|
||||||
opts = {
|
|
||||||
filesystem_watchers = {
|
|
||||||
enable = true,
|
|
||||||
},
|
|
||||||
filters = {
|
|
||||||
dotfiles = false,
|
|
||||||
},
|
|
||||||
on_attach = on_attach,
|
|
||||||
renderer = {
|
|
||||||
root_folder_label = false,
|
|
||||||
highlight_git = true,
|
|
||||||
icons = {
|
|
||||||
show = {
|
|
||||||
git = false,
|
|
||||||
},
|
|
||||||
glyphs = {
|
|
||||||
git = {
|
|
||||||
unstaged = "",
|
|
||||||
untracked = "",
|
|
||||||
deleted = "",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
sync_root_with_cwd = true,
|
|
||||||
update_focused_file = {
|
|
||||||
enable = true,
|
|
||||||
update_root = false,
|
|
||||||
},
|
|
||||||
view = {
|
|
||||||
width = 30,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
config = true,
|
|
||||||
}
|
|
|
@ -1,16 +0,0 @@
|
||||||
return {
|
|
||||||
"folke/trouble.nvim",
|
|
||||||
event = "VeryLazy",
|
|
||||||
keys = {
|
|
||||||
{ "<leader>x", function() require("trouble").toggle() end, desc = "Show errors" },
|
|
||||||
},
|
|
||||||
dependencies = {
|
|
||||||
"nvim-tree/nvim-web-devicons",
|
|
||||||
},
|
|
||||||
opts = {
|
|
||||||
position = "right",
|
|
||||||
padding = false,
|
|
||||||
use_diagnostic_signs = true,
|
|
||||||
},
|
|
||||||
config = true,
|
|
||||||
}
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
vim.g.mapleader = " "
|
||||||
|
|
||||||
local function map(mode, lhs, rhs, info)
|
local function map(mode, lhs, rhs, info)
|
||||||
vim.keymap.set(mode, lhs, rhs, { desc = info })
|
vim.keymap.set(mode, lhs, rhs, { desc = info })
|
||||||
end
|
end
|
||||||
|
@ -6,7 +8,6 @@ map("n", ";", ":", "Command mode")
|
||||||
map("n", "U", "<cmd>redo<cr>", "Redo")
|
map("n", "U", "<cmd>redo<cr>", "Redo")
|
||||||
map("n", "<Bslash>", "<cmd>ToggleWord<cr>", "Toggle word")
|
map("n", "<Bslash>", "<cmd>ToggleWord<cr>", "Toggle word")
|
||||||
map("n", "<C-q>", "<cmd>close<cr>", "Close window")
|
map("n", "<C-q>", "<cmd>close<cr>", "Close window")
|
||||||
map("n", "<leader>l", "<cmd>Lazy<cr>", "Lazy")
|
|
||||||
map({"n", "v"}, "q", "<cmd>qa<cr>", "Quit all")
|
map({"n", "v"}, "q", "<cmd>qa<cr>", "Quit all")
|
||||||
map({"n", "v"}, "<leader>q", "<cmd>qa!<cr>", "Quit all")
|
map({"n", "v"}, "<leader>q", "<cmd>qa!<cr>", "Quit all")
|
||||||
map({"n", "i"}, "<esc>", "<cmd>noh<cr><esc>", "Clear search")
|
map({"n", "i"}, "<esc>", "<cmd>noh<cr><esc>", "Clear search")
|
||||||
|
@ -65,4 +66,4 @@ map("i", "<S-Right>", "<Esc>v<Right>")
|
||||||
map("n", "<A-Up>", "<C-w>k", "Move to the window above")
|
map("n", "<A-Up>", "<C-w>k", "Move to the window above")
|
||||||
map("n", "<A-Down>", "<C-w>j", "Move to the window below")
|
map("n", "<A-Down>", "<C-w>j", "Move to the window below")
|
||||||
map("n", "<A-Left>", "<C-w>h", "Move to the window on the left")
|
map("n", "<A-Left>", "<C-w>h", "Move to the window on the left")
|
||||||
map("n", "<A-Right>", "<C-w>l", "Move to the window on the right")
|
map("n", "<A-Right>", "<C-w>l", "Move to the window on the right")
|
|
@ -1,69 +0,0 @@
|
||||||
-- Install the package manager if needed
|
|
||||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
|
||||||
|
|
||||||
if not vim.loop.fs_stat(lazypath) then
|
|
||||||
vim.fn.system({
|
|
||||||
"git",
|
|
||||||
"clone",
|
|
||||||
"--filter=blob:none",
|
|
||||||
"https://github.com/folke/lazy.nvim.git",
|
|
||||||
"--branch=stable",
|
|
||||||
lazypath,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
vim.opt.rtp:prepend(lazypath)
|
|
||||||
|
|
||||||
-- Load plugins
|
|
||||||
require("lazy").setup("plugins", {
|
|
||||||
defaults = {
|
|
||||||
lazy = true,
|
|
||||||
},
|
|
||||||
change_detection = {
|
|
||||||
notify = false
|
|
||||||
},
|
|
||||||
rocks = {
|
|
||||||
enabled = false
|
|
||||||
},
|
|
||||||
ui = {
|
|
||||||
icons = {
|
|
||||||
ft = "",
|
|
||||||
lazy = " ",
|
|
||||||
loaded = "",
|
|
||||||
not_loaded = "",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
performance = {
|
|
||||||
rtp = {
|
|
||||||
disabled_plugins = {
|
|
||||||
"2html_plugin",
|
|
||||||
"tohtml",
|
|
||||||
"getscript",
|
|
||||||
"getscriptPlugin",
|
|
||||||
"gzip",
|
|
||||||
"logipat",
|
|
||||||
"netrw",
|
|
||||||
"netrwPlugin",
|
|
||||||
"netrwSettings",
|
|
||||||
"netrwFileHandlers",
|
|
||||||
"matchit",
|
|
||||||
"tar",
|
|
||||||
"tarPlugin",
|
|
||||||
"rrhelper",
|
|
||||||
"spellfile_plugin",
|
|
||||||
"vimball",
|
|
||||||
"vimballPlugin",
|
|
||||||
"zip",
|
|
||||||
"zipPlugin",
|
|
||||||
"tutor",
|
|
||||||
"rplugin",
|
|
||||||
"syntax",
|
|
||||||
"synmenu",
|
|
||||||
"optwin",
|
|
||||||
"compiler",
|
|
||||||
"bugreport",
|
|
||||||
"ftplugin",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
|
@ -1,5 +0,0 @@
|
||||||
return {
|
|
||||||
"windwp/nvim-autopairs",
|
|
||||||
event = "InsertEnter",
|
|
||||||
config = true,
|
|
||||||
}
|
|
|
@ -1,23 +0,0 @@
|
||||||
return {
|
|
||||||
"numToStr/Comment.nvim",
|
|
||||||
keys = {
|
|
||||||
{
|
|
||||||
"<C-/>",
|
|
||||||
"<cmd>lua require('Comment.api').toggle.linewise.current()<cr>",
|
|
||||||
desc = "Toggle comment",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"<C-/>",
|
|
||||||
"<esc><cmd>lua require('Comment.api').toggle.linewise(vim.fn.visualmode())<cr>",
|
|
||||||
mode = "v",
|
|
||||||
desc = "Toggle comment",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
config = true,
|
|
||||||
opts = {
|
|
||||||
mappings = {
|
|
||||||
basic = false,
|
|
||||||
extra = false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
|
@ -1,9 +0,0 @@
|
||||||
return {
|
|
||||||
"folke/flash.nvim",
|
|
||||||
event = { "BufReadPost", "BufNewFile" },
|
|
||||||
keys = {
|
|
||||||
{ "s", function() require("flash").jump() end, mode = { "n", "o", "x" }, desc = "Flash" },
|
|
||||||
{ "S", function() require("flash").treesitter() end, mode = { "n", "o", "x" }, desc = "Flash Treesitter" },
|
|
||||||
},
|
|
||||||
config = true,
|
|
||||||
}
|
|
|
@ -1,5 +0,0 @@
|
||||||
return {
|
|
||||||
"lewis6991/gitsigns.nvim",
|
|
||||||
event = "BufReadPre",
|
|
||||||
config = true,
|
|
||||||
}
|
|
|
@ -1,7 +0,0 @@
|
||||||
return {
|
|
||||||
"tanvirtin/monokai.nvim",
|
|
||||||
lazy = false,
|
|
||||||
priority = 1000,
|
|
||||||
opts = {},
|
|
||||||
config = true,
|
|
||||||
}
|
|
|
@ -1,36 +0,0 @@
|
||||||
return {
|
|
||||||
"nvim-telescope/telescope.nvim",
|
|
||||||
dependencies = {
|
|
||||||
"nvim-lua/plenary.nvim",
|
|
||||||
"nvim-telescope/telescope-project.nvim",
|
|
||||||
},
|
|
||||||
keys = {
|
|
||||||
{"<C-Tab>", "<cmd>Telescope buffers<cr>", desc = "Buffers"},
|
|
||||||
{"<leader>f", "<cmd>Telescope find_files<cr>", desc = "Find files"},
|
|
||||||
{"<leader>p", "<cmd>Telescope project<cr>", desc = "Projects"},
|
|
||||||
{"<leader>r", "<cmd>Telescope oldfiles<cr>", desc = "Recent files"},
|
|
||||||
},
|
|
||||||
config = function()
|
|
||||||
require("telescope").setup({
|
|
||||||
defaults = {
|
|
||||||
mappings = {
|
|
||||||
i = {
|
|
||||||
["<esc>"] = require("telescope.actions").close,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
prompt_prefix = " ",
|
|
||||||
selection_caret = " ",
|
|
||||||
},
|
|
||||||
extensions = {
|
|
||||||
project = {
|
|
||||||
base_dirs = {
|
|
||||||
{ path = "~/projects", max_depth = 3 },
|
|
||||||
},
|
|
||||||
order_by = "desc",
|
|
||||||
sync_with_nvim_tree = true,
|
|
||||||
theme = "dropdown",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
}
|
|
|
@ -1,18 +0,0 @@
|
||||||
return {
|
|
||||||
"nvim-treesitter/nvim-treesitter",
|
|
||||||
event = { "BufReadPost", "BufNewFile" },
|
|
||||||
build = ":TSUpdate",
|
|
||||||
opts = {
|
|
||||||
ensure_installed = {
|
|
||||||
"go",
|
|
||||||
"gomod",
|
|
||||||
"gowork",
|
|
||||||
"gosum",
|
|
||||||
},
|
|
||||||
highlight = { enable = true },
|
|
||||||
indent = { enable = true },
|
|
||||||
},
|
|
||||||
config = function(_, opts)
|
|
||||||
require("nvim-treesitter.configs").setup(opts)
|
|
||||||
end,
|
|
||||||
}
|
|
|
@ -1,11 +1,3 @@
|
||||||
-- Globals
|
|
||||||
local g = vim.g
|
|
||||||
g.mapleader = " "
|
|
||||||
|
|
||||||
for _, provider in ipairs { "node", "perl", "python3", "ruby" } do
|
|
||||||
g["loaded_" .. provider .. "_provider"] = 0
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Options
|
-- Options
|
||||||
local opt = vim.opt
|
local opt = vim.opt
|
||||||
opt.autowrite = false
|
opt.autowrite = false
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue