big changes to lf, neovim (now actually working mostly), and the addition of tmux
This commit is contained in:
parent
b5fe43b9af
commit
293fe557bb
@ -1,5 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<actions>
|
||||
<action>
|
||||
<icon>user-trash</icon>
|
||||
<name>Move to Trash</name>
|
||||
<unique-id>1663752025909170-1</unique-id>
|
||||
<command>trash %F</command>
|
||||
<description>Moves item to trash with trash-cli</description>
|
||||
<patterns>*</patterns>
|
||||
<directories/>
|
||||
<audio-files/>
|
||||
<image-files/>
|
||||
<other-files/>
|
||||
<text-files/>
|
||||
<video-files/>
|
||||
</action>
|
||||
<action>
|
||||
<icon>lxterminal</icon>
|
||||
<name>Open Terminal Here</name>
|
||||
|
||||
@ -31,22 +31,23 @@ set previewer '~/.config/lf/scope'
|
||||
# cmds/functions
|
||||
cmd open ${{
|
||||
case $(file --mime-type "$(readlink -f $f)" -b) in
|
||||
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet) localc $fx ;;
|
||||
image/vnd.djvu|application/pdf|application/octet-stream|application/postscript) setsid -f zathura $fx >/dev/null 2>&1 ;;
|
||||
text/*|application/json|inode/x-empty) $EDITOR $fx;;
|
||||
image/x-xcf) setsid -f gimp $f >/dev/null 2>&1 ;;
|
||||
image/svg+xml) display -- $f ;;
|
||||
image/*) rotdir $f | grep -i "\.\(png\|jpg\|jpeg\|gif\|webp\|tif\|ico\)\(_large\)*$" |
|
||||
setsid -f sxiv -aio 2>/dev/null | while read -r file; do
|
||||
[ -z "$file" ] && continue
|
||||
lf -remote "send select \"$file\""
|
||||
lf -remote "send toggle"
|
||||
done &
|
||||
;;
|
||||
audio/*) mpv --audio-display=no $f ;;
|
||||
video/*) setsid -f mpv $f -quiet >/dev/null 2>&1 ;;
|
||||
application/pdf|application/vnd*|application/epub*) setsid -f zathura $fx >/dev/null 2>&1 ;;
|
||||
application/pgp-encrypted) $EDITOR $fx ;;
|
||||
application/vnd.oasis.opendocument.text) lowriter $fs ;;
|
||||
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet) localc $fx ;;
|
||||
image/vnd.djvu|application/pdf|application/octet-stream|application/postscript) setsid -f zathura $fx >/dev/null 2>&1 ;;
|
||||
text/*|application/json|inode/x-empty) $EDITOR $fx;;
|
||||
image/x-xcf) setsid -f gimp $f >/dev/null 2>&1 ;;
|
||||
image/svg+xml) display -- $f ;;
|
||||
image/*) rotdir $f | grep -i "\.\(png\|jpg\|jpeg\|gif\|webp\|tif\|ico\)\(_large\)*$" |
|
||||
setsid -f sxiv -aio 2>/dev/null | while read -r file; do
|
||||
[ -z "$file" ] && continue
|
||||
lf -remote "send select \"$file\""
|
||||
lf -remote "send toggle"
|
||||
done &
|
||||
;;
|
||||
audio/*) mpv --audio-display=no $f ;;
|
||||
video/*) setsid -f mpv $f -quiet >/dev/null 2>&1 ;;
|
||||
application/pdf|application/vnd*|application/epub*) setsid -f zathura $fx >/dev/null 2>&1 ;;
|
||||
application/pgp-encrypted) $EDITOR $fx ;;
|
||||
*) for f in $fx; do setsid -f $OPENER $f >/dev/null 2>&1; done;;
|
||||
esac
|
||||
}}
|
||||
@ -129,6 +130,15 @@ cmd mkfile_and_edit ${{
|
||||
eval $EDITOR $ans
|
||||
}}
|
||||
|
||||
cmd zk_edit ${{
|
||||
eval zk edit -i
|
||||
}}
|
||||
|
||||
cmd zk_edit_file ${{
|
||||
name=$(echo "$f" | sed 's/\..*//' | sed 's/.*\///')
|
||||
eval zk edit -i -m "$name"
|
||||
}}
|
||||
|
||||
cmd setbg "$1"
|
||||
cmd bulkrename $vidir
|
||||
|
||||
@ -154,6 +164,8 @@ map t
|
||||
map tt trash
|
||||
map tr restore_trash
|
||||
|
||||
map tmo $tmux-sessioniser $PWD
|
||||
|
||||
map m
|
||||
map md mkdir
|
||||
map mf mkfile
|
||||
@ -164,7 +176,14 @@ map gd cd ~/Downloads
|
||||
map gr cd ~/repos
|
||||
map gn cd ~/nextcloud
|
||||
map gH cd ~/nextcloud/university/Honours
|
||||
map gc cd ~/.config
|
||||
map gcc cd ~/.config
|
||||
map gcn cd ~/.config/nvim
|
||||
map gcl cd ~/.config/lf
|
||||
map gcxb cd ~/.config/xmobar
|
||||
map gcxm cd ~/.xmonad
|
||||
map gcs cd ~/.config/shell
|
||||
map gcz cd ~/.config/zsh
|
||||
map gcx1 cd ~/.config/x11
|
||||
|
||||
map A rename # at the very end
|
||||
map c push A<c-u> # new rename
|
||||
@ -174,13 +193,16 @@ map a push A<a-b> # after extension
|
||||
map B bulkrename
|
||||
map b $setbg $f
|
||||
|
||||
map <c-e> down
|
||||
map <c-y> up
|
||||
map <c-j> down
|
||||
map <c-k> up
|
||||
map V push :!nvim<space>
|
||||
|
||||
map W $setsid -f $TERMINAL >/dev/null 2>&1
|
||||
|
||||
map Y $printf "%s" "$fx" | xclip -selection clipboard
|
||||
|
||||
map zke zk_edit
|
||||
map zkf zk_edit_file
|
||||
|
||||
# Source Bookmarks
|
||||
# source "~/.config/lf/shortcutrc"
|
||||
|
||||
@ -1,47 +1,36 @@
|
||||
require("user.options")
|
||||
require("user.keymaps")
|
||||
require("user.plugins")
|
||||
require("user.colorscheme")
|
||||
require("user.lsp")
|
||||
require("user.lsp-inlayhints")
|
||||
require("user.autocommands")
|
||||
require("user.cmp")
|
||||
require("user.navic")
|
||||
require("user.telescope")
|
||||
require("user.treesitter")
|
||||
require("user.autopairs")
|
||||
require("user.comment")
|
||||
require("user.gitsigns")
|
||||
require("user.nvim-tree")
|
||||
require("user.bufferline")
|
||||
require("user.toggleterm") -- TODO Need to work out something other than ALT for this :D
|
||||
require("user.project")
|
||||
require("user.impatient")
|
||||
require("user.indentline")
|
||||
require("user.alpha")
|
||||
require("user.whichkey")
|
||||
-- require "user.hop" -- Not sure I want to use this yet.
|
||||
require("user.matchup")
|
||||
require("user.numb")
|
||||
require("user.colorizer")
|
||||
require("user.spectre")
|
||||
require("user.zen-mode")
|
||||
require("user.neoscroll")
|
||||
require("user.todo-comments")
|
||||
require("user.symbol-outline") -- TODO not working? look into further...
|
||||
require("user.notify")
|
||||
require("user.ts-context")
|
||||
-- require("user.copilot") -- I can look at this in Chritian Chiarulli's config if I wish, for now I can't be bothered.
|
||||
require("user.functions")
|
||||
require("user.illuminate")
|
||||
require("user.dap") -- TODO Need to work this one out.
|
||||
-- require("user.lir")
|
||||
require("user.winbar") -- TODO The NAVIC integration here isn't working?
|
||||
require("user.nvim-webdev-icons")
|
||||
require("user.fidget")
|
||||
require("user.dressing")
|
||||
require("user.browse")
|
||||
require("user.surround") -- TODO This need reconfiguration and fixing
|
||||
require("user.harpoon") -- mark files and navigate them through a nice ui or with keys (good for large codebases)
|
||||
require("user.vim-slash")
|
||||
require("user.lualine")
|
||||
require "user.impatient"
|
||||
require "user.options"
|
||||
require "user.keymaps"
|
||||
require "user.plugins"
|
||||
require "user.colorscheme"
|
||||
require "user.lsp"
|
||||
require "user.alpha"
|
||||
require "user.autocmd"
|
||||
require "user.autopairs"
|
||||
require "user.cmp"
|
||||
require "user.colorizer"
|
||||
require "user.comment"
|
||||
require "user.dressing"
|
||||
require "user.fidget"
|
||||
require "user.functions"
|
||||
require "user.gitsigns"
|
||||
require "user.harpoon"
|
||||
require "user.indentline"
|
||||
require "user.keymaps"
|
||||
require "user.lualine"
|
||||
require "user.navic"
|
||||
require "user.notify"
|
||||
require "user.numb"
|
||||
require "user.nvim-tree"
|
||||
require "user.symbols-outline"
|
||||
require "user.telescope"
|
||||
require "user.todo-comments"
|
||||
require "user.toggleterm"
|
||||
require "user.treesitter"
|
||||
require "user.whichkey"
|
||||
require "user.zen-mode"
|
||||
require "user.spectre"
|
||||
require "user.bufferline"
|
||||
require "user.winbar"
|
||||
require "user.zk"
|
||||
require "user.tabout"
|
||||
|
||||
@ -1,44 +1,17 @@
|
||||
local status_ok, alpha = pcall(require, "alpha")
|
||||
if not status_ok then
|
||||
return
|
||||
local s_ok, alpha = pcall(require, "alpha")
|
||||
if not s_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local dashboard = require "alpha.themes.dashboard"
|
||||
local dashboard = require"alpha.themes.dashboard"
|
||||
|
||||
local function button(sc, txt, keybind, keybind_opts)
|
||||
local b = dashboard.button(sc, txt, keybind, keybind_opts)
|
||||
b.opts.hl_shortcut = "Macro"
|
||||
return b
|
||||
local function button(sc, txt, key, key_opts)
|
||||
local b = dashboard.button(sc, txt, key, key_opts)
|
||||
b.opts.hl_shortcut = "Macro"
|
||||
return b
|
||||
end
|
||||
|
||||
local icons = require "user.icons"
|
||||
|
||||
-- dashboard.section.header.val = {
|
||||
-- [[ __ ]],
|
||||
-- [[ ___ ___ ___ __ __ /\_\ ___ ___ ]],
|
||||
-- [[ / _ `\ / __`\ / __`\/\ \/\ \\/\ \ / __` __`\ ]],
|
||||
-- [[/\ \/\ \/\ __//\ \_\ \ \ \_/ |\ \ \/\ \/\ \/\ \ ]],
|
||||
-- [[\ \_\ \_\ \____\ \____/\ \___/ \ \_\ \_\ \_\ \_\]],
|
||||
-- [[ \/_/\/_/\/____/\/___/ \/__/ \/_/\/_/\/_/\/_/]],
|
||||
-- }
|
||||
|
||||
-- dashboard.section.header.val = {
|
||||
-- [[ ▟▙ ]],
|
||||
-- [[ ▝▘ ]],
|
||||
-- [[ ██▃▅▇█▆▖ ▗▟████▙▖ ▄████▄ ██▄ ▄██ ██ ▗▟█▆▄▄▆█▙▖]],
|
||||
-- [[ ██▛▔ ▝██ ██▄▄▄▄██ ██▛▔▔▜██ ▝██ ██▘ ██ ██▛▜██▛▜██]],
|
||||
-- [[ ██ ██ ██▀▀▀▀▀▘ ██▖ ▗██ ▜█▙▟█▛ ██ ██ ██ ██]],
|
||||
-- [[ ██ ██ ▜█▙▄▄▄▟▊ ▀██▙▟██▀ ▝████▘ ██ ██ ██ ██]],
|
||||
-- [[ ▀▀ ▀▀ ▝▀▀▀▀▀ ▀▀▀▀ ▀▀ ▀▀ ▀▀ ▀▀ ▀▀]],
|
||||
-- }
|
||||
|
||||
-- ▄▀▀▄ ▀▄ ▄▀▀█▄▄▄▄ ▄▀▀▀▀▄ ▄▀▀▄ ▄▀▀▄ ▄▀▀█▀▄ ▄▀▀▄ ▄▀▄
|
||||
-- █ █ █ █ ▐ ▄▀ ▐ █ █ █ █ █ █ █ █ █ █ ▀ █
|
||||
-- ▐ █ ▀█ █▄▄▄▄▄ █ █ ▐ █ █ ▐ █ ▐ ▐ █ █
|
||||
-- █ █ █ ▌ ▀▄ ▄▀ █ ▄▀ █ █ █
|
||||
-- ▄▀ █ ▄▀▄▄▄▄ ▀▀▀▀ ▀▄▀ ▄▀▀▀▀▀▄ ▄▀ ▄▀
|
||||
-- █ ▐ █ ▐ █ █ █ █
|
||||
-- ▐ ▐ ▐ ▐ ▐ ▐
|
||||
local icons = require"user.icons"
|
||||
|
||||
dashboard.section.header.val = {
|
||||
[[ , __ ___ __. _ __ ` , _ , _ ]],
|
||||
@ -57,25 +30,17 @@ dashboard.section.buttons.val = {
|
||||
button("u", icons.ui.CloudDownload .. " Update", ":PackerSync<CR>"),
|
||||
button("q", icons.ui.SignOut .. " Quit", ":qa<CR>"),
|
||||
}
|
||||
local function footer()
|
||||
-- NOTE: requires the fortune-mod package to work
|
||||
-- local handle = io.popen("fortune")
|
||||
-- local fortune = handle:read("*a")
|
||||
-- handle:close()
|
||||
-- return fortune
|
||||
return {
|
||||
|
||||
dashboard.section.footer.val = {
|
||||
[[┬┌┐┌┬┌─┬ ┌─┐┌┬┐┌┐ ┬ ┌─┐┌┬┐┌─┐┌─┐┌┬┐]],
|
||||
[[││││├┴┐│ ├┤ │ ├┴┐│ │ │ │ │ │ ││││]],
|
||||
[[┴┘└┘┴ ┴┴─┘└─┘ ┴ └─┘┴─┘└─┘ ┴o└─┘└─┘┴ ┴]],
|
||||
}
|
||||
end
|
||||
|
||||
dashboard.section.footer.val = footer()
|
||||
}
|
||||
|
||||
dashboard.section.header.opts.hl = "Include"
|
||||
dashboard.section.buttons.opts.hl = "Macro"
|
||||
dashboard.section.footer.opts.hl = "Type"
|
||||
|
||||
dashboard.opts.opts.noautocmd = true
|
||||
-- vim.cmd([[autocmd User AlphaReady echo 'ready']])
|
||||
|
||||
alpha.setup(dashboard.opts)
|
||||
|
||||
87
.config/nvim/lua/user/autocmd.lua
Normal file
87
.config/nvim/lua/user/autocmd.lua
Normal file
@ -0,0 +1,87 @@
|
||||
vim.api.nvim_create_autocmd({ "User" }, {
|
||||
pattern = { "AlphaReady" },
|
||||
callback = function()
|
||||
vim.cmd [[
|
||||
set laststatus=0 | autocmd BufUnload <buffer> set laststatus=3
|
||||
]]
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({ "BufEnter" }, {
|
||||
pattern = { "term://*" },
|
||||
callback = function()
|
||||
vim.cmd "startinsert!"
|
||||
vim.cmd "set cmdheight=1"
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({ "VimResized" }, {
|
||||
callback = function()
|
||||
vim.cmd "tabdo wincmd ="
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({ "CmdWinEnter" }, {
|
||||
callback = function()
|
||||
vim.cmd "quit"
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({ "BufWinEnter" }, {
|
||||
callback = function()
|
||||
vim.cmd "set formatoptions-=cro"
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({ "TextYankPost" }, {
|
||||
callback = function()
|
||||
vim.highlight.on_yank { higroup = "Visual", timeout = 200 }
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({ "VimEnter" }, {
|
||||
callback = function()
|
||||
vim.cmd "hi link illuminatedWord LspReferenceText"
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({ "BufWinEnter" }, {
|
||||
pattern = { "*" },
|
||||
callback = function()
|
||||
vim.cmd "checktime"
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
|
||||
pattern = { "*.ts" },
|
||||
callback = function()
|
||||
vim.lsp.buf.format { async = true }
|
||||
end,
|
||||
})
|
||||
|
||||
-- Prevent auto comment on next line
|
||||
vim.cmd [[autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o]]
|
||||
|
||||
-- Set filetype to tex for .tex files?
|
||||
vim.cmd [[autocmd BufRead,BufNewFile *.tex set filetype=tex]]
|
||||
|
||||
-- Trim whitespace from files on save
|
||||
vim.cmd [[
|
||||
autocmd BufWritePre * let currPos = getpos(".")
|
||||
autocmd BufWritePre * %s/\s\+$//e
|
||||
autocmd BufWritePre * %s/\n\+\%$//e
|
||||
autocmd BufWritePre *.[ch] %s/\%$/\r/e
|
||||
autocmd BufWritePre * cal cursor(currPos[1], currPos[2])
|
||||
]]
|
||||
|
||||
-- Recompile and restart Xmonad on save of config file for Xmonad or Xmobar
|
||||
vim.cmd [[autocmd BufWritePost ~/.xmonad/xmonad.hs,~/.config/xmobar/xmobar-main.hs,~/.config/xmobar/xmobar-sub.hs,~/.config/xmobar/xmobar-single.hs !xmonad --recompile && xmonad --restart]]
|
||||
|
||||
-- Run custom textclear command when exiting a .tex file (cleanup files)
|
||||
vim.cmd [[autocmd VimLeave *.tex !texclear %]]
|
||||
|
||||
-- Run install when editing my scripts
|
||||
vim.cmd [[
|
||||
autocmd BufWritePost ~/repos/inks-scripts/** !~/repos/inks-scripts/install
|
||||
]]
|
||||
|
||||
@ -1,193 +0,0 @@
|
||||
-- vim.api.nvim_create_autocmd({ "User" }, {
|
||||
-- pattern = { "AlphaReady" },
|
||||
-- callback = function()
|
||||
-- vim.cmd [[
|
||||
-- set showtabline=0 | autocmd BufUnload <buffer> set showtabline=2
|
||||
-- ]]
|
||||
-- end,
|
||||
-- })
|
||||
|
||||
vim.api.nvim_create_autocmd({ "User" }, {
|
||||
pattern = { "AlphaReady" },
|
||||
callback = function()
|
||||
vim.cmd [[
|
||||
set laststatus=0 | autocmd BufUnload <buffer> set laststatus=3
|
||||
]]
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({ "FileType" }, {
|
||||
pattern = {
|
||||
"Jaq",
|
||||
"qf",
|
||||
"help",
|
||||
"man",
|
||||
"lspinfo",
|
||||
"spectre_panel",
|
||||
"lir",
|
||||
"DressingSelect",
|
||||
"tsplayground",
|
||||
"Markdown",
|
||||
},
|
||||
callback = function()
|
||||
vim.cmd [[
|
||||
nnoremap <silent> <buffer> q :close<CR>
|
||||
nnoremap <silent> <buffer> <esc> :close<CR>
|
||||
set nobuflisted
|
||||
]]
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({ "BufEnter" }, {
|
||||
pattern = { "" },
|
||||
callback = function()
|
||||
local buf_ft = vim.bo.filetype
|
||||
if buf_ft == "" or buf_ft == nil then
|
||||
vim.cmd [[
|
||||
nnoremap <silent> <buffer> q :close<CR>
|
||||
nnoremap <silent> <buffer> <c-j> j<CR>
|
||||
nnoremap <silent> <buffer> <c-k> k<CR>
|
||||
set nobuflisted
|
||||
]]
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({ "BufEnter" }, {
|
||||
pattern = { "" },
|
||||
callback = function()
|
||||
local get_project_dir = function()
|
||||
local cwd = vim.fn.getcwd()
|
||||
local project_dir = vim.split(cwd, "/")
|
||||
local project_name = project_dir[#project_dir]
|
||||
return project_name
|
||||
end
|
||||
|
||||
vim.opt.titlestring = get_project_dir() .. " - nvim"
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({ "BufEnter" }, {
|
||||
pattern = { "term://*" },
|
||||
callback = function()
|
||||
vim.cmd "startinsert!"
|
||||
-- TODO: if java = 2
|
||||
vim.cmd "set cmdheight=1"
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({ "FileType" }, {
|
||||
pattern = { "gitcommit", "markdown" },
|
||||
callback = function()
|
||||
vim.opt_local.wrap = true
|
||||
vim.opt_local.spell = true
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({ "FileType" }, {
|
||||
pattern = { "lir" },
|
||||
callback = function()
|
||||
vim.opt_local.number = false
|
||||
vim.opt_local.relativenumber = false
|
||||
end,
|
||||
})
|
||||
|
||||
vim.cmd "autocmd BufEnter * ++nested if winnr('$') == 1 && bufname() == 'NvimTree_' . tabpagenr() | quit | endif"
|
||||
-- vim.api.nvim_create_autocmd({ "BufEnter" }, {
|
||||
-- callback = function()
|
||||
-- vim.cmd [[
|
||||
-- if winnr('$') == 1 && bufname() == 'NvimTree_' . tabpagenr() | quit | endif
|
||||
-- ]]
|
||||
-- end,
|
||||
-- })
|
||||
|
||||
vim.api.nvim_create_autocmd({ "VimResized" }, {
|
||||
callback = function()
|
||||
vim.cmd "tabdo wincmd ="
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({ "CmdWinEnter" }, {
|
||||
callback = function()
|
||||
vim.cmd "quit"
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({ "BufWinEnter" }, {
|
||||
callback = function()
|
||||
vim.cmd "set formatoptions-=cro"
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({ "TextYankPost" }, {
|
||||
callback = function()
|
||||
vim.highlight.on_yank { higroup = "Visual", timeout = 200 }
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
|
||||
pattern = { "*.java" },
|
||||
callback = function()
|
||||
vim.lsp.codelens.refresh()
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({ "VimEnter" }, {
|
||||
callback = function()
|
||||
vim.cmd "hi link illuminatedWord LspReferenceText"
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({ "BufWinEnter" }, {
|
||||
pattern = { "*" },
|
||||
callback = function()
|
||||
vim.cmd "checktime"
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({ "CursorHold" }, {
|
||||
callback = function()
|
||||
local status_ok, luasnip = pcall(require, "luasnip")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
if luasnip.expand_or_jumpable() then
|
||||
-- ask maintainer for option to make this silent
|
||||
-- luasnip.unlink_current()
|
||||
vim.cmd [[silent! lua require("luasnip").unlink_current()]]
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
|
||||
pattern = { "*.ts" },
|
||||
callback = function()
|
||||
vim.lsp.buf.format { async = true }
|
||||
end,
|
||||
})
|
||||
|
||||
-- Prevent auto comment on next line
|
||||
vim.cmd [[autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o]]
|
||||
|
||||
-- Set filetype to tex for .tex files?
|
||||
vim.cmd [[autocmd BufRead,BufNewFile *.tex set filetype=tex]]
|
||||
|
||||
-- Trim whitespace from files on save
|
||||
vim.cmd [[
|
||||
autocmd BufWritePre * let currPos = getpos(".")
|
||||
autocmd BufWritePre * %s/\s\+$//e
|
||||
autocmd BufWritePre * %s/\n\+\%$//e
|
||||
autocmd BufWritePre *.[ch] %s/\%$/\r/e
|
||||
autocmd BufWritePre * cal cursor(currPos[1], currPos[2])
|
||||
]]
|
||||
|
||||
-- Recompile and restart Xmonad on save of config file for Xmonad or Xmobar
|
||||
vim.cmd [[autocmd BufWritePost ~/.xmonad/xmonad.hs,~/.config/xmobar/xmobar-main.hs,~/.config/xmobar/xmobar-sub.hs,~/.config/xmobar/xmobar-single.hs !xmonad --recompile && xmonad --restart]]
|
||||
|
||||
-- Run custom textclear command when exiting a .tex file (cleanup files)
|
||||
vim.cmd [[autocmd VimLeave *.tex !texclear %]]
|
||||
|
||||
-- Run install when editing my scripts
|
||||
vim.cmd [[
|
||||
autocmd BufWritePost ~/repos/inks-scripts/** !~/repos/inks-scripts/install
|
||||
]]
|
||||
@ -1,33 +1,33 @@
|
||||
-- Setup nvim-cmp.
|
||||
local status_ok, npairs = pcall(require, "nvim-autopairs")
|
||||
if not status_ok then
|
||||
return
|
||||
return
|
||||
end
|
||||
|
||||
npairs.setup {
|
||||
check_ts = true,
|
||||
ts_config = {
|
||||
lua = { "string", "source" },
|
||||
javascript = { "string", "template_string" },
|
||||
java = false,
|
||||
},
|
||||
disable_filetype = { "TelescopePrompt", "spectre_panel" },
|
||||
fast_wrap = {
|
||||
map = "<M-e>",
|
||||
chars = { "{", "[", "(", '"', "'" },
|
||||
pattern = string.gsub([[ [%'%"%)%>%]%)%}%,] ]], "%s+", ""),
|
||||
offset = 0, -- Offset from pattern match
|
||||
end_key = "$",
|
||||
keys = "qwertyuiopzxcvbnmasdfghjkl",
|
||||
check_comma = true,
|
||||
highlight = "PmenuSel",
|
||||
highlight_grey = "LineNr",
|
||||
},
|
||||
check_ts = true,
|
||||
ts_config = {
|
||||
lua = { "string", "source" },
|
||||
javascript = { "string", "template_string" },
|
||||
java = false,
|
||||
},
|
||||
disable_filetype = { "TelescopePrompt", "spectre_panel" },
|
||||
ignored_next_char = "[%w%.*]", -- don't place autopairs when cursor sits infront of any character.
|
||||
fast_wrap = {
|
||||
map = "<C-e>",
|
||||
chars = { "{", "[", "(", '"', "'" },
|
||||
pattern = string.gsub([[ [%'%"%)%>%]%)%}%,] ]], "%s+", ""),
|
||||
offset = 0, -- Offset from pattern match
|
||||
end_key = "$",
|
||||
keys = "qwertyuiopzxcvbnmasdfghjkl",
|
||||
check_comma = true,
|
||||
highlight = "PmenuSel",
|
||||
highlight_grey = "LineNr",
|
||||
},
|
||||
}
|
||||
|
||||
local cmp_autopairs = require "nvim-autopairs.completion.cmp"
|
||||
local cmp_status_ok, cmp = pcall(require, "cmp")
|
||||
if not cmp_status_ok then
|
||||
return
|
||||
return
|
||||
end
|
||||
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done { map_char = { tex = "" } })
|
||||
|
||||
@ -1,57 +0,0 @@
|
||||
local status_ok, browse = pcall(require, "browse")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
browse.setup {
|
||||
provider = "brave",
|
||||
}
|
||||
|
||||
local bookmarks = {
|
||||
"https://duckduckgo.com/",
|
||||
"https://www.chrisatmachine.com/",
|
||||
"https://github.com/christianchiarulli",
|
||||
"https://github.com/rockerBOO/awesome-neovim",
|
||||
"https://signin.aws.amazon.com/signin",
|
||||
"https://doc.rust-lang.org/book/",
|
||||
"https://aur.archlinux.org/packages/",
|
||||
"https://news.ycombinator.com/",
|
||||
}
|
||||
|
||||
local function command(name, rhs, opts)
|
||||
opts = opts or {}
|
||||
vim.api.nvim_create_user_command(name, rhs, opts)
|
||||
end
|
||||
|
||||
command("BrowseInputSearch", function()
|
||||
browse.input_search()
|
||||
end, {})
|
||||
|
||||
command("Browse", function()
|
||||
browse.browse { bookmarks = bookmarks }
|
||||
end, {})
|
||||
|
||||
command("BrowseBookmarks", function()
|
||||
browse.open_bookmarks { bookmarks = bookmarks }
|
||||
end, {})
|
||||
|
||||
command("BrowseDevdocsSearch", function()
|
||||
browse.devdocs.search()
|
||||
end, {})
|
||||
|
||||
command("BrowseDevdocsFiletypeSearch", function()
|
||||
browse.devdocs.search_with_filetype()
|
||||
end, {})
|
||||
|
||||
command("BrowseMdnSearch", function()
|
||||
browse.mdn.search()
|
||||
end, {})
|
||||
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
||||
local keymap = vim.api.nvim_set_keymap
|
||||
|
||||
keymap("n", "<m-o>", "<cmd>BrowseBookmarks<cr>", opts)
|
||||
|
||||
-- Broken, causes segfault.
|
||||
-- keymap("n", "<m-i>", "<cmd>BrowseInputSearch<cr>", opts)
|
||||
@ -38,11 +38,6 @@ local icons = require "user.icons"
|
||||
local kind_icons = icons.kind
|
||||
|
||||
-- I don't have most of the following but they can serve as future examples
|
||||
vim.api.nvim_set_hl(0, "CmpItemKindCopilot", { fg = "#6CC644" })
|
||||
vim.api.nvim_set_hl(0, "CmpItemKindTabnine", { fg = "#CA42F0" })
|
||||
vim.api.nvim_set_hl(0, "CmpItemKindEmoji", { fg = "#FDE030" })
|
||||
vim.api.nvim_set_hl(0, "CmpItemKindCrate", { fg = "#F64D00" })
|
||||
|
||||
vim.g.cmp_active = true
|
||||
|
||||
cmp.setup {
|
||||
@ -128,25 +123,6 @@ cmp.setup {
|
||||
-- Kind icons
|
||||
vim_item.kind = kind_icons[vim_item.kind]
|
||||
|
||||
if entry.source.name == "cmp_tabnine" then
|
||||
vim_item.kind = icons.misc.Robot
|
||||
vim_item.kind_hl_group = "CmpItemKindTabnine"
|
||||
end
|
||||
if entry.source.name == "copilot" then
|
||||
vim_item.kind = icons.git.Octoface
|
||||
vim_item.kind_hl_group = "CmpItemKindCopilot"
|
||||
end
|
||||
|
||||
if entry.source.name == "emoji" then
|
||||
vim_item.kind = icons.misc.Smiley
|
||||
vim_item.kind_hl_group = "CmpItemKindEmoji"
|
||||
end
|
||||
|
||||
if entry.source.name == "crates" then
|
||||
vim_item.kind = icons.misc.Package
|
||||
vim_item.kind_hl_group = "CmpItemKindCrate"
|
||||
end
|
||||
|
||||
if entry.source.name == "lab.quick_data" then
|
||||
vim_item.kind = icons.misc.CircuitBoard
|
||||
vim_item.kind_hl_group = "CmpItemKindConstant"
|
||||
@ -154,24 +130,16 @@ cmp.setup {
|
||||
|
||||
-- NOTE: order matters
|
||||
vim_item.menu = ({
|
||||
nvim_lsp = "",
|
||||
nvim_lua = "",
|
||||
luasnip = "",
|
||||
buffer = "",
|
||||
path = "",
|
||||
emoji = "",
|
||||
nvim_lsp = "[LSP]",
|
||||
nvim_lua = "[LUA]",
|
||||
luasnip = "[SNP]",
|
||||
buffer = "[BUF]",
|
||||
path = "[PTH]",
|
||||
})[entry.source.name]
|
||||
return vim_item
|
||||
end,
|
||||
},
|
||||
sources = {
|
||||
{
|
||||
name = "crates", group_index = 1 },
|
||||
{
|
||||
name = "copilot",
|
||||
max_item_count = 3,
|
||||
group_index = 2,
|
||||
},
|
||||
{
|
||||
name = "nvim_lsp",
|
||||
filter = function(entry, ctx)
|
||||
@ -198,7 +166,6 @@ cmp.setup {
|
||||
end,
|
||||
},
|
||||
{ name = "path", group_index = 2 },
|
||||
{ name = "emoji", group_index = 2 },
|
||||
{ name = "lab.quick_data", keyword_length = 4, group_index = 2 },
|
||||
},
|
||||
sorting = {
|
||||
|
||||
@ -3,15 +3,4 @@ if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
colorizer.setup({ "*" }, {
|
||||
RGB = true, -- #RGB hex codes
|
||||
RRGGBB = true, -- #RRGGBB hex codes
|
||||
names = false, -- "Name" codes like Blue oe blue
|
||||
RRGGBBAA = true, -- #RRGGBBAA hex codes
|
||||
rgb_fn = true, -- CSS rgb() and rgba() functions
|
||||
hsl_fn = true, -- CSS hsl() and hsla() functions
|
||||
css = false, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB
|
||||
css_fn = false, -- Enable all CSS *functions*: rgb_fn, hsl_fn
|
||||
-- Available modes: foreground, background, virtualtext
|
||||
mode = "background", -- Set the display mode.)
|
||||
})
|
||||
colorizer.setup()
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
local colorscheme = "gruvbox-material"
|
||||
local colorscheme = "base16-gruvbox-dark-medium"
|
||||
|
||||
local status_ok, _ = pcall(vim.cmd, "colorscheme " .. colorscheme)
|
||||
if not status_ok then
|
||||
vim.notify("colorscheme " .. colorscheme .. " not found!")
|
||||
return
|
||||
local s_ok, _ = pcall(vim.cmd, "colorscheme " .. colorscheme)
|
||||
|
||||
if not s_ok then
|
||||
vim.notify("Colorscheme" .. colorscheme .. " not found!")
|
||||
return
|
||||
end
|
||||
|
||||
@ -1,40 +0,0 @@
|
||||
-- NOTE!
|
||||
-- I AM NOT USING THIS, IT'S HERE IF I CHOOSE TO IN THE FUTURE!
|
||||
-- PROBABLY NOT THOUGH...
|
||||
|
||||
-- For copilot.vim
|
||||
-- vim.g.copilot_filetypes = {
|
||||
-- ["*"] = false,
|
||||
-- }
|
||||
|
||||
-- vim.cmd [[
|
||||
-- imap <silent><script><expr> <C-A> copilot#Accept("\<CR>")
|
||||
-- let g:copilot_no_tab_map = v:true
|
||||
-- ]]
|
||||
|
||||
local status_ok, copilot = pcall(require, "copilot")
|
||||
if not status_ok then
|
||||
print "copilot error!"
|
||||
return
|
||||
end
|
||||
|
||||
copilot.setup {
|
||||
cmp = {
|
||||
enabled = true,
|
||||
method = "getCompletionsCycling",
|
||||
},
|
||||
panel = { -- no config options yet
|
||||
enabled = true,
|
||||
},
|
||||
ft_disable = { "markdown" },
|
||||
-- plugin_manager_path = vim.fn.stdpath "data" .. "/site/pack/packer",
|
||||
server_opts_overrides = {
|
||||
-- trace = "verbose",
|
||||
settings = {
|
||||
advanced = {
|
||||
-- listCount = 10, -- #completions for panel
|
||||
inlineSuggestCount = 3, -- #completions for getCompletions
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@ -1,80 +0,0 @@
|
||||
local dap_status_ok, dap = pcall(require, "dap")
|
||||
if not dap_status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local dap_ui_status_ok, dapui = pcall(require, "dapui")
|
||||
if not dap_ui_status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
-- dapui.setup()
|
||||
dapui.setup {
|
||||
icons = { expanded = "▾", collapsed = "▸" },
|
||||
mappings = {
|
||||
-- Use a table to apply multiple mappings
|
||||
expand = { "<CR>", "<2-LeftMouse>" },
|
||||
open = "o",
|
||||
remove = "d",
|
||||
edit = "e",
|
||||
repl = "r",
|
||||
toggle = "t",
|
||||
},
|
||||
-- Expand lines larger than the window
|
||||
-- Requires >= 0.7
|
||||
expand_lines = vim.fn.has "nvim-0.7",
|
||||
-- Layouts define sections of the screen to place windows.
|
||||
-- The position can be "left", "right", "top" or "bottom".
|
||||
-- The size specifies the height/width depending on position. It can be an Int
|
||||
-- or a Float. Integer specifies height/width directly (i.e. 20 lines/columns) while
|
||||
-- Float value specifies percentage (i.e. 0.3 - 30% of available lines/columns)
|
||||
-- Elements are the elements shown in the layout (in order).
|
||||
-- Layouts are opened in order so that earlier layouts take priority in window sizing.
|
||||
layouts = {
|
||||
{
|
||||
elements = {
|
||||
-- Elements can be strings or table with id and size keys.
|
||||
{ id = "scopes", size = 0.25 },
|
||||
"breakpoints",
|
||||
-- "stacks",
|
||||
-- "watches",
|
||||
},
|
||||
size = 40, -- 40 columns
|
||||
position = "right",
|
||||
},
|
||||
{
|
||||
elements = {
|
||||
"repl",
|
||||
"console",
|
||||
},
|
||||
size = 0.25, -- 25% of total lines
|
||||
position = "bottom",
|
||||
},
|
||||
},
|
||||
floating = {
|
||||
max_height = nil, -- These can be integers or a float between 0 and 1.
|
||||
max_width = nil, -- Floats will be treated as percentage of your screen.
|
||||
border = "single", -- Border style. Can be "single", "double" or "rounded"
|
||||
mappings = {
|
||||
close = { "q", "<Esc>" },
|
||||
},
|
||||
},
|
||||
windows = { indent = 1 },
|
||||
render = {
|
||||
max_type_length = nil, -- Can be integer or nil.
|
||||
},
|
||||
}
|
||||
|
||||
local icons = require "user.icons"
|
||||
|
||||
vim.fn.sign_define("DapBreakpoint", { text = icons.ui.Bug, texthl = "DiagnosticSignError", linehl = "", numhl = "" })
|
||||
|
||||
dap.listeners.after.event_initialized["dapui_config"] = function()
|
||||
dapui.open {}
|
||||
end
|
||||
dap.listeners.before.event_terminated["dapui_config"] = function()
|
||||
dapui.close {}
|
||||
end
|
||||
dap.listeners.before.event_exited["dapui_config"] = function()
|
||||
dapui.close {}
|
||||
end
|
||||
@ -1,55 +1,5 @@
|
||||
local M = {}
|
||||
|
||||
vim.cmd [[
|
||||
function Test()
|
||||
%SnipRun
|
||||
call feedkeys("\<esc>`.")
|
||||
endfunction
|
||||
function TestI()
|
||||
let b:caret = winsaveview()
|
||||
%SnipRun
|
||||
call winrestview(b:caret)
|
||||
endfunction
|
||||
]]
|
||||
|
||||
function M.sniprun_enable()
|
||||
vim.cmd [[
|
||||
%SnipRun
|
||||
augroup _sniprun
|
||||
autocmd!
|
||||
autocmd TextChanged * call Test()
|
||||
autocmd TextChangedI * call TestI()
|
||||
augroup end
|
||||
]]
|
||||
vim.notify "Enabled SnipRun"
|
||||
end
|
||||
|
||||
function M.disable_sniprun()
|
||||
M.remove_augroup "_sniprun"
|
||||
vim.cmd [[
|
||||
SnipClose
|
||||
SnipTerminate
|
||||
]]
|
||||
vim.notify "Disabled SnipRun"
|
||||
end
|
||||
|
||||
function M.toggle_sniprun()
|
||||
if vim.fn.exists "#_sniprun#TextChanged" == 0 then
|
||||
M.sniprun_enable()
|
||||
else
|
||||
M.disable_sniprun()
|
||||
end
|
||||
end
|
||||
|
||||
function M.remove_augroup(name)
|
||||
if vim.fn.exists("#" .. name) == 1 then
|
||||
vim.cmd("au! " .. name)
|
||||
end
|
||||
end
|
||||
|
||||
vim.cmd [[ command! SnipRunToggle execute 'lua require("user.functions").toggle_sniprun()' ]]
|
||||
|
||||
-- get length of current word
|
||||
function M.get_word_length()
|
||||
local word = vim.fn.expand "<cword>"
|
||||
return #word
|
||||
|
||||
@ -1,28 +0,0 @@
|
||||
-- NOTE!
|
||||
-- Not using this currently, might be useful in future but for now I'm happy with default nvim.
|
||||
|
||||
local status_ok, hop = pcall(require, "hop")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
hop.setup()
|
||||
|
||||
local opts = { noremap = true, silent = true }
|
||||
local keymap = vim.api.nvim_set_keymap
|
||||
|
||||
|
||||
|
||||
keymap("", "L", ":HopWordCurrentLine<cr>", { silent = true })
|
||||
-- keymap("", "S", ":HopChar2<cr>", { silent = true })
|
||||
-- keymap("", "Q", ":HopPattern<cr>", { silent = true })
|
||||
keymap("", "H", ":HopChar2<cr>", { silent = true })
|
||||
|
||||
keymap("o", "f", ":lua require'hop'.hint_char1({ direction = require'hop.hint'.HintDirection.AFTER_CURSOR, current_line_only = true })<CR>", opts)
|
||||
keymap("o", "F", ":lua require'hop'.hint_char1({ direction = require'hop.hint'.HintDirection.BEFORE_CURSOR, current_line_only = true })<CR>", opts)
|
||||
keymap("o", "t", ":lua require'hop'.hint_char1({ direction = require'hop.hint'.HintDirection.AFTER_CURSOR, current_line_only = true, hint_offset = -1 })<CR>", opts)
|
||||
keymap("o", "T", ":lua require'hop'.hint_char1({ direction = require'hop.hint'.HintDirection.BEFORE_CURSOR, current_line_only = true, hint_offset = 1 })<CR>", opts)
|
||||
|
||||
keymap("n", "f", ":lua require'hop'.hint_char1({ direction = require'hop.hint'.HintDirection.AFTER_CURSOR, current_line_only = true })<CR>", opts)
|
||||
keymap("n", "F", ":lua require'hop'.hint_char1({ direction = require'hop.hint'.HintDirection.BEFORE_CURSOR, current_line_only = true })<CR>", opts)
|
||||
keymap("n", "t", ":lua require'hop'.hint_char1({ direction = require'hop.hint'.HintDirection.AFTER_CURSOR, current_line_only = true, hint_offset = -1 })<CR>", opts)
|
||||
keymap("n", "T", ":lua require'hop'.hint_char1({ direction = require'hop.hint'.HintDirection.BEFORE_CURSOR, current_line_only = true, hint_offset = 1 })<CR>", opts)
|
||||
@ -1,11 +0,0 @@
|
||||
require('illuminate').configure({
|
||||
providers = {
|
||||
'lsp',
|
||||
'treesitter',
|
||||
'regex',
|
||||
},
|
||||
delay = 100,
|
||||
filetypes_denylist = {
|
||||
'alpha',
|
||||
},
|
||||
})
|
||||
@ -15,59 +15,13 @@ vim.g.indent_blankline_filetype_exclude = {
|
||||
"text"
|
||||
}
|
||||
vim.g.indentLine_enabled = 1
|
||||
-- vim.g.indent_blankline_char = "│"
|
||||
vim.g.indent_blankline_char = "▏"
|
||||
-- vim.g.indent_blankline_char = "▎"
|
||||
|
||||
vim.g.indent_blankline_show_trailing_blankline_indent = false
|
||||
vim.g.indent_blankline_show_first_indent_level = true
|
||||
vim.g.indent_blankline_use_treesitter = false
|
||||
-- vim.g.indent_blankline_use_treesitter_scope = 1
|
||||
vim.g.indent_blankline_show_current_context = true
|
||||
-- vim.g.indent_blankline_context_patterns = {
|
||||
-- "class",
|
||||
-- "return",
|
||||
-- "function",
|
||||
-- "method",
|
||||
-- "^if",
|
||||
-- "^while",
|
||||
-- "jsx_element",
|
||||
-- "^for",
|
||||
-- "^object",
|
||||
-- "^table",
|
||||
-- "block",
|
||||
-- "arguments",
|
||||
-- "if_statement",
|
||||
-- "else_clause",
|
||||
-- "jsx_element",
|
||||
-- "jsx_self_closing_element",
|
||||
-- "try_statement",
|
||||
-- "catch_clause",
|
||||
-- "import_statement",
|
||||
-- "operation_type",
|
||||
-- }
|
||||
-- HACK: work-around for https://github.com/lukas-reineke/indent-blankline.nvim/issues/59
|
||||
-- vim.wo.colorcolumn = "99999"
|
||||
|
||||
-- vim.cmd [[highlight IndentBlanklineIndent1 guifg=#E06C75 gui=nocombine]]
|
||||
-- vim.cmd [[highlight IndentBlanklineIndent2 guifg=#E5C07B gui=nocombine]]
|
||||
-- vim.cmd [[highlight IndentBlanklineIndent3 guifg=#98C379 gui=nocombine]]
|
||||
-- vim.cmd [[highlight IndentBlanklineIndent4 guifg=#56B6C2 gui=nocombine]]
|
||||
-- vim.cmd [[highlight IndentBlanklineIndent5 guifg=#61AFEF gui=nocombine]]
|
||||
-- vim.cmd [[highlight IndentBlanklineIndent6 guifg=#C678DD gui=nocombine]]
|
||||
-- vim.opt.list = true
|
||||
-- vim.opt.listchars:append "space:⋅"
|
||||
-- vim.opt.listchars:append "space:"
|
||||
-- vim.opt.listchars:append "eol:↴"
|
||||
|
||||
indent_blankline.setup {
|
||||
-- show_end_of_line = true,
|
||||
-- space_char_blankline = " ",
|
||||
show_current_context = true,
|
||||
-- show_current_context_start = true,
|
||||
-- char_highlight_list = {
|
||||
-- "IndentBlanklineIndent1",
|
||||
-- "IndentBlanklineIndent2",
|
||||
-- "IndentBlanklineIndent3",
|
||||
-- },
|
||||
}
|
||||
|
||||
@ -1,85 +1,49 @@
|
||||
local opts = { noremap = true, silent = true }
|
||||
local term_opts = { silent = true }
|
||||
|
||||
-- Shorten function name
|
||||
local keymap = vim.api.nvim_set_keymap
|
||||
local map = vim.api.nvim_set_keymap
|
||||
|
||||
--Remap space as leader key
|
||||
keymap("n", "<Space>", "", opts)
|
||||
-- set Space as leader key
|
||||
map("n", "<Space>", "", opts)
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = " "
|
||||
|
||||
-- Modes
|
||||
-- normal_mode = 'n',
|
||||
-- insert_mode = 'i',
|
||||
-- visual_mode = 'v',
|
||||
-- visual_block_mode = 'x',
|
||||
-- term_mode = 't',
|
||||
-- command_mode = 'c',
|
||||
|
||||
keymap("n", "c", '"_c', opts)
|
||||
|
||||
-- Normal --
|
||||
-- Resize with arrows
|
||||
keymap("n", "<C-Up>", ":resize -2<CR>", opts)
|
||||
keymap("n", "<C-Down>", ":resize +2<CR>", opts)
|
||||
keymap("n", "<C-Left>", ":vertical resize -2<CR>", opts)
|
||||
keymap("n", "<C-Right>", ":vertical resize +2<CR>", opts)
|
||||
|
||||
-- Naviagate buffers
|
||||
keymap("n", "<S-l>", ":BufferLineCycleNext<CR>", opts)
|
||||
keymap("n", "<S-h>", ":BufferLineCyclePrev<CR>", opts)
|
||||
|
||||
-- NORMAL
|
||||
-- Move text up and down
|
||||
keymap("n", "<A-j>", "<Esc>:m .+1<CR>==gi", opts)
|
||||
keymap("n", "<A-k>", "<Esc>:m .-2<CR>==gi", opts)
|
||||
map("n", "<C-k>", "<ESC>:m .-2<CR>==", opts)
|
||||
map("n", "<C-j>", "<ESC>:m .+1<CR>==", opts)
|
||||
|
||||
-- Insert --
|
||||
-- Press jk fast to enter
|
||||
keymap("i", "jk", "<ESC>", opts)
|
||||
keymap("i", "zzz", "<ESC> zz a", opts)
|
||||
|
||||
-- Visual --
|
||||
-- Stay in indent mode
|
||||
keymap("v", "<", "<gv", opts)
|
||||
keymap("v", ">", ">gv", opts)
|
||||
|
||||
-- Move text up and down
|
||||
keymap("v", "<A-j>", ":m .+1<CR>==", opts)
|
||||
keymap("v", "<A-k>", ":m .-2<CR>==", opts)
|
||||
keymap("v", "p", '"_dP', opts)
|
||||
keymap("v", "P", '"_dP', opts)
|
||||
|
||||
-- My bit's an pieces currently unsorted
|
||||
-- Spellcheck
|
||||
keymap("n", "<leader>o", ":setlocal spell! spelllang=en_us<CR>", opts)
|
||||
|
||||
-- Tree
|
||||
-- keymap("n", "<leader>n", ":NvimTreeToggle<CR>", opts)
|
||||
|
||||
-- Goyo
|
||||
-- keymap("n", "<leader>f", ":Goyo<CR>", opts)
|
||||
|
||||
-- Copy and Paste
|
||||
keymap("n", "<C-c>", '"+y', opts)
|
||||
keymap("n", "<C-p", '"+p', opts)
|
||||
|
||||
-- Replace All is S
|
||||
-- keymap('n', '<S-s>', ':%s//g<Left><Left>', opts)
|
||||
|
||||
-- Compile the document with default compiler script
|
||||
-- vim.cmd([[map <leader>c :w! \| !compiler "<c-r>%"<CR>]])
|
||||
keymap('n', '<leader>c', ':w! | !compiler <c-r>%<CR>', opts)
|
||||
|
||||
-- Open compiled document
|
||||
keymap("n", "<leader>p", ":!opout <c-r>%<CR><CR>", opts)
|
||||
|
||||
-- Attempt sudo for files that require it
|
||||
keymap("n", "w!!", 'execute "silent! write !sudo tee % >/dev/null" <bar> edit!', opts)
|
||||
|
||||
-- ZenMode
|
||||
keymap("n", "<C-z>", "<cmd>ZenMode<cr>", opts)
|
||||
-- Copy/Paste
|
||||
map("n", "<C-y>", '"+y', opts)
|
||||
map("n", "<C-p>", '"+y', opts)
|
||||
|
||||
-- Save
|
||||
keymap("i", "<C-s>", "<ESC>:w<CR>a", opts)
|
||||
keymap("n", "<C-s>", ":w<CR>", opts)
|
||||
map("n", "<C-s>", ":w<CR>", opts)
|
||||
|
||||
-- Switch between buffers
|
||||
map("n", "<S-l>", ":bnext<CR>", opts)
|
||||
map("n", "<S-h>", ":bprevious<CR>", opts)
|
||||
|
||||
-- Show definition
|
||||
map("n", "<S-k>", ":lua vim.lsp.buf.hover()<CR>", opts)
|
||||
|
||||
-- INSERT
|
||||
-- Easy exit insert mode
|
||||
map("i", "jk", "<ESC>", opts)
|
||||
|
||||
-- Paste
|
||||
map("i", "<C-p>", '"+y', opts)
|
||||
|
||||
-- Save
|
||||
map("i", "<C-s>", "<ESC>:w<CR>a", opts)
|
||||
|
||||
-- VISUAL
|
||||
-- Indenting
|
||||
map("v", "<", "<gv", opts)
|
||||
map("v", ">", ">gv", opts)
|
||||
|
||||
-- Move text up and down
|
||||
map("v", "<C-j>", ":m .+1<CR>==<ESC>V", opts)
|
||||
map("v", "<C-k>", ":m .-2<CR>==<ESC>V", opts)
|
||||
|
||||
-- Copy
|
||||
map("v", "<C-y>", '"+y', opts)
|
||||
|
||||
@ -1,84 +0,0 @@
|
||||
local status_ok, lir = pcall(require, "lir")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local actions = require "lir.actions"
|
||||
local mark_actions = require "lir.mark.actions"
|
||||
local clipboard_actions = require "lir.clipboard.actions"
|
||||
|
||||
lir.setup {
|
||||
show_hidden_files = false,
|
||||
devicons_enable = true,
|
||||
mappings = {
|
||||
["l"] = actions.edit,
|
||||
["<C-s>"] = actions.split,
|
||||
["v"] = actions.vsplit,
|
||||
["<C-t>"] = actions.tabedit,
|
||||
|
||||
["h"] = actions.up,
|
||||
["q"] = actions.quit,
|
||||
|
||||
["A"] = actions.mkdir,
|
||||
["a"] = actions.newfile,
|
||||
["r"] = actions.rename,
|
||||
["@"] = actions.cd,
|
||||
["Y"] = actions.yank_path,
|
||||
["i"] = actions.toggle_show_hidden,
|
||||
["d"] = actions.delete,
|
||||
|
||||
["J"] = function()
|
||||
mark_actions.toggle_mark()
|
||||
vim.cmd "normal! j"
|
||||
end,
|
||||
["c"] = clipboard_actions.copy,
|
||||
["x"] = clipboard_actions.cut,
|
||||
["p"] = clipboard_actions.paste,
|
||||
},
|
||||
float = {
|
||||
winblend = 0,
|
||||
curdir_window = {
|
||||
enable = false,
|
||||
highlight_dirname = true,
|
||||
},
|
||||
|
||||
-- -- You can define a function that returns a table to be passed as the third
|
||||
-- -- argument of nvim_open_win().
|
||||
win_opts = function()
|
||||
local width = math.floor(vim.o.columns * 0.7)
|
||||
local height = math.floor(vim.o.lines * 0.7)
|
||||
return {
|
||||
border = "rounded",
|
||||
width = width,
|
||||
height = height,
|
||||
-- row = 1,
|
||||
-- col = math.floor((vim.o.columns - width) / 2),
|
||||
}
|
||||
end,
|
||||
},
|
||||
hide_cursor = false,
|
||||
on_init = function()
|
||||
-- use visual mode
|
||||
vim.api.nvim_buf_set_keymap(
|
||||
0,
|
||||
"x",
|
||||
"J",
|
||||
':<C-u>lua require"lir.mark.actions".toggle_mark("v")<CR>',
|
||||
{ noremap = true, silent = true }
|
||||
)
|
||||
|
||||
-- echo cwd
|
||||
-- vim.api.nvim_echo({ { vim.fn.expand "%:p", "Normal" } }, false, {})
|
||||
end,
|
||||
}
|
||||
|
||||
-- custom folder icon
|
||||
require("nvim-web-devicons").set_icon {
|
||||
lir_folder_icon = {
|
||||
icon = "",
|
||||
-- color = "#7ebae4",
|
||||
-- color = "#569CD6",
|
||||
color = "#42A5F5",
|
||||
name = "LirFolderNode",
|
||||
},
|
||||
}
|
||||
@ -1,50 +0,0 @@
|
||||
local status_ok, hints = pcall(require, "lsp-inlayhints")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local group = vim.api.nvim_create_augroup("LspAttach_inlayhints", {})
|
||||
-- Busted and not sure why.
|
||||
--vim.api.nvim_create_autocmd("LspAttach", {
|
||||
-- group = "LspAttach_inlayhints",
|
||||
-- callback = function(args)
|
||||
-- if not (args.data and args.data.client_id) then
|
||||
-- return
|
||||
-- end
|
||||
--
|
||||
-- local client = vim.lsp.get_client_by_id(args.data.client_id)
|
||||
-- require("lsp-inlayhints").on_attach(args.buf, client)
|
||||
-- end,
|
||||
--})
|
||||
|
||||
hints.setup {
|
||||
inlay_hints = {
|
||||
parameter_hints = {
|
||||
show = false,
|
||||
-- prefix = "<- ",
|
||||
separator = ", ",
|
||||
},
|
||||
type_hints = {
|
||||
-- type and other hints
|
||||
show = true,
|
||||
prefix = "",
|
||||
separator = ", ",
|
||||
remove_colon_end = false,
|
||||
remove_colon_start = false,
|
||||
},
|
||||
-- separator between types and parameter hints. Note that type hints are
|
||||
-- shown before parameter
|
||||
labels_separator = " ",
|
||||
-- whether to align to the length of the longest line in the file
|
||||
max_len_align = false,
|
||||
-- padding from the left if max_len_align is true
|
||||
max_len_align_padding = 1,
|
||||
-- whether to align to the extreme right or not
|
||||
right_align = false,
|
||||
-- padding from the right if right_align is true
|
||||
right_align_padding = 7,
|
||||
-- highlight group
|
||||
highlight = "Comment",
|
||||
},
|
||||
debug_mode = false,
|
||||
}
|
||||
@ -7,6 +7,7 @@ if not status_cmp_ok then
|
||||
print "cmp_nvim_lsp error!"
|
||||
return
|
||||
end
|
||||
|
||||
M.capabilities.textDocument.completion.completionItem.snippetSupport = true
|
||||
M.capabilities = cmp_nvim_lsp.update_capabilities(M.capabilities)
|
||||
|
||||
@ -74,17 +75,6 @@ M.setup = function()
|
||||
})
|
||||
end
|
||||
|
||||
local function lsp_highlight_document(client)
|
||||
-- if client.server_capabilities.document_highlight then
|
||||
local status_ok, illuminate = pcall(require, "illuminate")
|
||||
if not status_ok then
|
||||
print "illuminate error!"
|
||||
return
|
||||
end
|
||||
illuminate.on_attach(client)
|
||||
-- end
|
||||
end
|
||||
|
||||
local function attach_navic(client, bufnr)
|
||||
vim.g.navic_silence = true
|
||||
local status_ok, navic = pcall(require, "nvim-navic")
|
||||
@ -118,20 +108,7 @@ end
|
||||
|
||||
M.on_attach = function(client, bufnr)
|
||||
lsp_keymaps(bufnr)
|
||||
lsp_highlight_document(client)
|
||||
attach_navic(client, bufnr)
|
||||
|
||||
if client.name == "tsserver" then
|
||||
require("lsp-inlayhints").on_attach(bufnr, client)
|
||||
end
|
||||
|
||||
if client.name == "jdt.ls" then
|
||||
vim.lsp.codelens.refresh()
|
||||
if JAVA_DAP_ACTIVE then
|
||||
require("jdtls").setup_dap { hotcodereplace = "auto" }
|
||||
require("jdtls.dap").setup_dap_main_class_configs()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function M.enable_format_on_save()
|
||||
|
||||
@ -2,40 +2,20 @@ M = {}
|
||||
|
||||
local status_ok, _ = pcall(require, "lspconfig")
|
||||
if not status_ok then
|
||||
print "lspconfig error!"
|
||||
return
|
||||
print "lspconfig error!"
|
||||
return
|
||||
end
|
||||
|
||||
M.server_capabilities = function()
|
||||
local active_clients = vim.lsp.get_active_clients()
|
||||
local active_client_map = {}
|
||||
|
||||
for index, value in ipairs(active_clients) do
|
||||
active_client_map[value.name] = index
|
||||
end
|
||||
|
||||
vim.ui.select(vim.tbl_keys(active_client_map), {
|
||||
prompt = "Select client:",
|
||||
format_item = function(item)
|
||||
return "capabilites for: " .. item
|
||||
end,
|
||||
}, function(choice)
|
||||
print(active_client_map[choice])
|
||||
print(vim.inspect(vim.lsp.get_active_clients()[active_client_map[choice]].server_capabilities.executeCommandProvider))
|
||||
vim.pretty_print(vim.lsp.get_active_clients()[active_client_map[choice]].server_capabilities)
|
||||
end)
|
||||
end
|
||||
|
||||
require "user.lsp.lsp-signature"
|
||||
-- require "user.lsp.lsp-installer"
|
||||
-- may add signature in future.
|
||||
-- require "user.lsp.lsp-signature"
|
||||
require("user.lsp.mason")
|
||||
require("user.lsp.handlers").setup()
|
||||
require "user.lsp.null-ls"
|
||||
-- may add null-ls in future.
|
||||
-- require "user.lsp.null-ls"
|
||||
|
||||
local l_status_ok, lsp_lines = pcall(require, "lsp_lines")
|
||||
if not l_status_ok then
|
||||
print "lsp_lines error!"
|
||||
return
|
||||
return
|
||||
end
|
||||
|
||||
lsp_lines.setup()
|
||||
|
||||
@ -1,59 +0,0 @@
|
||||
local status_ok, signature = pcall(require, "lsp_signature")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local icons = require "user.icons"
|
||||
|
||||
local cfg = {
|
||||
debug = false, -- set to true to enable debug logging
|
||||
log_path = "debug_log_file_path", -- debug log path
|
||||
verbose = false, -- show debug line number
|
||||
|
||||
bind = true, -- This is mandatory, otherwise border config won't get registered.
|
||||
-- If you want to hook lspsaga or other signature handler, pls set to false
|
||||
doc_lines = 0, -- will show two lines of comment/doc(if there are more than two lines in doc, will be truncated);
|
||||
-- set to 0 if you DO NOT want any API comments be shown
|
||||
-- This setting only take effect in insert mode, it does not affect signature help in normal
|
||||
-- mode, 10 by default
|
||||
|
||||
floating_window = false, -- show hint in a floating window, set to false for virtual text only mode
|
||||
|
||||
floating_window_above_cur_line = false, -- try to place the floating above the current line when possible Note:
|
||||
-- will set to true when fully tested, set to false will use whichever side has more space
|
||||
-- this setting will be helpful if you do not want the PUM and floating win overlap
|
||||
fix_pos = false, -- set to true, the floating window will not auto-close until finish all parameters
|
||||
hint_enable = true, -- virtual hint enable
|
||||
hint_prefix = icons.misc.Squirrel .. " ", -- Panda for parameter
|
||||
hint_scheme = "Comment",
|
||||
use_lspsaga = false, -- set to true if you want to use lspsaga popup
|
||||
hi_parameter = "LspSignatureActiveParameter", -- how your parameter will be highlight
|
||||
max_height = 12, -- max height of signature floating_window, if content is more than max_height, you can scroll down
|
||||
-- to view the hiding contents
|
||||
max_width = 120, -- max_width of signature floating_window, line will be wrapped if exceed max_width
|
||||
handler_opts = {
|
||||
border = "rounded", -- double, rounded, single, shadow, none
|
||||
},
|
||||
|
||||
always_trigger = false, -- sometime show signature on new line or in middle of parameter can be confusing, set it to false for #58
|
||||
|
||||
auto_close_after = nil, -- autoclose signature float win after x sec, disabled if nil.
|
||||
extra_trigger_chars = {}, -- Array of extra characters that will trigger signature completion, e.g., {"(", ","}
|
||||
zindex = 200, -- by default it will be on top of all floating windows, set to <= 50 send it to bottom
|
||||
|
||||
padding = "", -- character to pad on left and right of signature can be ' ', or '|' etc
|
||||
|
||||
transparency = nil, -- disabled by default, allow floating win transparent value 1~100
|
||||
shadow_blend = 36, -- if you using shadow as border use this set the opacity
|
||||
shadow_guibg = "Black", -- if you using shadow as border use this set the color e.g. 'Green' or '#121315'
|
||||
timer_interval = 200, -- default timer check interval set to lower value if you want to reduce latency
|
||||
toggle_key = nil, -- toggle signature on and off in insert mode, e.g. toggle_key = '<M-x>'
|
||||
}
|
||||
|
||||
-- recommanded:
|
||||
signature.setup(cfg) -- no need to specify bufnr if you don't use toggle_key
|
||||
|
||||
-- You can also do this inside lsp on_attach
|
||||
-- note: on_attach deprecated
|
||||
-- require("lsp_signature").on_attach(cfg, bufnr) -- no need to specify bufnr if you don't use toggle_key
|
||||
signature.on_attach(cfg) -- no need to specify bufnr if you don't use toggle_key
|
||||
@ -1,151 +1,151 @@
|
||||
local status_ok, mason = pcall(require, "mason")
|
||||
if not status_ok then
|
||||
return
|
||||
return
|
||||
end
|
||||
|
||||
local status_ok_1, mason_lspconfig = pcall(require, "mason-lspconfig")
|
||||
if not status_ok_1 then
|
||||
return
|
||||
return
|
||||
end
|
||||
|
||||
local servers = {
|
||||
"cssls",
|
||||
"cssmodules_ls",
|
||||
"emmet_ls",
|
||||
"html",
|
||||
"jdtls",
|
||||
"jsonls",
|
||||
"solc",
|
||||
"solidity_ls",
|
||||
"sumneko_lua",
|
||||
"tflint",
|
||||
"terraformls",
|
||||
"tsserver",
|
||||
"pyright",
|
||||
"yamlls",
|
||||
"bashls",
|
||||
"clangd",
|
||||
"rust_analyzer",
|
||||
"taplo",
|
||||
"zk@v0.10.1",
|
||||
"lemminx",
|
||||
"clangd"
|
||||
"cssls",
|
||||
"cssmodules_ls",
|
||||
"emmet_ls",
|
||||
"html",
|
||||
"jdtls",
|
||||
"solc",
|
||||
"solidity_ls",
|
||||
"sumneko_lua",
|
||||
"omnisharp",
|
||||
"tflint",
|
||||
"terraformls",
|
||||
"tsserver",
|
||||
"pyright",
|
||||
"yamlls",
|
||||
"bashls",
|
||||
"clangd",
|
||||
"rust_analyzer",
|
||||
"taplo",
|
||||
"zk@v0.10.1",
|
||||
"lemminx",
|
||||
"clangd"
|
||||
}
|
||||
|
||||
local settings = {
|
||||
ui = {
|
||||
border = "rounded",
|
||||
icons = {
|
||||
package_installed = "◍",
|
||||
package_pending = "◍",
|
||||
package_uninstalled = "◍",
|
||||
ui = {
|
||||
border = "rounded",
|
||||
icons = {
|
||||
package_installed = "◍",
|
||||
package_pending = "◍",
|
||||
package_uninstalled = "◍",
|
||||
},
|
||||
},
|
||||
},
|
||||
log_level = vim.log.levels.INFO,
|
||||
max_concurrent_installers = 4,
|
||||
log_level = vim.log.levels.INFO,
|
||||
max_concurrent_installers = 4,
|
||||
}
|
||||
|
||||
mason.setup(settings)
|
||||
mason_lspconfig.setup {
|
||||
ensure_installed = servers,
|
||||
automatic_installation = true,
|
||||
ensure_installed = servers,
|
||||
automatic_installation = true,
|
||||
}
|
||||
|
||||
local lspconfig_status_ok, lspconfig = pcall(require, "lspconfig")
|
||||
if not lspconfig_status_ok then
|
||||
print "lspconfig error!"
|
||||
return
|
||||
print "lspconfig error!"
|
||||
return
|
||||
end
|
||||
|
||||
local opts = {}
|
||||
|
||||
for _, server in pairs(servers) do
|
||||
opts = {
|
||||
on_attach = require("user.lsp.handlers").on_attach,
|
||||
capabilities = require("user.lsp.handlers").capabilities,
|
||||
}
|
||||
|
||||
server = vim.split(server, "@")[1]
|
||||
|
||||
if server == "jsonls" then
|
||||
local jsonls_opts = require "user.lsp.settings.jsonls"
|
||||
opts = vim.tbl_deep_extend("force", jsonls_opts, opts)
|
||||
end
|
||||
|
||||
if server == "yamlls" then
|
||||
local yamlls_opts = require "user.lsp.settings.yamlls"
|
||||
opts = vim.tbl_deep_extend("force", yamlls_opts, opts)
|
||||
end
|
||||
|
||||
if server == "sumneko_lua" then
|
||||
local l_status_ok, lua_dev = pcall(require, "lua-dev")
|
||||
if not l_status_ok then
|
||||
return
|
||||
end
|
||||
-- local sumneko_opts = require "user.lsp.settings.sumneko_lua"
|
||||
-- opts = vim.tbl_deep_extend("force", sumneko_opts, opts)
|
||||
-- opts = vim.tbl_deep_extend("force", require("lua-dev").setup(), opts)
|
||||
local luadev = lua_dev.setup {
|
||||
-- -- add any options here, or leave empty to use the default settings
|
||||
-- lspconfig = opts,
|
||||
lspconfig = {
|
||||
on_attach = opts.on_attach,
|
||||
capabilities = opts.capabilities,
|
||||
-- -- settings = opts.settings,
|
||||
},
|
||||
opts = {
|
||||
on_attach = require("user.lsp.handlers").on_attach,
|
||||
capabilities = require("user.lsp.handlers").capabilities,
|
||||
}
|
||||
lspconfig.sumneko_lua.setup(luadev)
|
||||
goto continue
|
||||
end
|
||||
|
||||
if server == "tsserver" then
|
||||
local tsserver_opts = require "user.lsp.settings.tsserver"
|
||||
opts = vim.tbl_deep_extend("force", tsserver_opts, opts)
|
||||
end
|
||||
server = vim.split(server, "@")[1]
|
||||
|
||||
if server == "pyright" then
|
||||
local pyright_opts = require "user.lsp.settings.pyright"
|
||||
opts = vim.tbl_deep_extend("force", pyright_opts, opts)
|
||||
end
|
||||
|
||||
if server == "solc" then
|
||||
local solc_opts = require "user.lsp.settings.solc"
|
||||
opts = vim.tbl_deep_extend("force", solc_opts, opts)
|
||||
end
|
||||
|
||||
if server == "clangd" then
|
||||
local clangd_opts = require "user.lsp.settings.clangd"
|
||||
opts = vim.tbl_deep_extend("force", clangd_opts, opts)
|
||||
end
|
||||
|
||||
if server == "emmet_ls" then
|
||||
local emmet_ls_opts = require "user.lsp.settings.emmet_ls"
|
||||
opts = vim.tbl_deep_extend("force", emmet_ls_opts, opts)
|
||||
end
|
||||
|
||||
if server == "zk" then
|
||||
local zk_opts = require "user.lsp.settings.zk"
|
||||
opts = vim.tbl_deep_extend("force", zk_opts, opts)
|
||||
end
|
||||
|
||||
if server == "jdtls" then
|
||||
goto continue
|
||||
end
|
||||
|
||||
if server == "rust_analyzer" then
|
||||
local rust_opts = require "user.lsp.settings.rust"
|
||||
-- opts = vim.tbl_deep_extend("force", rust_opts, opts)
|
||||
local rust_tools_status_ok, rust_tools = pcall(require, "rust-tools")
|
||||
if not rust_tools_status_ok then
|
||||
return
|
||||
if server == "yamlls" then
|
||||
local yamlls_opts = require "user.lsp.settings.yamlls"
|
||||
opts = vim.tbl_deep_extend("force", yamlls_opts, opts)
|
||||
end
|
||||
|
||||
rust_tools.setup(rust_opts)
|
||||
goto continue
|
||||
end
|
||||
if server == "sumneko_lua" then
|
||||
local l_status_ok, lua_dev = pcall(require, "lua-dev")
|
||||
if not l_status_ok then
|
||||
return
|
||||
end
|
||||
-- local sumneko_opts = require "user.lsp.settings.sumneko_lua"
|
||||
-- opts = vim.tbl_deep_extend("force", sumneko_opts, opts)
|
||||
-- opts = vim.tbl_deep_extend("force", require("lua-dev").setup(), opts)
|
||||
local luadev = lua_dev.setup {
|
||||
-- -- add any options here, or leave empty to use the default settings
|
||||
-- lspconfig = opts,
|
||||
lspconfig = {
|
||||
on_attach = opts.on_attach,
|
||||
capabilities = opts.capabilities,
|
||||
-- -- settings = opts.settings,
|
||||
},
|
||||
}
|
||||
lspconfig.sumneko_lua.setup(luadev)
|
||||
goto continue
|
||||
end
|
||||
|
||||
lspconfig[server].setup(opts)
|
||||
::continue::
|
||||
if server == "tsserver" then
|
||||
local tsserver_opts = require "user.lsp.settings.tsserver"
|
||||
opts = vim.tbl_deep_extend("force", tsserver_opts, opts)
|
||||
end
|
||||
|
||||
if server == "pyright" then
|
||||
local pyright_opts = require "user.lsp.settings.pyright"
|
||||
opts = vim.tbl_deep_extend("force", pyright_opts, opts)
|
||||
end
|
||||
|
||||
if server == "solc" then
|
||||
local solc_opts = require "user.lsp.settings.solc"
|
||||
opts = vim.tbl_deep_extend("force", solc_opts, opts)
|
||||
end
|
||||
|
||||
if server == "clangd" then
|
||||
local clangd_opts = require "user.lsp.settings.clangd"
|
||||
opts = vim.tbl_deep_extend("force", clangd_opts, opts)
|
||||
end
|
||||
|
||||
if server == "emmet_ls" then
|
||||
local emmet_ls_opts = require "user.lsp.settings.emmet_ls"
|
||||
opts = vim.tbl_deep_extend("force", emmet_ls_opts, opts)
|
||||
end
|
||||
|
||||
if server == "zk" then
|
||||
local zk_opts = require "user.lsp.settings.zk"
|
||||
opts = vim.tbl_deep_extend("force", zk_opts, opts)
|
||||
end
|
||||
|
||||
if server == "jdtls" then
|
||||
goto continue
|
||||
end
|
||||
|
||||
if server == "rust_analyzer" then
|
||||
local rust_opts = require "user.lsp.settings.rust"
|
||||
-- opts = vim.tbl_deep_extend("force", rust_opts, opts)
|
||||
local rust_tools_status_ok, rust_tools = pcall(require, "rust-tools")
|
||||
if not rust_tools_status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
rust_tools.setup(rust_opts)
|
||||
goto continue
|
||||
end
|
||||
|
||||
if server == "omnisharp" then
|
||||
local omnisharp_opts = require "user.lsp.settings.omnisharp"
|
||||
opts = vim.tbl_deep_extend("force", omnisharp_opts, opts)
|
||||
end
|
||||
|
||||
lspconfig[server].setup(opts)
|
||||
::continue::
|
||||
end
|
||||
|
||||
-- TODO: add something to installer later
|
||||
|
||||
@ -1,57 +0,0 @@
|
||||
local null_ls_status_ok, null_ls = pcall(require, "null-ls")
|
||||
if not null_ls_status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
-- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/formatting
|
||||
local formatting = null_ls.builtins.formatting
|
||||
-- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics
|
||||
local diagnostics = null_ls.builtins.diagnostics
|
||||
|
||||
-- https://github.com/prettier-solidity/prettier-plugin-solidity
|
||||
-- npm install --save-dev prettier prettier-plugin-solidity
|
||||
null_ls.setup {
|
||||
debug = false,
|
||||
sources = {
|
||||
formatting.prettier.with {
|
||||
extra_filetypes = { "toml", "solidity" },
|
||||
extra_args = { "--no-semi", "--single-quote", "--jsx-single-quote" },
|
||||
},
|
||||
formatting.black.with { extra_args = { "--fast" } },
|
||||
formatting.stylua,
|
||||
formatting.shfmt,
|
||||
formatting.google_java_format,
|
||||
-- diagnostics.flake8,
|
||||
diagnostics.shellcheck,
|
||||
},
|
||||
}
|
||||
|
||||
local unwrap = {
|
||||
method = null_ls.methods.DIAGNOSTICS,
|
||||
filetypes = { "rust" },
|
||||
generator = {
|
||||
fn = function(params)
|
||||
local diagnostics = {}
|
||||
-- sources have access to a params object
|
||||
-- containing info about the current file and editor state
|
||||
for i, line in ipairs(params.content) do
|
||||
local col, end_col = line:find "unwrap()"
|
||||
if col and end_col then
|
||||
-- null-ls fills in undefined positions
|
||||
-- and converts source diagnostics into the required format
|
||||
table.insert(diagnostics, {
|
||||
row = i,
|
||||
col = col,
|
||||
end_col = end_col,
|
||||
source = "unwrap",
|
||||
message = "hey " .. os.getenv("USER") .. ", don't forget to handle this" ,
|
||||
severity = 2,
|
||||
})
|
||||
end
|
||||
end
|
||||
return diagnostics
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
null_ls.register(unwrap)
|
||||
@ -1,24 +0,0 @@
|
||||
local status_ok, schemastore = pcall(require, "schemastore")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
return {
|
||||
init_options = {
|
||||
provideFormatter = false,
|
||||
},
|
||||
settings = {
|
||||
json = {
|
||||
schemas = schemastore.json.schemas(),
|
||||
},
|
||||
},
|
||||
setup = {
|
||||
commands = {
|
||||
-- Format = {
|
||||
-- function()
|
||||
-- vim.lsp.buf.range_formatting({}, { 0, 0 }, { vim.fn.line "$", 0 })
|
||||
-- end,
|
||||
-- },
|
||||
},
|
||||
},
|
||||
}
|
||||
11
.config/nvim/lua/user/lsp/settings/omnisharp.lua
Normal file
11
.config/nvim/lua/user/lsp/settings/omnisharp.lua
Normal file
@ -0,0 +1,11 @@
|
||||
-- local pid = vim.fn.getpid()
|
||||
-- local omnisharp_bin = "/home/josh/.local/share/nvim/lsp_servers/omnisharp/omnisharp/OmniSharp.dll"
|
||||
|
||||
return {
|
||||
-- cmd = { omnisharp_bin, "--languageserver" , "--hostPID", tostring(pid) },
|
||||
omnisharp = {
|
||||
useModernNet = true,
|
||||
semanticHighlighting = false,
|
||||
-- monoPath = "/usr/bin/mono"
|
||||
}
|
||||
}
|
||||
@ -1,5 +1,5 @@
|
||||
return {
|
||||
cmd = { "py" },
|
||||
cmd = { "pyright" },
|
||||
settings = {
|
||||
python = {
|
||||
analysis = {
|
||||
|
||||
1
.config/nvim/lua/user/lsp/settings/shellcheck.lua
Normal file
1
.config/nvim/lua/user/lsp/settings/shellcheck.lua
Normal file
@ -0,0 +1 @@
|
||||
return {}
|
||||
@ -1,124 +1,103 @@
|
||||
local colors = {
|
||||
red = '#ca1243',
|
||||
grey = '#a0a1a7',
|
||||
black = '#383a42',
|
||||
white = '#f3f3f3',
|
||||
light_green = '#83a598',
|
||||
orange = '#fe8019',
|
||||
green = '#8ec07c',
|
||||
red = '#ca1243',
|
||||
grey = '#a0a1a7',
|
||||
black = '#383a42',
|
||||
white = '#f3f3f3',
|
||||
light_green = '#83a598',
|
||||
orange = '#fe8019',
|
||||
green = '#8ec07c',
|
||||
}
|
||||
|
||||
local theme = {
|
||||
normal = {
|
||||
a = { fg = colors.white, bg = colors.black },
|
||||
b = { fg = colors.white, bg = colors.grey },
|
||||
c = { fg = colors.black, bg = colors.white },
|
||||
z = { fg = colors.white, bg = colors.black },
|
||||
},
|
||||
insert = { a = { fg = colors.black, bg = colors.light_green } },
|
||||
visual = { a = { fg = colors.black, bg = colors.orange } },
|
||||
replace = { a = { fg = colors.black, bg = colors.green } },
|
||||
}
|
||||
|
||||
local empty = require('lualine.component'):extend()
|
||||
function empty:draw(default_highlight)
|
||||
self.status = ''
|
||||
self.applied_separator = ''
|
||||
self:apply_highlights(default_highlight)
|
||||
self:apply_section_separators()
|
||||
return self.status
|
||||
end
|
||||
|
||||
-- Put proper separators and gaps between components in sections
|
||||
local function process_sections(sections)
|
||||
for name, section in pairs(sections) do
|
||||
local left = name:sub(9, 10) < 'x'
|
||||
for pos = 1, name ~= 'lualine_z' and #section or #section - 1 do
|
||||
table.insert(section, pos * 2, { empty, color = { fg = colors.white, bg = colors.white } })
|
||||
for name, section in pairs(sections) do
|
||||
local left = name:sub(9, 10) < 'x'
|
||||
for pos = 1, name ~= 'lualine_z' and #section or #section - 1 do
|
||||
table.insert(section, pos * 2, { empty, color = { fg = colors.white, bg = colors.white } })
|
||||
end
|
||||
for id, comp in ipairs(section) do
|
||||
if type(comp) ~= 'table' then
|
||||
comp = { comp }
|
||||
section[id] = comp
|
||||
end
|
||||
comp.separator = left and { right = '' } or { left = '' }
|
||||
end
|
||||
end
|
||||
for id, comp in ipairs(section) do
|
||||
if type(comp) ~= 'table' then
|
||||
comp = { comp }
|
||||
section[id] = comp
|
||||
end
|
||||
comp.separator = left and { right = '' } or { left = '' }
|
||||
end
|
||||
end
|
||||
return sections
|
||||
return sections
|
||||
end
|
||||
|
||||
local function search_result()
|
||||
if vim.v.hlsearch == 0 then
|
||||
return ''
|
||||
end
|
||||
local last_search = vim.fn.getreg('/')
|
||||
if not last_search or last_search == '' then
|
||||
return ''
|
||||
end
|
||||
local searchcount = vim.fn.searchcount { maxcount = 9999 }
|
||||
return last_search .. '(' .. searchcount.current .. '/' .. searchcount.total .. ')'
|
||||
if vim.v.hlsearch == 0 then
|
||||
return ''
|
||||
end
|
||||
local last_search = vim.fn.getreg('/')
|
||||
if not last_search or last_search == '' then
|
||||
return ''
|
||||
end
|
||||
local searchcount = vim.fn.searchcount { maxcount = 9999 }
|
||||
return last_search .. '(' .. searchcount.current .. '/' .. searchcount.total .. ')'
|
||||
end
|
||||
|
||||
local function modified()
|
||||
if vim.bo.modified then
|
||||
return '+'
|
||||
elseif vim.bo.modifiable == false or vim.bo.readonly == true then
|
||||
return '-'
|
||||
end
|
||||
return ''
|
||||
if vim.bo.modified then
|
||||
return '+'
|
||||
elseif vim.bo.modifiable == false or vim.bo.readonly == true then
|
||||
return '-'
|
||||
end
|
||||
return ''
|
||||
end
|
||||
|
||||
require('lualine').setup {
|
||||
options = {
|
||||
theme = 'gruvbox-material',
|
||||
component_separators = '',
|
||||
section_separators = { left = '', right = '' },
|
||||
},
|
||||
sections = process_sections {
|
||||
lualine_a = { 'mode' },
|
||||
lualine_b = {
|
||||
'branch',
|
||||
'diff',
|
||||
{
|
||||
'diagnostics',
|
||||
source = { 'nvim' },
|
||||
sections = { 'error' },
|
||||
diagnostics_color = { error = { bg = colors.red, fg = colors.white } },
|
||||
},
|
||||
{
|
||||
'diagnostics',
|
||||
source = { 'nvim' },
|
||||
sections = { 'warn' },
|
||||
diagnostics_color = { warn = { bg = colors.orange, fg = colors.white } },
|
||||
},
|
||||
{ 'filename', file_status = false, path = 1 },
|
||||
{ modified, color = { bg = colors.red } },
|
||||
{
|
||||
'%w',
|
||||
cond = function()
|
||||
return vim.wo.previewwindow
|
||||
end,
|
||||
},
|
||||
{
|
||||
'%r',
|
||||
cond = function()
|
||||
return vim.bo.readonly
|
||||
end,
|
||||
},
|
||||
{
|
||||
'%q',
|
||||
cond = function()
|
||||
return vim.bo.buftype == 'quickfix'
|
||||
end,
|
||||
},
|
||||
options = {
|
||||
theme = 'gruvbox',
|
||||
component_separators = '',
|
||||
section_separators = { left = '', right = '' },
|
||||
},
|
||||
sections = process_sections {
|
||||
lualine_a = { 'mode' },
|
||||
lualine_b = {
|
||||
'branch',
|
||||
'diff',
|
||||
{
|
||||
'diagnostics',
|
||||
source = { 'nvim' },
|
||||
sections = { 'error' },
|
||||
diagnostics_color = { error = { bg = colors.red, fg = colors.white } },
|
||||
},
|
||||
{
|
||||
'diagnostics',
|
||||
source = { 'nvim' },
|
||||
sections = { 'warn' },
|
||||
diagnostics_color = { warn = { bg = colors.orange, fg = colors.white } },
|
||||
},
|
||||
{ 'filename', file_status = false, path = 1 },
|
||||
{ modified, color = { bg = colors.red } },
|
||||
{
|
||||
'%w',
|
||||
cond = function()
|
||||
return vim.wo.previewwindow
|
||||
end,
|
||||
},
|
||||
{
|
||||
'%r',
|
||||
cond = function()
|
||||
return vim.bo.readonly
|
||||
end,
|
||||
},
|
||||
{
|
||||
'%q',
|
||||
cond = function()
|
||||
return vim.bo.buftype == 'quickfix'
|
||||
end,
|
||||
},
|
||||
},
|
||||
lualine_c = {},
|
||||
lualine_x = {},
|
||||
lualine_y = { search_result, 'filetype' },
|
||||
lualine_z = { '%l:%c', '%p%%/%L' },
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_c = { '%f %y %m' },
|
||||
lualine_x = {},
|
||||
},
|
||||
lualine_c = {},
|
||||
lualine_x = {},
|
||||
lualine_y = { search_result, 'filetype' },
|
||||
lualine_z = { '%l:%c', '%p%%/%L' },
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_c = { '%f %y %m' },
|
||||
lualine_x = {},
|
||||
},
|
||||
}
|
||||
|
||||
@ -1,3 +0,0 @@
|
||||
-- vim.g.matchup_enabled = 0
|
||||
vim.g.matchup_matchparen_offscreen = { method = nil }
|
||||
vim.g.matchup_matchpref = { html = { nolists = 1 } }
|
||||
@ -6,7 +6,6 @@ end
|
||||
|
||||
local icons = require "user.icons"
|
||||
|
||||
|
||||
navic.setup {
|
||||
icons = {
|
||||
File = icons.kind.File,
|
||||
@ -35,7 +34,6 @@ navic.setup {
|
||||
Event = icons.kind.Event,
|
||||
Operator = icons.kind.Operator,
|
||||
TypeParameter = icons.kind.TypeParameter
|
||||
|
||||
},
|
||||
highlight = true,
|
||||
separator = " " .. icons.ui.ChevronRight .. " ",
|
||||
|
||||
@ -1,35 +0,0 @@
|
||||
local status_ok, neoscroll = pcall(require, "neoscroll")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
neoscroll.setup {
|
||||
-- All these keys will be mapped to their corresponding default scrolling animation
|
||||
mappings = { "<C-u>", "<C-d>", "<C-b>", "<C-f>", "<C-y>", "<C-e>", "zt", "zz", "zb" },
|
||||
hide_cursor = true, -- Hide cursor while scrolling
|
||||
stop_eof = true, -- Stop at <EOF> when scrolling downwards
|
||||
use_local_scrolloff = false, -- Use the local scope of scrolloff instead of the global scope
|
||||
respect_scrolloff = true, -- Stop scrolling when the cursor reaches the scrolloff margin of the file
|
||||
cursor_scrolls_alone = false, -- The cursor will keep on scrolling even if the window cannot scroll further
|
||||
-- easing_function = nil, -- Default easing function
|
||||
-- pre_hook = nil, -- Function to run before the scrolling animation starts
|
||||
-- post_hook = nil, -- Function to run after the scrolling animation ends
|
||||
}
|
||||
|
||||
local t = {}
|
||||
-- Syntax: t[keys] = {function, {function arguments}}
|
||||
-- t['<C-u>'] = {'scroll', {'-vim.wo.scroll', 'true', '250'}}
|
||||
-- t['<C-d>'] = {'scroll', { 'vim.wo.scroll', 'true', '250'}}
|
||||
-- t['<C-b>'] = {'scroll', {'-vim.api.nvim_win_get_height(0)', 'true', '450'}}
|
||||
-- t['<C-f>'] = {'scroll', { 'vim.api.nvim_win_get_height(0)', 'true', '450'}}
|
||||
-- t['<C-y>'] = {'scroll', {'-0.10', 'false', '100'}}
|
||||
-- t['<C-e>'] = {'scroll', { '0.10', 'false', '100'}}
|
||||
-- t['H'] = {'scroll', {'-0.10', 'true', '100'}}
|
||||
-- t['L'] = {'scroll', { '0.10', 'true', '100'}}
|
||||
-- t["<c-k>"] = { "scroll", { "-vim.wo.scroll", "true", "250" } }
|
||||
-- t["<c-j>"] = { "scroll", { "vim.wo.scroll", "true", "250" } }
|
||||
-- t['zt'] = {'zt', {'250'}}
|
||||
-- t['zz'] = {'zz', {'250'}}
|
||||
-- t['zb'] = {'zb', {'250'}}
|
||||
|
||||
require("neoscroll.config").set_mappings(t)
|
||||
@ -1,11 +1,11 @@
|
||||
local status_ok, nvim_tree = pcall(require, "nvim-tree")
|
||||
if not status_ok then
|
||||
return
|
||||
return
|
||||
end
|
||||
|
||||
local config_status_ok, nvim_tree_config = pcall(require, "nvim-tree.config")
|
||||
if not config_status_ok then
|
||||
return
|
||||
return
|
||||
end
|
||||
|
||||
local icons = require "user.icons"
|
||||
@ -13,129 +13,105 @@ local icons = require "user.icons"
|
||||
local tree_cb = nvim_tree_config.nvim_tree_callback
|
||||
|
||||
nvim_tree.setup {
|
||||
hijack_directories = {
|
||||
enable = false,
|
||||
},
|
||||
-- update_to_buf_dir = {
|
||||
-- enable = false,
|
||||
-- },
|
||||
-- disable_netrw = true,
|
||||
-- hijack_netrw = true,
|
||||
-- open_on_setup = false,
|
||||
ignore_ft_on_setup = {
|
||||
"startify",
|
||||
"dashboard",
|
||||
"alpha",
|
||||
},
|
||||
filters = {
|
||||
custom = { ".git" },
|
||||
exclude = { ".gitignore" },
|
||||
},
|
||||
-- auto_close = true,
|
||||
-- open_on_tab = false,
|
||||
-- hijack_cursor = false,
|
||||
update_cwd = true,
|
||||
-- update_to_buf_dir = {
|
||||
-- enable = true,
|
||||
-- auto_open = true,
|
||||
-- },
|
||||
-- -- error
|
||||
-- -- info
|
||||
-- -- question
|
||||
-- -- warning
|
||||
-- -- lightbulb
|
||||
renderer = {
|
||||
add_trailing = false,
|
||||
group_empty = false,
|
||||
highlight_git = false,
|
||||
highlight_opened_files = "none",
|
||||
root_folder_modifier = ":t",
|
||||
indent_markers = {
|
||||
enable = false,
|
||||
icons = {
|
||||
corner = "└ ",
|
||||
edge = "│ ",
|
||||
none = " ",
|
||||
},
|
||||
hijack_directories = {
|
||||
enable = false,
|
||||
},
|
||||
icons = {
|
||||
webdev_colors = true,
|
||||
git_placement = "before",
|
||||
padding = " ",
|
||||
symlink_arrow = " ➛ ",
|
||||
show = {
|
||||
file = true,
|
||||
folder = true,
|
||||
folder_arrow = true,
|
||||
git = true,
|
||||
},
|
||||
glyphs = {
|
||||
default = "",
|
||||
symlink = "",
|
||||
folder = {
|
||||
arrow_open = icons.ui.ArrowOpen,
|
||||
arrow_closed = icons.ui.ArrowClosed,
|
||||
default = "",
|
||||
open = "",
|
||||
empty = "",
|
||||
empty_open = "",
|
||||
symlink = "",
|
||||
symlink_open = "",
|
||||
},
|
||||
git = {
|
||||
unstaged = "",
|
||||
staged = "S",
|
||||
unmerged = "",
|
||||
renamed = "➜",
|
||||
untracked = "U",
|
||||
deleted = "",
|
||||
ignored = "◌",
|
||||
},
|
||||
},
|
||||
ignore_ft_on_setup = {
|
||||
"alpha",
|
||||
},
|
||||
},
|
||||
diagnostics = {
|
||||
enable = true,
|
||||
icons = {
|
||||
hint = icons.diagnostics.Hint,
|
||||
info = icons.diagnostics.Information,
|
||||
warning = icons.diagnostics.Warning,
|
||||
error = icons.diagnostics.Error,
|
||||
filters = {
|
||||
custom = { ".git" },
|
||||
exclude = { ".gitignore" },
|
||||
},
|
||||
},
|
||||
update_focused_file = {
|
||||
enable = true,
|
||||
hijack_cursor = false,
|
||||
update_cwd = true,
|
||||
ignore_list = {},
|
||||
},
|
||||
-- system_open = {
|
||||
-- cmd = nil,
|
||||
-- args = {},
|
||||
-- },
|
||||
-- filters = {
|
||||
-- dotfiles = false,
|
||||
-- custom = {},
|
||||
-- },
|
||||
git = {
|
||||
enable = true,
|
||||
ignore = true,
|
||||
timeout = 500,
|
||||
},
|
||||
view = {
|
||||
width = 30,
|
||||
height = 30,
|
||||
hide_root_folder = false,
|
||||
side = "left",
|
||||
-- auto_resize = true,
|
||||
mappings = {
|
||||
custom_only = false,
|
||||
list = {
|
||||
{ key = { "l", "<CR>", "o" }, cb = tree_cb "edit" },
|
||||
{ key = "h", cb = tree_cb "close_node" },
|
||||
{ key = "v", cb = tree_cb "vsplit" },
|
||||
},
|
||||
renderer = {
|
||||
add_trailing = false,
|
||||
group_empty = false,
|
||||
highlight_git = false,
|
||||
highlight_opened_files = "none",
|
||||
root_folder_modifier = ":t",
|
||||
indent_markers = {
|
||||
enable = false,
|
||||
icons = {
|
||||
corner = "└ ",
|
||||
edge = "│ ",
|
||||
none = " ",
|
||||
},
|
||||
},
|
||||
icons = {
|
||||
webdev_colors = true,
|
||||
git_placement = "before",
|
||||
padding = " ",
|
||||
symlink_arrow = " ➛ ",
|
||||
show = {
|
||||
file = true,
|
||||
folder = true,
|
||||
folder_arrow = true,
|
||||
git = true,
|
||||
},
|
||||
glyphs = {
|
||||
default = "",
|
||||
symlink = "",
|
||||
folder = {
|
||||
arrow_open = icons.ui.ArrowOpen,
|
||||
arrow_closed = icons.ui.ArrowClosed,
|
||||
default = "",
|
||||
open = "",
|
||||
empty = "",
|
||||
empty_open = "",
|
||||
symlink = "",
|
||||
symlink_open = "",
|
||||
},
|
||||
git = {
|
||||
unstaged = "",
|
||||
staged = "S",
|
||||
unmerged = "",
|
||||
renamed = "➜",
|
||||
untracked = "U",
|
||||
deleted = "",
|
||||
ignored = "◌",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
number = false,
|
||||
relativenumber = false,
|
||||
},
|
||||
diagnostics = {
|
||||
enable = true,
|
||||
icons = {
|
||||
hint = icons.diagnostics.Hint,
|
||||
info = icons.diagnostics.Information,
|
||||
warning = icons.diagnostics.Warning,
|
||||
error = icons.diagnostics.Error,
|
||||
},
|
||||
},
|
||||
update_focused_file = {
|
||||
enable = true,
|
||||
update_cwd = true,
|
||||
ignore_list = {},
|
||||
},
|
||||
git = {
|
||||
enable = true,
|
||||
ignore = true,
|
||||
timeout = 500,
|
||||
},
|
||||
view = {
|
||||
width = 30,
|
||||
hide_root_folder = false,
|
||||
side = "left",
|
||||
mappings = {
|
||||
custom_only = false,
|
||||
list = {
|
||||
{ key = { "l", "<CR>", "o" }, cb = tree_cb "edit" },
|
||||
{ key = "h", cb = tree_cb "close_node" },
|
||||
{ key = "v", cb = tree_cb "vsplit" },
|
||||
},
|
||||
},
|
||||
number = false,
|
||||
relativenumber = false,
|
||||
},
|
||||
actions = {
|
||||
open_file = {
|
||||
quit_on_open = true,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,67 +0,0 @@
|
||||
local status_ok, nvim_web_devicons = pcall(require, "nvim-web-devicons")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
nvim_web_devicons.set_icon {
|
||||
sh = {
|
||||
icon = "",
|
||||
color = "#1DC123",
|
||||
cterm_color = "61",
|
||||
name = "Sy",
|
||||
},
|
||||
["py"] = {
|
||||
icon = "",
|
||||
color = "#519BB7",
|
||||
cterm_color = "59",
|
||||
name = "Py",
|
||||
},
|
||||
-- ["js"] = {
|
||||
-- icon = "",
|
||||
-- color = "#cbcb41",
|
||||
-- cterm_color = "185",
|
||||
-- name = "Js",
|
||||
-- },
|
||||
-- ["ts"] = {
|
||||
-- icon = "ﯤ",
|
||||
-- color = "#519aba",
|
||||
-- cterm_color = "67",
|
||||
-- name = "Ts",
|
||||
-- },
|
||||
[".gitattributes"] = {
|
||||
icon = "",
|
||||
color = "#e24329",
|
||||
cterm_color = "59",
|
||||
name = "GitAttributes",
|
||||
},
|
||||
[".gitconfig"] = {
|
||||
icon = "",
|
||||
color = "#e24329",
|
||||
cterm_color = "59",
|
||||
name = "GitConfig",
|
||||
},
|
||||
[".gitignore"] = {
|
||||
icon = "",
|
||||
color = "#e24329",
|
||||
cterm_color = "59",
|
||||
name = "GitIgnore",
|
||||
},
|
||||
[".gitlab-ci.yml"] = {
|
||||
icon = "",
|
||||
color = "#e24329",
|
||||
cterm_color = "166",
|
||||
name = "GitlabCI",
|
||||
},
|
||||
[".gitmodules"] = {
|
||||
icon = "",
|
||||
color = "#e24329",
|
||||
cterm_color = "59",
|
||||
name = "GitModules",
|
||||
},
|
||||
["diff"] = {
|
||||
icon = "",
|
||||
color = "#e24329",
|
||||
cterm_color = "59",
|
||||
name = "Diff",
|
||||
},
|
||||
}
|
||||
@ -1,63 +1,52 @@
|
||||
local options = {
|
||||
backup = false, -- creates a backup file
|
||||
clipboard = "unnamedplus", -- allows neovim to access the system clipboard
|
||||
cmdheight = 1, -- more space in the neovim command line for displaying messages
|
||||
completeopt = { "menuone", "noselect" }, -- mostly just for cmp
|
||||
conceallevel = 0, -- so that `` is visible in markdown files
|
||||
fileencoding = "utf-8", -- the encoding written to a file
|
||||
hlsearch = true, -- highlight all matches on previous search pattern
|
||||
ignorecase = true, -- ignore case in search patterns
|
||||
mouse = "a", -- allow the mouse to be used in neovim
|
||||
pumheight = 10, -- pop up menu height
|
||||
showmode = false, -- we don't need to see things like -- INSERT -- anymore
|
||||
showtabline = 0, -- always show tabs
|
||||
smartcase = true, -- smart case
|
||||
smartindent = true, -- make indenting smarter again
|
||||
splitbelow = true, -- force all horizontal splits to go below current window
|
||||
splitright = true, -- force all vertical splits to go to the right of current window
|
||||
swapfile = false, -- creates a swapfile
|
||||
termguicolors = true, -- set term gui colors (most terminals support this)
|
||||
timeoutlen = 1000, -- time to wait for a mapped sequence to complete (in milliseconds)
|
||||
undofile = true, -- enable persistent undo
|
||||
updatetime = 100, -- faster completion (4000ms default)
|
||||
writebackup = false, -- if a file is being edited by another program (or was written to file while editing with another program), it is not allowed to be edited
|
||||
expandtab = true, -- convert tabs to spaces
|
||||
shiftwidth = 2, -- the number of spaces inserted for each indentation
|
||||
tabstop = 2, -- insert 2 spaces for a tab
|
||||
cursorline = true, -- highlight the current line
|
||||
number = true, -- set numbered lines
|
||||
laststatus = 3,
|
||||
showcmd = false,
|
||||
ruler = false,
|
||||
relativenumber = true, -- set relative numbered lines
|
||||
numberwidth = 4, -- set number column width to 2 {default 4}
|
||||
signcolumn = "yes", -- always show the sign column, otherwise it would shift the text each time
|
||||
wrap = true, -- display lines as one long line
|
||||
scrolloff = 8, -- is one of my fav
|
||||
sidescrolloff = 8,
|
||||
guifont = "monospace:h17", -- the font used in graphical neovim applications
|
||||
title = true,
|
||||
-- colorcolumn = "80",
|
||||
-- colorcolumn = "120",
|
||||
|
||||
backup = false, -- creates a backup file
|
||||
clipboard = "unnamedplus", -- gives nvim access to clipboard
|
||||
cmdheight = 1, -- more space in nvim cmd line
|
||||
completeopt = { "menuone", "noselect" }, -- cmp related
|
||||
conceallevel = 0, -- don't hide `` in md
|
||||
fileencoding = "utf-8",
|
||||
hlsearch = false,
|
||||
ignorecase = true,
|
||||
mouse = "a", -- allow use of mouse (bad I know but sometimes useful)
|
||||
pumheight = 10, -- popup menu height
|
||||
showmode = true,
|
||||
smartcase = true,
|
||||
smartindent = true,
|
||||
splitbelow = true,
|
||||
splitright = true,
|
||||
swapfile = false,
|
||||
termguicolors = true,
|
||||
timeoutlen = 500,
|
||||
ttimeoutlen = 10,
|
||||
undofile = true,
|
||||
updatetime = 100,
|
||||
writebackup = false,
|
||||
expandtab = true, -- use spaces instead of tab
|
||||
shiftwidth = 4, -- insert 4 spaces for indentation
|
||||
tabstop = 4, -- insert 4 spaces for tab
|
||||
cursorline = true,
|
||||
number = true,
|
||||
laststatus = 3,
|
||||
showcmd = false,
|
||||
ruler = false,
|
||||
relativenumber = true,
|
||||
numberwidth = 2,
|
||||
signcolumn = "yes",
|
||||
wrap = false,
|
||||
scrolloff = 8,
|
||||
sidescrolloff = 8,
|
||||
guifont = "monospace:h17",
|
||||
title = true,
|
||||
}
|
||||
|
||||
-- vim.g.loaded_netrw = 1
|
||||
-- vim.g.loaded_netrwPlugin = 1
|
||||
-- vim.opt.fillchars.eob = " "
|
||||
-- vim.opt.fillchars = vim.opt.fillchars + "vertleft: "
|
||||
-- vim.opt.fillchars = vim.opt.fillchars + "vertright: "
|
||||
vim.opt.fillchars = vim.opt.fillchars + 'eob: '
|
||||
|
||||
vim.opt.fillchars:append {
|
||||
stl = ' ',
|
||||
}
|
||||
|
||||
vim.opt.shortmess:append "c"
|
||||
|
||||
for k, v in pairs(options) do
|
||||
vim.opt[k] = v
|
||||
vim.opt[k] = v
|
||||
end
|
||||
|
||||
vim.cmd "set whichwrap+=<,>,[,],h,l"
|
||||
vim.cmd "set colorcolumn=80"
|
||||
vim.cmd [[set iskeyword+=-]]
|
||||
|
||||
@ -2,201 +2,163 @@ local fn = vim.fn
|
||||
|
||||
-- Automatically install packer
|
||||
local install_path = fn.stdpath "data" .. "/site/pack/packer/start/packer.nvim"
|
||||
---@diagnostic disable-next-line: missing-parameter
|
||||
if fn.empty(fn.glob(install_path)) > 0 then
|
||||
PACKER_BOOTSTRAP = fn.system {
|
||||
"git",
|
||||
"clone",
|
||||
"--depth",
|
||||
"1",
|
||||
"https://github.com/wbthomason/packer.nvim",
|
||||
install_path,
|
||||
}
|
||||
print "Installing packer close and reopen Neovim..."
|
||||
vim.cmd [[packadd packer.nvim]]
|
||||
PACKER_BOOTSTRAP = fn.system {
|
||||
"git",
|
||||
"clone",
|
||||
"--depth",
|
||||
"1",
|
||||
"https://github.com/wbthomason/packer.nvim",
|
||||
install_path,
|
||||
}
|
||||
print "Installing packer, please close and reopen Neovim..."
|
||||
vim.cmd [[packadd packer.nvim]]
|
||||
end
|
||||
|
||||
-- Autocommand that reloads neovim whenever you save the plugins.lua file
|
||||
-- Autocommand to reload neovime whenever this file is saved.
|
||||
vim.cmd [[
|
||||
augroup packer_user_config
|
||||
autocmd!
|
||||
autocmd BufWritePost plugins.lua source <afile> | PackerSync
|
||||
augroup end
|
||||
augroup packer_user_config
|
||||
autocmd!
|
||||
autocmd BufWritePost plugins.lua source <afile> | PackerSync
|
||||
augroup end
|
||||
]]
|
||||
|
||||
-- Use a protected call so we don't error out on first use
|
||||
local status_ok, packer = pcall(require, "packer")
|
||||
if not status_ok then
|
||||
return
|
||||
-- use a protected call so there's no error on first use
|
||||
local s_ok, packer = pcall(require, "packer")
|
||||
if not s_ok then
|
||||
return
|
||||
end
|
||||
|
||||
-- Have packer use a popup window
|
||||
-- Have packer use a popup
|
||||
packer.init {
|
||||
-- snapshot = "july-24",
|
||||
snapshot_path = fn.stdpath "config" .. "/snapshots",
|
||||
max_jobs = 50,
|
||||
display = {
|
||||
open_fn = function()
|
||||
return require("packer.util").float { border = "rounded" }
|
||||
end,
|
||||
prompt_border = "rounded", -- Border style of prompt popups.
|
||||
},
|
||||
max_jobs = 50,
|
||||
display = {
|
||||
open_fn = function()
|
||||
return require("packer.util").float { border = "rounded" }
|
||||
end,
|
||||
prompt_border = "rounded"
|
||||
},
|
||||
}
|
||||
|
||||
-- Install your plugins here
|
||||
-- Add plugins from here
|
||||
return packer.startup(function(use)
|
||||
-- Plugin Mangager
|
||||
use "wbthomason/packer.nvim" -- Have packer manage itself
|
||||
-- Plugin manager
|
||||
use "wbthomason/packer.nvim" -- Have packer manage inself
|
||||
|
||||
-- Lua Development
|
||||
use "nvim-lua/plenary.nvim" -- useful lua functions
|
||||
use "nvim-lua/popup.nvim"
|
||||
use "folke/lua-dev.nvim"
|
||||
|
||||
-- LSP
|
||||
use "neovim/nvim-lspconfig" -- enable LSP
|
||||
use "williamboman/mason.nvim" -- language server manager/installer
|
||||
use "williamboman/mason-lspconfig.nvim"
|
||||
use "j-hui/fidget.nvim" -- displays lsp progress in bottom right
|
||||
use "SmiteshP/nvim-navic" -- integrates with winbar to show location in program e.g.: MyClass > MyFunc > MyProperty
|
||||
use "simrat39/symbols-outline.nvim" -- class explorer for nvim
|
||||
use "folke/trouble.nvim" -- view lsp diagnostics
|
||||
use "OmniSharp/omnisharp-vim"
|
||||
use "https://git.sr.ht/~whynothugo/lsp_lines.nvim"
|
||||
require('packer').use({
|
||||
'weilbith/nvim-code-action-menu',
|
||||
cmd = 'CodeActionMenu',
|
||||
})
|
||||
|
||||
-- Completion
|
||||
use "hrsh7th/nvim-cmp" -- completion engine
|
||||
use "hrsh7th/cmp-buffer" -- buffer completions
|
||||
use "hrsh7th/cmp-path" -- path completions
|
||||
use "hrsh7th/cmp-nvim-lsp" -- lsp completions
|
||||
use "hrsh7th/cmp-nvim-lua"
|
||||
use "saadparwaiz1/cmp_luasnip" -- snippet completions
|
||||
|
||||
-- Snippet
|
||||
use "L3MON4D3/LuaSnip" -- snippet engine
|
||||
use "rafamadriz/friendly-snippets" -- a collection of useful snippets
|
||||
|
||||
-- Syntax/Treesitter
|
||||
use "nvim-treesitter/nvim-treesitter"
|
||||
use "nvim-treesitter/playground"
|
||||
|
||||
-- CEO of The Startup
|
||||
use "ThePrimeagen/harpoon"
|
||||
|
||||
-- Telescopic Johnston
|
||||
use "nvim-telescope/telescope.nvim"
|
||||
use "nvim-telescope/telescope-media-files.nvim"
|
||||
|
||||
-- Note Taking
|
||||
use "mickael-menu/zk-nvim"
|
||||
|
||||
-- Colour
|
||||
use "NvChad/nvim-colorizer.lua"
|
||||
|
||||
-- Colorschemes
|
||||
use "folke/tokyonight.nvim"
|
||||
use "sainnhe/gruvbox-material"
|
||||
use "sainnhe/sonokai"
|
||||
use "dracula/vim"
|
||||
use "RRethy/nvim-base16"
|
||||
|
||||
-- Utility
|
||||
use "rcarriga/nvim-notify"
|
||||
use "stevearc/dressing.nvim"
|
||||
use "moll/vim-bbye"
|
||||
use "lewis6991/impatient.nvim"
|
||||
|
||||
-- Icons
|
||||
use "kyazdani42/nvim-web-devicons"
|
||||
|
||||
-- Debugging
|
||||
-- Also add later.
|
||||
|
||||
-- Tabline
|
||||
use "akinsho/bufferline.nvim"
|
||||
use "fgheng/winbar.nvim"
|
||||
|
||||
-- Statusline
|
||||
use "nvim-lualine/lualine.nvim"
|
||||
|
||||
-- Startup
|
||||
use "goolord/alpha-nvim"
|
||||
|
||||
-- Indent
|
||||
use "lukas-reineke/indent-blankline.nvim"
|
||||
|
||||
-- File Explorer
|
||||
use "kyazdani42/nvim-tree.lua"
|
||||
|
||||
-- Comments
|
||||
use "numToStr/Comment.nvim"
|
||||
use "folke/todo-comments.nvim"
|
||||
|
||||
-- Terminal
|
||||
use "akinsho/toggleterm.nvim"
|
||||
|
||||
-- Git
|
||||
use "lewis6991/gitsigns.nvim"
|
||||
use "f-person/git-blame.nvim"
|
||||
|
||||
-- Editing Support
|
||||
use "windwp/nvim-autopairs"
|
||||
use "vimwiki/vimwiki"
|
||||
use "folke/zen-mode.nvim"
|
||||
use "junegunn/vim-slash"
|
||||
use "andymass/vim-matchup"
|
||||
use "nacro90/numb.nvim"
|
||||
use "monaqa/dial.nvim"
|
||||
use {
|
||||
"abecodes/tabout.nvim",
|
||||
wants = { "nvim-treesitter" }
|
||||
}
|
||||
use "windwp/nvim-spectre"
|
||||
|
||||
-- Keybinding
|
||||
use "folke/which-key.nvim"
|
||||
|
||||
-- Lua Development
|
||||
use "nvim-lua/plenary.nvim" -- Useful lua functions used ny lots of plugins
|
||||
use "nvim-lua/popup.nvim"
|
||||
use "folke/lua-dev.nvim"
|
||||
|
||||
-- LSP
|
||||
use "neovim/nvim-lspconfig" -- enable LSP
|
||||
-- use "williamboman/nvim-lsp-installer" -- simple to use language server installer
|
||||
use "williamboman/mason.nvim"
|
||||
use "williamboman/mason-lspconfig.nvim"
|
||||
use "jose-elias-alvarez/null-ls.nvim" -- for formatters and linters
|
||||
use "ray-x/lsp_signature.nvim"
|
||||
use "SmiteshP/nvim-navic"
|
||||
use "simrat39/symbols-outline.nvim"
|
||||
use "b0o/SchemaStore.nvim"
|
||||
use "RRethy/vim-illuminate"
|
||||
use "j-hui/fidget.nvim" -- displays LSP progress in bottom right
|
||||
use "lvimuser/lsp-inlayhints.nvim"
|
||||
-- use "simrat39/inlay-hints.nvim"
|
||||
use "https://git.sr.ht/~whynothugo/lsp_lines.nvim"
|
||||
|
||||
-- Completion
|
||||
use "hrsh7th/nvim-cmp"
|
||||
use "hrsh7th/cmp-buffer" -- buffer completions
|
||||
use "hrsh7th/cmp-path" -- path completions
|
||||
use "saadparwaiz1/cmp_luasnip" -- snippet completions
|
||||
use "hrsh7th/cmp-nvim-lsp"
|
||||
use "hrsh7th/cmp-nvim-lua"
|
||||
|
||||
-- Snippet
|
||||
use "L3MON4D3/LuaSnip" --snippet engine
|
||||
use "rafamadriz/friendly-snippets" -- a bunch of snippets to use
|
||||
|
||||
-- Syntax/Treesitter
|
||||
use "nvim-treesitter/nvim-treesitter"
|
||||
use "JoosepAlviste/nvim-ts-context-commentstring"
|
||||
use "nvim-treesitter/playground"
|
||||
use "kylechui/nvim-surround"
|
||||
|
||||
-- Marks
|
||||
use "christianchiarulli/harpoon" -- mark files and navigate them through a nice ui or with keys (good for large codebases)
|
||||
use "MattesGroeger/vim-bookmarks"
|
||||
|
||||
-- Fuzzy Finder/Telescope
|
||||
use "nvim-telescope/telescope.nvim"
|
||||
use "nvim-telescope/telescope-media-files.nvim"
|
||||
|
||||
-- Note Taking
|
||||
use "mickael-menu/zk-nvim"
|
||||
|
||||
-- Color
|
||||
use "NvChad/nvim-colorizer.lua"
|
||||
use "ziontee113/color-picker.nvim"
|
||||
|
||||
-- Colorschemes
|
||||
use "folke/tokyonight.nvim"
|
||||
use "sainnhe/gruvbox-material"
|
||||
use 'RRethy/nvim-base16'
|
||||
|
||||
-- Utility
|
||||
use "rcarriga/nvim-notify"
|
||||
use "stevearc/dressing.nvim" -- extends the vim api for window (window dressing)
|
||||
use "ghillb/cybu.nvim"
|
||||
use "moll/vim-bbye"
|
||||
use "lewis6991/impatient.nvim"
|
||||
use "lalitmee/browse.nvim"
|
||||
use 'junegunn/goyo.vim'
|
||||
use 'junegunn/limelight.vim'
|
||||
use 'folke/trouble.nvim'
|
||||
|
||||
-- Icon
|
||||
use "kyazdani42/nvim-web-devicons"
|
||||
|
||||
-- Debugging
|
||||
use "mfussenegger/nvim-dap"
|
||||
use "rcarriga/nvim-dap-ui"
|
||||
|
||||
-- Tabline
|
||||
use "akinsho/bufferline.nvim"
|
||||
use "tiagovla/scope.nvim"
|
||||
use "fgheng/winbar.nvim"
|
||||
|
||||
-- Statusline
|
||||
use "christianchiarulli/lualine.nvim"
|
||||
|
||||
-- Startup
|
||||
use "goolord/alpha-nvim"
|
||||
|
||||
-- Indent
|
||||
use "lukas-reineke/indent-blankline.nvim"
|
||||
|
||||
-- File Explorer
|
||||
use "kyazdani42/nvim-tree.lua"
|
||||
-- use "christianchiarulli/lir.nvim"
|
||||
-- use "preservim/nerdtree"
|
||||
|
||||
-- Comment
|
||||
use "numToStr/Comment.nvim"
|
||||
use "folke/todo-comments.nvim"
|
||||
|
||||
-- Terminal
|
||||
use "akinsho/toggleterm.nvim"
|
||||
|
||||
-- Project
|
||||
use "ahmedkhalf/project.nvim"
|
||||
use "windwp/nvim-spectre"
|
||||
|
||||
-- Quickfix
|
||||
use "kevinhwang91/nvim-bqf"
|
||||
|
||||
-- Git
|
||||
use "lewis6991/gitsigns.nvim"
|
||||
use "f-person/git-blame.nvim"
|
||||
use "ruifm/gitlinker.nvim"
|
||||
use "mattn/vim-gist"
|
||||
use "mattn/webapi-vim"
|
||||
|
||||
-- Github
|
||||
use "pwntester/octo.nvim"
|
||||
|
||||
-- Editing Support
|
||||
use "windwp/nvim-autopairs"
|
||||
use "monaqa/dial.nvim"
|
||||
use "nacro90/numb.nvim"
|
||||
use "andymass/vim-matchup"
|
||||
use "folke/zen-mode.nvim"
|
||||
use "karb94/neoscroll.nvim"
|
||||
use "junegunn/vim-slash"
|
||||
use 'vimwiki/vimwiki'
|
||||
|
||||
-- Motion
|
||||
-- use "phaazon/hop.nvim"
|
||||
|
||||
-- Keybinding
|
||||
use "folke/which-key.nvim"
|
||||
|
||||
-- Typescript TODO: set this up, also add keybinds to ftplugin
|
||||
use "jose-elias-alvarez/typescript.nvim"
|
||||
|
||||
-- Markdown
|
||||
use {
|
||||
"iamcco/markdown-preview.nvim",
|
||||
run = "cd app && npm install",
|
||||
ft = "markdown",
|
||||
}
|
||||
|
||||
-- Automatically set up your configuration after cloning packer.nvim
|
||||
-- Put this at the end after all plugins
|
||||
if PACKER_BOOTSTRAP then
|
||||
require("packer").sync()
|
||||
end
|
||||
-- Automatically setup after cloning packer.nvim
|
||||
if PACKER_BOOTSTRAP then
|
||||
require("packer").sync()
|
||||
end
|
||||
end)
|
||||
|
||||
@ -1,48 +0,0 @@
|
||||
local status_ok, project = pcall(require, "project_nvim")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
project.setup({
|
||||
---@usage set to false to disable project.nvim.
|
||||
--- This is on by default since it's currently the expected behavior.
|
||||
active = true,
|
||||
|
||||
on_config_done = nil,
|
||||
|
||||
---@usage set to true to disable setting the current-woriking directory
|
||||
--- Manual mode doesn't automatically change your root directory, so you have
|
||||
--- the option to manually do so using `:ProjectRoot` command.
|
||||
manual_mode = false,
|
||||
|
||||
---@usage Methods of detecting the root directory
|
||||
--- Allowed values: **"lsp"** uses the native neovim lsp
|
||||
--- **"pattern"** uses vim-rooter like glob pattern matching. Here
|
||||
--- order matters: if one is not detected, the other is used as fallback. You
|
||||
--- can also delete or rearangne the detection methods.
|
||||
-- detection_methods = { "lsp", "pattern" }, -- NOTE: lsp detection will get annoying with multiple langs in one project
|
||||
detection_methods = { "pattern" },
|
||||
|
||||
---@usage patterns used to detect root dir, when **"pattern"** is in detection_methods
|
||||
patterns = { ".git", "_darcs", ".hg", ".bzr", ".svn", "Makefile", "package.json" },
|
||||
|
||||
---@ Show hidden files in telescope when searching for files in a project
|
||||
show_hidden = false,
|
||||
|
||||
---@usage When set to false, you will get a message when project.nvim changes your directory.
|
||||
-- When set to false, you will get a message when project.nvim changes your directory.
|
||||
silent_chdir = true,
|
||||
|
||||
---@usage list of lsp client names to ignore when using **lsp** detection. eg: { "efm", ... }
|
||||
ignore_lsp = {},
|
||||
|
||||
---@type string
|
||||
---@usage path to store the project history for use in telescope
|
||||
datapath = vim.fn.stdpath("data"),
|
||||
})
|
||||
|
||||
local tele_status_ok, telescope = pcall(require, "telescope")
|
||||
if not tele_status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
telescope.load_extension('projects')
|
||||
@ -1 +0,0 @@
|
||||
require("scope").setup()
|
||||
@ -1,76 +0,0 @@
|
||||
local status_ok, surround = pcall(require, "nvim-surround")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
surround.setup {
|
||||
keymaps = { -- vim-surround style keymaps
|
||||
insert = "<C-g>s",
|
||||
insert_line = "<C-g>S",
|
||||
normal = "s",
|
||||
normal_cur = "ss",
|
||||
normal_line = "S",
|
||||
normal_cur_line = "SS",
|
||||
visual = "s",
|
||||
visual_line = "gS",
|
||||
delete = "ds",
|
||||
change = "cs",
|
||||
},
|
||||
-- TODO: come back and fix this
|
||||
-- surrounds = {
|
||||
-- pairs = {
|
||||
-- ["("] = { "( ", " )" },
|
||||
-- [")"] = { "(", ")" },
|
||||
-- ["{"] = { "{ ", " }" },
|
||||
-- ["}"] = { "{", "}" },
|
||||
-- ["<"] = { "< ", " >" },
|
||||
-- [">"] = { "<", ">" },
|
||||
-- ["["] = { "[ ", " ]" },
|
||||
-- ["]"] = { "[", "]" },
|
||||
-- -- Define pairs based on function evaluations!
|
||||
-- ["i"] = function()
|
||||
-- return {
|
||||
-- require("nvim-surround.utils").get_input "Enter the left delimiter: ",
|
||||
-- require("nvim-surround.utils").get_input "Enter the right delimiter: ",
|
||||
-- }
|
||||
-- end,
|
||||
-- ["f"] = function()
|
||||
-- return {
|
||||
-- require("nvim-surround.utils").get_input "Enter the function name: " .. "(",
|
||||
-- ")",
|
||||
-- }
|
||||
-- end,
|
||||
-- },
|
||||
-- separators = {
|
||||
-- ["'"] = { "'", "'" },
|
||||
-- ['"'] = { '"', '"' },
|
||||
-- ["`"] = { "`", "`" },
|
||||
-- },
|
||||
-- HTML = {
|
||||
-- ["t"] = "type", -- Change just the tag type
|
||||
-- ["T"] = "whole", -- Change the whole tag contents
|
||||
-- },
|
||||
-- aliases = {
|
||||
-- ["a"] = ">", -- Single character aliases apply everywhere
|
||||
-- ["p"] = ")",
|
||||
-- ["b"] = "]",
|
||||
-- ["r"] = "}",
|
||||
-- -- Table aliases only apply for changes/deletions
|
||||
-- ["q"] = { '"', "'", "`" }, -- Any quote character
|
||||
-- ["s"] = { ")", "]", "}", ">", "'", '"', "`" }, -- Any surrounding delimiter
|
||||
-- },
|
||||
-- invalid_key_behavior = function()
|
||||
-- vim.notify ("Invalid surround character", vim.log.levels.INFO)
|
||||
-- end,
|
||||
-- },
|
||||
-- highlight = { -- Highlight before inserting/changing surrounds
|
||||
-- duration = 0,
|
||||
-- },
|
||||
}
|
||||
|
||||
-- local opts = { noremap = true, silent = true }
|
||||
-- local keymap = vim.api.nvim_set_keymap
|
||||
|
||||
-- keymap("n", "<leader>'", [[ysiw']], opts)
|
||||
|
||||
vim.cmd [[nmap <leader>' siw']]
|
||||
@ -20,6 +20,6 @@ tabout.setup {
|
||||
{ open = "[", close = "]" },
|
||||
{ open = "{", close = "}" },
|
||||
},
|
||||
ignore_beginning = false, --[[ if the cursor is at the beginning of a filled element it will rather tab out than shift the content ]]
|
||||
ignore_beginning = false, -- if the cursor is at the beginning of a filled element it will rather tab out than shift the content
|
||||
exclude = { "markdown" }, -- tabout will ignore these filetypes
|
||||
}
|
||||
|
||||
@ -9,7 +9,7 @@ local icons = require "user.icons"
|
||||
telescope.setup {
|
||||
defaults = {
|
||||
|
||||
prompt_prefix = icons.ui.Telescope .. "",
|
||||
prompt_prefix = icons.ui.Telescope .. " > ",
|
||||
selection_caret = " ",
|
||||
path_display = { "smart" },
|
||||
|
||||
@ -72,9 +72,6 @@ telescope.setup {
|
||||
["<C-j>"] = actions.move_selection_next,
|
||||
["<C-k>"] = actions.move_selection_previous,
|
||||
|
||||
["<C-b>"] = actions.results_scrolling_up,
|
||||
["<C-f>"] = actions.results_scrolling_down,
|
||||
|
||||
["<C-c>"] = actions.close,
|
||||
|
||||
["<Down>"] = actions.move_selection_next,
|
||||
@ -87,15 +84,9 @@ telescope.setup {
|
||||
|
||||
["<c-d>"] = require("telescope.actions").delete_buffer,
|
||||
|
||||
-- ["<C-u>"] = actions.preview_scrolling_up,
|
||||
-- ["<C-d>"] = actions.preview_scrolling_down,
|
||||
["<C-u>"] = actions.preview_scrolling_up,
|
||||
["<C-d>"] = actions.preview_scrolling_down,
|
||||
|
||||
-- ["<Tab>"] = actions.toggle_selection + actions.move_selection_worse,
|
||||
["<Tab>"] = actions.close,
|
||||
["<S-Tab>"] = actions.close,
|
||||
-- ["<S-Tab>"] = actions.toggle_selection + actions.move_selection_better,
|
||||
["<C-q>"] = actions.send_to_qflist + actions.open_qflist,
|
||||
["<M-q>"] = actions.send_selected_to_qflist + actions.open_qflist,
|
||||
["<C-l>"] = actions.complete_tag,
|
||||
["<C-h>"] = actions.which_key, -- keys from pressing <C-h>
|
||||
["<esc>"] = actions.close,
|
||||
@ -107,15 +98,6 @@ telescope.setup {
|
||||
["<C-x>"] = actions.select_horizontal,
|
||||
["<C-v>"] = actions.select_vertical,
|
||||
["<C-t>"] = actions.select_tab,
|
||||
["<C-b>"] = actions.results_scrolling_up,
|
||||
["<C-f>"] = actions.results_scrolling_down,
|
||||
|
||||
["<Tab>"] = actions.close,
|
||||
["<S-Tab>"] = actions.close,
|
||||
-- ["<Tab>"] = actions.toggle_selection + actions.move_selection_worse,
|
||||
-- ["<S-Tab>"] = actions.toggle_selection + actions.move_selection_better,
|
||||
["<C-q>"] = actions.send_to_qflist + actions.open_qflist,
|
||||
["<M-q>"] = actions.send_selected_to_qflist + actions.open_qflist,
|
||||
|
||||
["j"] = actions.move_selection_next,
|
||||
["k"] = actions.move_selection_previous,
|
||||
|
||||
@ -7,7 +7,7 @@ local icons = require "user.icons"
|
||||
|
||||
local error_red = "#F44747"
|
||||
local warning_orange = "#ff8800"
|
||||
-- local info_yellow = "#FFCC66"
|
||||
local info_yellow = "#FFCC66"
|
||||
local hint_blue = "#4FC1FF"
|
||||
local perf_purple = "#7C3AED"
|
||||
local note_green = '#10B981'
|
||||
@ -21,22 +21,19 @@ todo_comments.setup {
|
||||
icon = icons.ui.Bug, -- icon used for the sign, and in search results
|
||||
color = error_red, -- can be a hex color, or a named color (see below)
|
||||
alt = { "FIXME", "BUG", "FIXIT", "ISSUE" }, -- a set of other keywords that all map to this FIX keywords
|
||||
-- signs = false, -- configure signs for some keywords individually
|
||||
},
|
||||
TODO = { icon = icons.ui.Check, color = hint_blue, alt = { "TIP" } },
|
||||
HACK = { icon = icons.ui.Fire, color = warning_orange },
|
||||
WARN = { icon = icons.diagnostics.Warning, color = warning_orange, alt = { "WARNING", "XXX" } },
|
||||
PERF = { icon = icons.ui.Dashboard, color = perf_purple, alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" } },
|
||||
WARN = { icon = icons.diagnostics.Warning, color = warning_orange },
|
||||
PERF = { icon = icons.ui.Dashboard, color = perf_purple },
|
||||
NOTE = { icon = icons.ui.Note, color = note_green, alt = { "INFO" } },
|
||||
},
|
||||
-- merge_keywords = true, -- when true, custom keywords will be merged with the defaults
|
||||
-- highlighting of the line containing the todo comment
|
||||
-- * before: highlights before the keyword (typically comment characters)
|
||||
-- * keyword: highlights of the keyword
|
||||
-- * after: highlights after the keyword (todo text)
|
||||
highlight = {
|
||||
before = "", -- "fg" or "bg" or empty
|
||||
-- keyword = "wide", -- "fg", "bg", "wide" or empty. (wide is the same as bg, but will also highlight surrounding characters)
|
||||
keyword = "wide", -- "fg", "bg", "wide" or empty. (wide is the same as bg, but will also highlight surrounding characters)
|
||||
after = "fg", -- "fg" or "bg" or empty
|
||||
pattern = [[.*<(KEYWORDS)\s*:]], -- pattern or table of patterns, used for highlightng (vim regex)
|
||||
@ -44,15 +41,6 @@ todo_comments.setup {
|
||||
max_line_len = 400, -- ignore lines longer than this
|
||||
exclude = { "markdown" }, -- list of file types to exclude highlighting
|
||||
},
|
||||
-- list of named colors where we try to extract the guifg from the
|
||||
-- list of hilight groups or use the hex color if hl not found as a fallback
|
||||
-- colors = {
|
||||
-- error = { "LspDiagnosticsDefaultError", "ErrorMsg", "#DC2626" },
|
||||
-- warning = { "LspDiagnosticsDefaultWarning", "WarningMsg", "#FBBF24" },
|
||||
-- info = { "LspDiagnosticsDefaultInformation", "#2563EB" },
|
||||
-- hint = { "LspDiagnosticsDefaultHint", "#10B981" },
|
||||
-- default = { "Identifier", "#7C3AED" },
|
||||
-- },
|
||||
search = {
|
||||
command = "rg",
|
||||
args = {
|
||||
@ -63,8 +51,8 @@ todo_comments.setup {
|
||||
"--column",
|
||||
},
|
||||
-- regex that will be used to match keywords.
|
||||
-- don't replace the (KEYWORDS) placeholder
|
||||
pattern = [[\b(KEYWORDS):]], -- ripgrep regex
|
||||
-- pattern = [[\b(KEYWORDS)\b]], -- match without the extra colon. You'll likely get false positives
|
||||
-- don't replace the (keywords) placeholder
|
||||
pattern = [[\b(keywords):]], -- ripgrep regex
|
||||
-- pattern = [[\b(keywords)\b]], -- match without the extra colon. you'll likely get false positives
|
||||
},
|
||||
}
|
||||
|
||||
@ -26,53 +26,7 @@ toggleterm.setup {
|
||||
},
|
||||
}
|
||||
|
||||
function _G.set_terminal_keymaps()
|
||||
local opts = { noremap = true }
|
||||
-- vim.api.nvim_buf_set_keymap(0, 't', '<esc>', [[<C-\><C-n>]], opts)
|
||||
-- vim.api.nvim_buf_set_keymap(0, "t", "jk", [[<C-\><C-n>]], opts)
|
||||
vim.api.nvim_buf_set_keymap(0, "t", "<m-h>", [[<C-\><C-n><C-W>h]], opts)
|
||||
vim.api.nvim_buf_set_keymap(0, "t", "<m-j>", [[<C-\><C-n><C-W>j]], opts)
|
||||
vim.api.nvim_buf_set_keymap(0, "t", "<m-k>", [[<C-\><C-n><C-W>k]], opts)
|
||||
vim.api.nvim_buf_set_keymap(0, "t", "<m-l>", [[<C-\><C-n><C-W>l]], opts)
|
||||
end
|
||||
|
||||
vim.cmd "autocmd! TermOpen term://* lua set_terminal_keymaps()"
|
||||
|
||||
local Terminal = require("toggleterm.terminal").Terminal
|
||||
local lazygit = Terminal:new {
|
||||
cmd = "lazygit",
|
||||
hidden = true,
|
||||
direction = "float",
|
||||
float_opts = {
|
||||
border = "none",
|
||||
width = 100000,
|
||||
height = 100000,
|
||||
},
|
||||
on_open = function(_)
|
||||
vim.cmd "startinsert!"
|
||||
-- vim.cmd "set laststatus=0"
|
||||
end,
|
||||
on_close = function(_)
|
||||
-- vim.cmd "set laststatus=3"
|
||||
end,
|
||||
count = 99,
|
||||
}
|
||||
|
||||
function _LAZYGIT_TOGGLE()
|
||||
lazygit:toggle()
|
||||
end
|
||||
|
||||
local node = Terminal:new { cmd = "node", hidden = true }
|
||||
|
||||
function _NODE_TOGGLE()
|
||||
node:toggle()
|
||||
end
|
||||
|
||||
local ncdu = Terminal:new { cmd = "ncdu", hidden = true }
|
||||
|
||||
function _NCDU_TOGGLE()
|
||||
ncdu:toggle()
|
||||
end
|
||||
|
||||
local htop = Terminal:new { cmd = "htop", hidden = true }
|
||||
|
||||
@ -80,22 +34,10 @@ function _HTOP_TOGGLE()
|
||||
htop:toggle()
|
||||
end
|
||||
|
||||
local python = Terminal:new { cmd = "python", hidden = true }
|
||||
local dotnet_run = Terminal:new { cmd = "dotnet run", hidden = false }
|
||||
|
||||
function _PYTHON_TOGGLE()
|
||||
python:toggle()
|
||||
end
|
||||
|
||||
local cargo_run = Terminal:new { cmd = "cargo run", hidden = true }
|
||||
|
||||
function _CARGO_RUN()
|
||||
cargo_run:toggle()
|
||||
end
|
||||
|
||||
local cargo_test = Terminal:new { cmd = "cargo test", hidden = true }
|
||||
|
||||
function _CARGO_TEST()
|
||||
cargo_test:toggle()
|
||||
function _DOTNET_RUN_TOGGLE()
|
||||
dotnet_run:toggle()
|
||||
end
|
||||
|
||||
local float_term = Terminal:new {
|
||||
@ -136,43 +78,6 @@ end
|
||||
vim.api.nvim_set_keymap("n", "<m-1>", "<cmd>lua _FLOAT_TERM()<CR>", { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap("i", "<m-1>", "<cmd>lua _FLOAT_TERM()<CR>", { noremap = true, silent = true })
|
||||
|
||||
local vertical_term = Terminal:new {
|
||||
direction = "vertical",
|
||||
on_open = function(term)
|
||||
vim.cmd "startinsert!"
|
||||
vim.api.nvim_buf_set_keymap(
|
||||
term.bufnr,
|
||||
"n",
|
||||
"<m-2>",
|
||||
"<cmd>2ToggleTerm size=60 direction=vertical<cr>",
|
||||
{ noremap = true, silent = true }
|
||||
)
|
||||
vim.api.nvim_buf_set_keymap(
|
||||
term.bufnr,
|
||||
"t",
|
||||
"<m-2>",
|
||||
"<cmd>2ToggleTerm size=60 direction=vertical<cr>",
|
||||
{ noremap = true, silent = true }
|
||||
)
|
||||
vim.api.nvim_buf_set_keymap(
|
||||
term.bufnr,
|
||||
"i",
|
||||
"<m-2>",
|
||||
"<cmd>2ToggleTerm size=60 direction=vertical<cr>",
|
||||
{ noremap = true, silent = true }
|
||||
)
|
||||
vim.api.nvim_buf_set_keymap(term.bufnr, "", "<m-3>", "<nop>", { noremap = true, silent = true })
|
||||
end,
|
||||
count = 2,
|
||||
}
|
||||
|
||||
function _VERTICAL_TERM()
|
||||
vertical_term:toggle(60)
|
||||
end
|
||||
|
||||
vim.api.nvim_set_keymap("n", "<m-2>", "<cmd>lua _VERTICAL_TERM()<CR>", { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap("i", "<m-2>", "<cmd>lua _VERTICAL_TERM()<CR>", { noremap = true, silent = true })
|
||||
|
||||
local horizontal_term = Terminal:new {
|
||||
direction = "horizontal",
|
||||
on_open = function(term)
|
||||
@ -207,5 +112,5 @@ function _HORIZONTAL_TERM()
|
||||
horizontal_term:toggle(10)
|
||||
end
|
||||
|
||||
vim.api.nvim_set_keymap("n", "<m-3>", "<cmd>lua _HORIZONTAL_TERM()<CR>", { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap("i", "<m-3>", "<cmd>lua _HORIZONTAL_TERM()<CR>", { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap("n", "<m-2>", "<cmd>lua _HORIZONTAL_TERM()<CR>", { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap("i", "<m-2>", "<cmd>lua _HORIZONTAL_TERM()<CR>", { noremap = true, silent = true })
|
||||
|
||||
@ -3,9 +3,6 @@ if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
-- local ft_to_parser = require("nvim-treesitter.parsers").filetype_to_parsername
|
||||
-- ft_to_parser.motoko = "typescript"
|
||||
|
||||
configs.setup {
|
||||
ensure_installed = "all", -- one of "all" or a list of languages
|
||||
sync_install = false, -- install languages synchronously (only applied to `ensure_installed`)
|
||||
@ -14,15 +11,10 @@ configs.setup {
|
||||
enable = true, -- mandatory, false will disable the whole extension
|
||||
disable_virtual_text = true,
|
||||
disable = { "html" }, -- optional, list of language that will be disabled
|
||||
-- include_match_words = false
|
||||
},
|
||||
highlight = {
|
||||
-- use_languagetree = true,
|
||||
enable = true, -- false will disable the whole extension
|
||||
-- disable = { "css", "html" }, -- list of language that will be disabled
|
||||
-- disable = { "css", "markdown" }, -- list of language that will be disabled
|
||||
disable = { "markdown" }, -- list of language that will be disabled
|
||||
-- additional_vim_regex_highlighting = true,
|
||||
},
|
||||
autopairs = {
|
||||
enable = true,
|
||||
|
||||
@ -1,36 +0,0 @@
|
||||
local status_ok, context = pcall(require, "treesitter-context")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
context.setup{
|
||||
enable = false, -- Enable this plugin (Can be enabled/disabled later via commands)
|
||||
throttle = true, -- Throttles plugin updates (may improve performance)
|
||||
max_lines = 0, -- How many lines the window should span. Values <= 0 mean no limit.
|
||||
patterns = { -- Match patterns for TS nodes. These get wrapped to match at word boundaries.
|
||||
-- For all filetypes
|
||||
-- Note that setting an entry here replaces all other patterns for this entry.
|
||||
-- By setting the 'default' entry below, you can control which nodes you want to
|
||||
-- appear in the context window.
|
||||
-- default = {
|
||||
-- 'class',
|
||||
-- 'function',
|
||||
-- 'method',
|
||||
-- -- 'for', -- These won't appear in the context
|
||||
-- -- 'while',
|
||||
-- -- 'if',
|
||||
-- -- 'switch',
|
||||
-- -- 'case',
|
||||
-- },
|
||||
-- Example for a specific filetype.
|
||||
-- If a pattern is missing, *open a PR* so everyone can benefit.
|
||||
-- rust = {
|
||||
-- 'impl_item',
|
||||
-- },
|
||||
},
|
||||
}
|
||||
-- Commands
|
||||
-- TSContextEnable, TSContextDisable and TSContextToggle.
|
||||
--
|
||||
-- Appearance
|
||||
-- Use the highlight group TreesitterContext to change the colors of the context. Per default it links to NormalFloat.
|
||||
@ -1 +0,0 @@
|
||||
vim.cmd [[noremap <plug>(slash-after) zz]]
|
||||
@ -1,326 +1,270 @@
|
||||
local status_ok, which_key = pcall(require, "which-key")
|
||||
if not status_ok then
|
||||
return
|
||||
return
|
||||
end
|
||||
|
||||
local setup = {
|
||||
plugins = {
|
||||
marks = true, -- shows a list of your marks on ' and `
|
||||
registers = true, -- shows your registers on " in NORMAL or <C-r> in INSERT mode
|
||||
spelling = {
|
||||
enabled = true, -- enabling this will show WhichKey when pressing z= to select spelling suggestions
|
||||
suggestions = 20, -- how many suggestions should be shown in the list?
|
||||
plugins = {
|
||||
marks = true, -- shows a list of your marks on ' and `
|
||||
registers = true, -- shows your registers on " in NORMAL or <C-r> in INSERT mode
|
||||
spelling = {
|
||||
enabled = true, -- enabling this will show WhichKey when pressing z= to select spelling suggestions
|
||||
suggestions = 20, -- how many suggestions should be shown in the list?
|
||||
},
|
||||
-- the presets plugin, adds help for a bunch of default keybindings in Neovim
|
||||
-- No actual key bindings are created
|
||||
presets = {
|
||||
operators = false, -- adds help for operators like d, y, ... and registers them for motion / text object completion
|
||||
motions = false, -- adds help for motions
|
||||
text_objects = false, -- help for text objects triggered after entering an operator
|
||||
windows = true, -- default bindings on <c-w>
|
||||
nav = true, -- misc bindings to work with windows
|
||||
z = true, -- bindings for folds, spelling and others prefixed with z
|
||||
g = true, -- bindings for prefixed with g
|
||||
},
|
||||
},
|
||||
-- the presets plugin, adds help for a bunch of default keybindings in Neovim
|
||||
-- No actual key bindings are created
|
||||
presets = {
|
||||
operators = false, -- adds help for operators like d, y, ... and registers them for motion / text object completion
|
||||
motions = false, -- adds help for motions
|
||||
text_objects = false, -- help for text objects triggered after entering an operator
|
||||
windows = true, -- default bindings on <c-w>
|
||||
nav = true, -- misc bindings to work with windows
|
||||
z = true, -- bindings for folds, spelling and others prefixed with z
|
||||
g = true, -- bindings for prefixed with g
|
||||
key_labels = {
|
||||
-- override the label used to display some keys. It doesn't effect WK in any other way.
|
||||
["<leader>"] = "SPC",
|
||||
},
|
||||
icons = {
|
||||
breadcrumb = "»", -- symbol used in the command line area that shows your active key combo
|
||||
separator = "➜", -- symbol used between a key and it's label
|
||||
group = "+", -- symbol prepended to a group
|
||||
},
|
||||
popup_mappings = {
|
||||
scroll_down = "<C-d>", -- binding to scroll down inside the popup
|
||||
scroll_up = "<C-u>", -- binding to scroll up inside the popup
|
||||
},
|
||||
window = {
|
||||
border = "rounded", -- none, single, double, shadow
|
||||
position = "bottom", -- bottom, top
|
||||
margin = { 1, 0, 1, 0 }, -- extra window margin [top, right, bottom, left]
|
||||
padding = { 2, 2, 2, 2 }, -- extra window padding [top, right, bottom, left]
|
||||
winblend = 0,
|
||||
},
|
||||
layout = {
|
||||
height = { min = 4, max = 25 }, -- min and max height of the columns
|
||||
width = { min = 20, max = 50 }, -- min and max width of the columns
|
||||
spacing = 3, -- spacing between columns
|
||||
align = "center", -- align columns left, center or right
|
||||
},
|
||||
ignore_missing = true, -- enable this to hide mappings for which you didn't specify a label
|
||||
hidden = { "<silent>", "<cmd>", "<Cmd>", "<CR>", "call", "lua", "^:", "^ " }, -- hide mapping boilerplate
|
||||
show_help = false, -- show help message on the command line when the popup is visible
|
||||
triggers_blacklist = {
|
||||
-- list of mode / prefixes that should never be hooked by WhichKey
|
||||
-- this is mostly relevant for key maps that start with a native binding
|
||||
-- most people should not need to change this
|
||||
i = { "j", "k" },
|
||||
v = { "j", "k" },
|
||||
},
|
||||
},
|
||||
-- add operators that will trigger motion and text object completion
|
||||
-- to enable all native operators, set the preset / operators plugin above
|
||||
-- operators = { gc = "Comments" },
|
||||
key_labels = {
|
||||
-- override the label used to display some keys. It doesn't effect WK in any other way.
|
||||
-- For example:
|
||||
-- ["<space>"] = "SPC",
|
||||
["<leader>"] = "SPC",
|
||||
-- ["<cr>"] = "RET",
|
||||
-- ["<tab>"] = "TAB",
|
||||
},
|
||||
icons = {
|
||||
breadcrumb = "»", -- symbol used in the command line area that shows your active key combo
|
||||
separator = "➜", -- symbol used between a key and it's label
|
||||
group = "+", -- symbol prepended to a group
|
||||
},
|
||||
popup_mappings = {
|
||||
scroll_down = "<c-d>", -- binding to scroll down inside the popup
|
||||
scroll_up = "<c-u>", -- binding to scroll up inside the popup
|
||||
},
|
||||
window = {
|
||||
border = "rounded", -- none, single, double, shadow
|
||||
position = "bottom", -- bottom, top
|
||||
margin = { 1, 0, 1, 0 }, -- extra window margin [top, right, bottom, left]
|
||||
padding = { 2, 2, 2, 2 }, -- extra window padding [top, right, bottom, left]
|
||||
winblend = 0,
|
||||
},
|
||||
layout = {
|
||||
height = { min = 4, max = 25 }, -- min and max height of the columns
|
||||
width = { min = 20, max = 50 }, -- min and max width of the columns
|
||||
spacing = 3, -- spacing between columns
|
||||
align = "center", -- align columns left, center or right
|
||||
},
|
||||
ignore_missing = true, -- enable this to hide mappings for which you didn't specify a label
|
||||
hidden = { "<silent>", "<cmd>", "<Cmd>", "<CR>", "call", "lua", "^:", "^ " }, -- hide mapping boilerplate
|
||||
show_help = false, -- show help message on the command line when the popup is visible
|
||||
-- triggers = "auto", -- automatically setup triggers
|
||||
-- triggers = {"<leader>"} -- or specify a list manually
|
||||
triggers_blacklist = {
|
||||
-- list of mode / prefixes that should never be hooked by WhichKey
|
||||
-- this is mostly relevant for key maps that start with a native binding
|
||||
-- most people should not need to change this
|
||||
i = { "j", "k" },
|
||||
v = { "j", "k" },
|
||||
},
|
||||
}
|
||||
|
||||
local opts = {
|
||||
mode = "n", -- NORMAL mode
|
||||
prefix = "<leader>",
|
||||
buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings
|
||||
silent = true, -- use `silent` when creating keymaps
|
||||
noremap = true, -- use `noremap` when creating keymaps
|
||||
nowait = true, -- use `nowait` when creating keymaps
|
||||
mode = "n", -- NORMAL mode
|
||||
prefix = "<leader>",
|
||||
buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings
|
||||
silent = true, -- use `silent` when creating keymaps
|
||||
noremap = true, -- use `noremap` when creating keymaps
|
||||
nowait = true, -- use `nowait` when creating keymaps
|
||||
}
|
||||
|
||||
local m_opts = {
|
||||
mode = "n", -- NORMAL mode
|
||||
prefix = "m",
|
||||
buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings
|
||||
silent = true, -- use `silent` when creating keymaps
|
||||
noremap = true, -- use `noremap` when creating keymaps
|
||||
nowait = true, -- use `nowait` when creating keymaps
|
||||
mode = "n", -- NORMAL mode
|
||||
prefix = "m",
|
||||
buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings
|
||||
silent = true, -- use `silent` when creating keymaps
|
||||
noremap = true, -- use `noremap` when creating keymaps
|
||||
nowait = true, -- use `nowait` when creating keymaps
|
||||
}
|
||||
|
||||
local m_mappings = {
|
||||
a = { "<cmd>silent BookmarkAnnotate<cr>", "Annotate" },
|
||||
c = { "<cmd>silent BookmarkClear<cr>", "Clear" },
|
||||
b = { "<cmd>silent BookmarkToggle<cr>", "Toggle" },
|
||||
m = { '<cmd>lua require("harpoon.mark").add_file()<cr>', "Harpoon" },
|
||||
["."] = { '<cmd>lua require("harpoon.ui").nav_next()<cr>', "Harpoon Next" },
|
||||
[","] = { '<cmd>lua require("harpoon.ui").nav_prev()<cr>', "Harpoon Prev" },
|
||||
j = { "<cmd>silent BookmarkNext<cr>", "Next" },
|
||||
s = { "<cmd>Telescope harpoon marks<cr>", "Search Files" },
|
||||
k = { "<cmd>silent BookmarkPrev<cr>", "Prev" },
|
||||
S = { "<cmd>silent BookmarkShowAll<cr>", "Prev" },
|
||||
-- s = {
|
||||
-- "<cmd>lua require('telescope').extensions.vim_bookmarks.all({ hide_filename=false, prompt_title=\"bookmarks\", shorten_path=false })<cr>",
|
||||
-- "Show",
|
||||
-- },
|
||||
x = { "<cmd>BookmarkClearAll<cr>", "Clear All" },
|
||||
[";"] = { '<cmd>lua require("harpoon.ui").toggle_quick_menu()<cr>', "Harpoon UI" },
|
||||
m = { '<cmd>lua require("harpoon.mark").add_file()<cr>', "Harpoon" },
|
||||
l = { '<cmd>lua require("harpoon.ui").nav_next()<cr>', "Harpoon Next" },
|
||||
h = { '<cmd>lua require("harpoon.ui").nav_prev()<cr>', "Harpoon Prev" },
|
||||
s = { "<cmd>Telescope harpoon marks<cr>", "Search Files" },
|
||||
u = { '<cmd>lua require("harpoon.ui").toggle_quick_menu()<cr>', "Harpoon UI" },
|
||||
}
|
||||
|
||||
local mappings = {
|
||||
a = { "<cmd>lua vim.lsp.buf.code_action()<cr>", "Action" },
|
||||
n = { "<cmd>NvimTreeToggle<cr>", "Explorer" },
|
||||
-- n = { "<cmd>NERDTreeToggle<cr>", "Explorer" },
|
||||
v = { "<cmd>vsplit<cr>", "vsplit" },
|
||||
h = { "<cmd>split<cr>", "split" },
|
||||
w = { "<cmd>w<CR>", "Write" },
|
||||
-- h = { "<cmd>nohlsearch<CR>", "No HL" },
|
||||
q = { '<cmd>lua require("user.functions").smart_quit()<CR>', "Quit" },
|
||||
["/"] = { '<cmd>lua require("Comment.api").toggle.linewise.current()<CR>', "Comment" },
|
||||
a = { "<cmd>CodeActionMenu<cr>", "Action" },
|
||||
c = { "<cmd>Bdelete<cr>", "Close Buffer" },
|
||||
C = { "<cmd>w! | !compiler <c-r>%<cr>", "Compile File" },
|
||||
h = { "<cmd>split<cr>", "split" },
|
||||
n = { "<cmd>NvimTreeToggle<cr>", "Explorer" },
|
||||
O = { "<cmd>setlocal spell! spellling=en_us<CR>", "Toggle Spelling" },
|
||||
P = { "<cmd>!opout <c-r>%<cr><cr>", "Preview Document" },
|
||||
q = { '<cmd>lua require("user.functions").smart_quit()<CR>', "Quit" },
|
||||
v = { "<cmd>vsplit<cr>", "vsplit" },
|
||||
w = { "<cmd>w<CR>", "Write" },
|
||||
z = { "<cmd>ZenMode<cr>", "Zen" },
|
||||
["/"] = { '<cmd>lua require("Comment.api").toggle.linewise.current()<CR>', "Comment" },
|
||||
["'"] = { '<cmd>close<CR>', "Close split" },
|
||||
|
||||
-- :lua require'lir.float'.toggle()
|
||||
-- ["f"] = {
|
||||
-- "<cmd>lua require('telescope.builtin').find_files(require('telescope.themes').get_dropdown{previewer = false})<cr>",
|
||||
-- "Find files",
|
||||
-- },
|
||||
-- ["F"] = { "<cmd>Telescope live_grep theme=ivy<cr>", "Find Text" },
|
||||
-- P = { "<cmd>lua require('telescope').extensions.projects.projects()<cr>", "Projects" },
|
||||
-- ["R"] = { '<cmd>lua require("renamer").rename()<cr>', "Rename" },
|
||||
-- ["z"] = { "<cmd>ZenMode<cr>", "Zen" },
|
||||
|
||||
B = {
|
||||
name = "Browse",
|
||||
i = { "<cmd>BrowseInputSearch<cr>", "Input Search" },
|
||||
b = { "<cmd>Browse<cr>", "Browse" },
|
||||
d = { "<cmd>BrowseDevdocsSearch<cr>", "Devdocs" },
|
||||
f = { "<cmd>BrowseDevdocsFiletypeSearch<cr>", "Devdocs Filetype" },
|
||||
m = { "<cmd>BrowseMdnSearch<cr>", "Mdn" },
|
||||
},
|
||||
|
||||
b = {
|
||||
name = "Buffer",
|
||||
b = { "<cmd>Telescope buffers<cr>", "Telescope" },
|
||||
c = { "<cmd>Bdelete!<cr>", "Close Buffer" },
|
||||
h = { "<cmd>BufferLineCyclePrev<cr>", "Cycle Previous" },
|
||||
l = { "<cmd>BufferLineCycleNext<cr>", "Cycle Next" },
|
||||
p = { "<cmd>BufferLinePickClose", "Pick Close" },
|
||||
},
|
||||
|
||||
p = {
|
||||
name = "Packer",
|
||||
c = { "<cmd>PackerCompile<cr>", "Compile" },
|
||||
i = { "<cmd>PackerInstall<cr>", "Install" },
|
||||
s = { "<cmd>PackerSync<cr>", "Sync" },
|
||||
S = { "<cmd>PackerStatus<cr>", "Status" },
|
||||
u = { "<cmd>PackerUpdate<cr>", "Update" },
|
||||
},
|
||||
|
||||
o = {
|
||||
name = "Options",
|
||||
c = { '<cmd>lua vim.g.cmp_active=false<cr>', "Completion off" },
|
||||
C = { '<cmd>lua vim.g.cmp_active=true<cr>', "Completion on" },
|
||||
w = { '<cmd>lua require("user.functions").toggle_option("wrap")<cr>', "Wrap" },
|
||||
r = { '<cmd>lua require("user.functions").toggle_option("relativenumber")<cr>', "Relative" },
|
||||
l = { '<cmd>lua require("user.functions").toggle_option("cursorline")<cr>', "Cursorline" },
|
||||
s = { '<cmd>lua require("user.functions").toggle_option("spell")<cr>', "Spell" },
|
||||
t = { '<cmd>lua require("user.functions").toggle_tabline()<cr>', "Tabline" },
|
||||
},
|
||||
|
||||
r = {
|
||||
name = "Replace",
|
||||
r = { "<cmd>lua require('spectre').open()<cr>", "Replace" },
|
||||
w = { "<cmd>lua require('spectre').open_visual({select_word=true})<cr>", "Replace Word" },
|
||||
f = { "<cmd>lua require('spectre').open_file_search()<cr>", "Replace Buffer" },
|
||||
},
|
||||
|
||||
d = {
|
||||
name = "Debug",
|
||||
b = { "<cmd>lua require'dap'.toggle_breakpoint()<cr>", "Breakpoint" },
|
||||
c = { "<cmd>lua require'dap'.continue()<cr>", "Continue" },
|
||||
i = { "<cmd>lua require'dap'.step_into()<cr>", "Into" },
|
||||
o = { "<cmd>lua require'dap'.step_over()<cr>", "Over" },
|
||||
O = { "<cmd>lua require'dap'.step_out()<cr>", "Out" },
|
||||
r = { "<cmd>lua require'dap'.repl.toggle()<cr>", "Repl" },
|
||||
l = { "<cmd>lua require'dap'.run_last()<cr>", "Last" },
|
||||
u = { "<cmd>lua require'dapui'.toggle()<cr>", "UI" },
|
||||
x = { "<cmd>lua require'dap'.terminate()<cr>", "Exit" },
|
||||
},
|
||||
|
||||
f = {
|
||||
name = "Find",
|
||||
b = { "<cmd>Telescope git_branches<cr>", "Checkout branch" },
|
||||
c = { "<cmd>Telescope colorscheme<cr>", "Colorscheme" },
|
||||
f = { "<cmd>Telescope find_files<cr>", "Find files" },
|
||||
t = { "<cmd>Telescope live_grep<cr>", "Find Text" },
|
||||
s = { "<cmd>Telescope grep_string<cr>", "Find String" },
|
||||
h = { "<cmd>Telescope help_tags<cr>", "Help" },
|
||||
H = { "<cmd>Telescope highlights<cr>", "Highlights" },
|
||||
l = { "<cmd>Telescope resume<cr>", "Last Search" },
|
||||
M = { "<cmd>Telescope man_pages<cr>", "Man Pages" },
|
||||
r = { "<cmd>Telescope oldfiles<cr>", "Recent File" },
|
||||
R = { "<cmd>Telescope registers<cr>", "Registers" },
|
||||
k = { "<cmd>Telescope keymaps<cr>", "Keymaps" },
|
||||
C = { "<cmd>Telescope commands<cr>", "Commands" },
|
||||
},
|
||||
|
||||
g = {
|
||||
name = "Git",
|
||||
g = { "<cmd>lua _LAZYGIT_TOGGLE()<CR>", "Lazygit" },
|
||||
j = { "<cmd>lua require 'gitsigns'.next_hunk()<cr>", "Next Hunk" },
|
||||
k = { "<cmd>lua require 'gitsigns'.prev_hunk()<cr>", "Prev Hunk" },
|
||||
l = { "<cmd>GitBlameToggle<cr>", "Blame" },
|
||||
p = { "<cmd>lua require 'gitsigns'.preview_hunk()<cr>", "Preview Hunk" },
|
||||
r = { "<cmd>lua require 'gitsigns'.reset_hunk()<cr>", "Reset Hunk" },
|
||||
R = { "<cmd>lua require 'gitsigns'.reset_buffer()<cr>", "Reset Buffer" },
|
||||
s = { "<cmd>lua require 'gitsigns'.stage_hunk()<cr>", "Stage Hunk" },
|
||||
u = {
|
||||
"<cmd>lua require 'gitsigns'.undo_stage_hunk()<cr>",
|
||||
"Undo Stage Hunk",
|
||||
b = {
|
||||
name = "Buffer",
|
||||
b = { "<cmd>Telescope buffers<cr>", "Telescope" },
|
||||
c = { "<cmd>Bdelete!<cr>", "Close Buffer" },
|
||||
h = { "<cmd>BufferLineCyclePrev<cr>", "Cycle Previous" },
|
||||
l = { "<cmd>BufferLineCycleNext<cr>", "Cycle Next" },
|
||||
p = { "<cmd>BufferLinePickClose", "Pick Close" },
|
||||
},
|
||||
o = { "<cmd>Telescope git_status<cr>", "Open changed file" },
|
||||
b = { "<cmd>Telescope git_branches<cr>", "Checkout branch" },
|
||||
c = { "<cmd>Telescope git_commits<cr>", "Checkout commit" },
|
||||
d = {
|
||||
"<cmd>Gitsigns diffthis HEAD<cr>",
|
||||
"Diff",
|
||||
},
|
||||
},
|
||||
|
||||
l = {
|
||||
name = "LSP",
|
||||
a = { "<cmd>lua vim.lsp.buf.code_action()<cr>", "Code Action" },
|
||||
c = { "<cmd>lua require('user.lsp').server_capabilities()<cr>", "Get Capabilities" },
|
||||
d = { "<cmd>TroubleToggle<cr>", "Diagnostics" },
|
||||
D = { "<cmd>lua vim.lsp.buf.definition()<cr>", "Definition"},
|
||||
w = {
|
||||
"<cmd>Telescope lsp_workspace_diagnostics<cr>",
|
||||
"Workspace Diagnostics",
|
||||
p = {
|
||||
name = "Packer",
|
||||
c = { "<cmd>PackerCompile<cr>", "Compile" },
|
||||
i = { "<cmd>PackerInstall<cr>", "Install" },
|
||||
s = { "<cmd>PackerSync<cr>", "Sync" },
|
||||
S = { "<cmd>PackerStatus<cr>", "Status" },
|
||||
u = { "<cmd>PackerUpdate<cr>", "Update" },
|
||||
},
|
||||
f = { "<cmd>lua vim.lsp.buf.format({ async = true })<cr>", "Format" },
|
||||
F = { "<cmd>LspToggleAutoFormat<cr>", "Toggle Autoformat" },
|
||||
i = { "<cmd>lua vim.lsp.buf.implementation()<cr>", "Implementation" },
|
||||
h = { "<cmd>lua require('lsp-inlayhints').toggle()<cr>", "Toggle Hints" },
|
||||
H = { "<cmd>IlluminationToggle<cr>", "Toggle Doc HL" },
|
||||
I = { "<cmd>LspInfo<cr>", "Info" },
|
||||
j = {
|
||||
"<cmd>lua vim.diagnostic.goto_next({buffer=0})<CR>",
|
||||
"Next Diagnostic",
|
||||
|
||||
o = {
|
||||
name = "Options",
|
||||
c = { '<cmd>lua vim.g.cmp_active=false<cr>', "Completion off" },
|
||||
C = { '<cmd>lua vim.g.cmp_active=true<cr>', "Completion on" },
|
||||
w = { '<cmd>lua require("user.functions").toggle_option("wrap")<cr>', "Wrap" },
|
||||
r = { '<cmd>lua require("user.functions").toggle_option("relativenumber")<cr>', "Relative" },
|
||||
l = { '<cmd>lua require("user.functions").toggle_option("cursorline")<cr>', "Cursorline" },
|
||||
s = { '<cmd>lua require("user.functions").toggle_option("spell")<cr>', "Spell" },
|
||||
t = { '<cmd>lua require("user.functions").toggle_tabline()<cr>', "Tabline" },
|
||||
},
|
||||
k = {
|
||||
"<cmd>lua vim.diagnostic.goto_prev({buffer=0})<cr>",
|
||||
"Prev Diagnostic",
|
||||
|
||||
r = {
|
||||
name = "Replace",
|
||||
r = { "<cmd>lua require('spectre').open()<cr>", "Replace" },
|
||||
w = { "<cmd>lua require('spectre').open_visual({select_word=true})<cr>", "Replace Word" },
|
||||
f = { "<cmd>lua require('spectre').open_file_search()<cr>", "Replace Buffer" },
|
||||
},
|
||||
v = { "<cmd>lua require('lsp_lines').toggle()<cr>", "Virtual Text" },
|
||||
l = { "<cmd>lua vim.lsp.codelens.run()<cr>", "CodeLens Action" },
|
||||
o = { "<cmd>SymbolsOutline<cr>", "Outline" },
|
||||
q = { "<cmd>lua vim.lsp.diagnostic.set_loclist()<cr>", "Quickfix" },
|
||||
r = { "<cmd>lua vim.lsp.buf.rename()<cr>", "Rename" },
|
||||
R = { "<cmd>TroubleToggle lsp_references<cr>", "References" },
|
||||
s = { "<cmd>Telescope lsp_document_symbols<cr>", "Document Symbols" },
|
||||
S = {
|
||||
"<cmd>Telescope lsp_dynamic_workspace_symbols<cr>",
|
||||
"Workspace Symbols",
|
||||
|
||||
-- perhaps I will set this up in the future?
|
||||
-- d = {
|
||||
-- name = "Debug",
|
||||
-- b = { "<cmd>lua require'dap'.toggle_breakpoint()<cr>", "Breakpoint" },
|
||||
-- c = { "<cmd>lua require'dap'.continue()<cr>", "Continue" },
|
||||
-- i = { "<cmd>lua require'dap'.step_into()<cr>", "Into" },
|
||||
-- o = { "<cmd>lua require'dap'.step_over()<cr>", "Over" },
|
||||
-- O = { "<cmd>lua require'dap'.step_out()<cr>", "Out" },
|
||||
-- r = { "<cmd>lua require'dap'.repl.toggle()<cr>", "Repl" },
|
||||
-- l = { "<cmd>lua require'dap'.run_last()<cr>", "Last" },
|
||||
-- u = { "<cmd>lua require'dapui'.toggle()<cr>", "UI" },
|
||||
-- x = { "<cmd>lua require'dap'.terminate()<cr>", "Exit" },
|
||||
-- },
|
||||
|
||||
f = {
|
||||
name = "Find",
|
||||
b = { "<cmd>Telescope git_branches<cr>", "Checkout branch" },
|
||||
c = { "<cmd>Telescope colorscheme<cr>", "Colorscheme" },
|
||||
f = { "<cmd>Telescope find_files<cr>", "Find files" },
|
||||
t = { "<cmd>Telescope live_grep<cr>", "Find Text" },
|
||||
s = { "<cmd>Telescope grep_string<cr>", "Find String" },
|
||||
h = { "<cmd>Telescope help_tags<cr>", "Help" },
|
||||
H = { "<cmd>Telescope highlights<cr>", "Highlights" },
|
||||
l = { "<cmd>Telescope resume<cr>", "Last Search" },
|
||||
M = { "<cmd>Telescope man_pages<cr>", "Man Pages" },
|
||||
r = { "<cmd>Telescope oldfiles<cr>", "Recent File" },
|
||||
R = { "<cmd>Telescope registers<cr>", "Registers" },
|
||||
k = { "<cmd>Telescope keymaps<cr>", "Keymaps" },
|
||||
C = { "<cmd>Telescope commands<cr>", "Commands" },
|
||||
},
|
||||
t = { '<cmd>lua require("user.functions").toggle_diagnostics()<cr>', "Toggle Diagnostics" },
|
||||
u = { "<cmd>LuaSnipUnlinkCurrent<cr>", "Unlink Snippet" },
|
||||
},
|
||||
|
||||
s = {
|
||||
name = "Surround",
|
||||
["."] = { "<cmd>lua require('surround').repeat_last()<cr>", "Repeat" },
|
||||
a = { "<cmd>lua require('surround').surround_add(true)<cr>", "Add" },
|
||||
d = { "<cmd>lua require('surround').surround_delete()<cr>", "Delete" },
|
||||
r = { "<cmd>lua require('surround').surround_replace()<cr>", "Replace" },
|
||||
q = { "<cmd>lua require('surround').toggle_quotes()<cr>", "Quotes" },
|
||||
b = { "<cmd>lua require('surround').toggle_brackets()<cr>", "Brackets" },
|
||||
},
|
||||
g = {
|
||||
name = "Git",
|
||||
g = { "<cmd>lua _LAZYGIT_TOGGLE()<CR>", "Lazygit" },
|
||||
j = { "<cmd>lua require 'gitsigns'.next_hunk()<cr>", "Next Hunk" },
|
||||
k = { "<cmd>lua require 'gitsigns'.prev_hunk()<cr>", "Prev Hunk" },
|
||||
l = { "<cmd>GitBlameToggle<cr>", "Blame" },
|
||||
p = { "<cmd>lua require 'gitsigns'.preview_hunk()<cr>", "Preview Hunk" },
|
||||
r = { "<cmd>lua require 'gitsigns'.reset_hunk()<cr>", "Reset Hunk" },
|
||||
R = { "<cmd>lua require 'gitsigns'.reset_buffer()<cr>", "Reset Buffer" },
|
||||
s = { "<cmd>lua require 'gitsigns'.stage_hunk()<cr>", "Stage Hunk" },
|
||||
u = {
|
||||
"<cmd>lua require 'gitsigns'.undo_stage_hunk()<cr>",
|
||||
"Undo Stage Hunk",
|
||||
},
|
||||
o = { "<cmd>Telescope git_status<cr>", "Open changed file" },
|
||||
b = { "<cmd>Telescope git_branches<cr>", "Checkout branch" },
|
||||
c = { "<cmd>Telescope git_commits<cr>", "Checkout commit" },
|
||||
d = {
|
||||
"<cmd>Gitsigns diffthis HEAD<cr>",
|
||||
"Diff",
|
||||
},
|
||||
},
|
||||
|
||||
S = {
|
||||
name = "SnipRun",
|
||||
c = { "<cmd>SnipClose<cr>", "Close" },
|
||||
f = { "<cmd>%SnipRun<cr>", "Run File" },
|
||||
i = { "<cmd>SnipInfo<cr>", "Info" },
|
||||
m = { "<cmd>SnipReplMemoryClean<cr>", "Mem Clean" },
|
||||
r = { "<cmd>SnipReset<cr>", "Reset" },
|
||||
t = { "<cmd>SnipRunToggle<cr>", "Toggle" },
|
||||
x = { "<cmd>SnipTerminate<cr>", "Terminate" },
|
||||
},
|
||||
l = {
|
||||
name = "LSP",
|
||||
a = { "<cmd>CodeActionMenu<cr>", "Code Action" },
|
||||
d = { "<cmd>TroubleToggle document_diagnostics<cr>", "Diagnostics" },
|
||||
D = { "<cmd>lua vim.lsp.buf.definition()<cr>", "Definition" },
|
||||
w = {
|
||||
"<cmd>TroubleToggle workspace_diagnostics<cr>",
|
||||
"Workspace Diagnostics",
|
||||
},
|
||||
f = { "<cmd>lua vim.lsp.buf.format({ async = true })<cr>", "Format" },
|
||||
F = { "<cmd>LspToggleAutoFormat<cr>", "Toggle Autoformat" },
|
||||
h = { "<cmd>lua vim.lsp.buf.hover()<CR>", "Hover" },
|
||||
i = { "<cmd>lua vim.lsp.buf.implementation()<cr>", "Implementation" },
|
||||
I = { "<cmd>LspInfo<cr>", "Info" },
|
||||
j = {
|
||||
"<cmd>lua vim.diagnostic.goto_next({buffer=0})<CR>",
|
||||
"Next Diagnostic",
|
||||
},
|
||||
k = {
|
||||
"<cmd>lua vim.diagnostic.goto_prev({buffer=0})<cr>",
|
||||
"Prev Diagnostic",
|
||||
},
|
||||
v = { "<cmd>lua require('lsp_lines').toggle()<cr>", "Virtual Text" },
|
||||
l = { "<cmd>lua vim.lsp.codelens.run()<cr>", "CodeLens Action" },
|
||||
o = { "<cmd>SymbolsOutline<cr>", "Outline" },
|
||||
r = { "<cmd>lua vim.lsp.buf.rename()<cr>", "Rename" },
|
||||
R = { "<cmd>TroubleToggle lsp_references<cr>", "References" },
|
||||
s = { "<cmd>Telescope lsp_document_symbols<cr>", "Document Symbols" },
|
||||
S = {
|
||||
"<cmd>Telescope lsp_dynamic_workspace_symbols<cr>",
|
||||
"Workspace Symbols",
|
||||
},
|
||||
t = { '<cmd>lua require("user.functions").toggle_diagnostics()<cr>', "Toggle Diagnostics" },
|
||||
u = { "<cmd>LuaSnipUnlinkCurrent<cr>", "Unlink Snippet" },
|
||||
},
|
||||
|
||||
t = {
|
||||
name = "Terminal",
|
||||
["1"] = { ":1ToggleTerm<cr>", "1" },
|
||||
["2"] = { ":2ToggleTerm<cr>", "2" },
|
||||
["3"] = { ":3ToggleTerm<cr>", "3" },
|
||||
["4"] = { ":4ToggleTerm<cr>", "4" },
|
||||
n = { "<cmd>lua _NODE_TOGGLE()<cr>", "Node" },
|
||||
u = { "<cmd>lua _NCDU_TOGGLE()<cr>", "NCDU" },
|
||||
t = { "<cmd>lua _HTOP_TOGGLE()<cr>", "Htop" },
|
||||
p = { "<cmd>lua _PYTHON_TOGGLE()<cr>", "Python" },
|
||||
f = { "<cmd>ToggleTerm direction=float<cr>", "Float" },
|
||||
h = { "<cmd>ToggleTerm size=10 direction=horizontal<cr>", "Horizontal" },
|
||||
v = { "<cmd>ToggleTerm size=80 direction=vertical<cr>", "Vertical" },
|
||||
},
|
||||
t = {
|
||||
name = "Terminal",
|
||||
["1"] = { ":1ToggleTerm<cr>", "1" },
|
||||
["2"] = { ":2ToggleTerm<cr>", "2" },
|
||||
["3"] = { ":3ToggleTerm<cr>", "3" },
|
||||
["4"] = { ":4ToggleTerm<cr>", "4" },
|
||||
t = { "<cmd>lua _HTOP_TOGGLE()<cr>", "htop" },
|
||||
d = { "<cmd>lua _DOTNET_RUN_TOGGLE()<cr>", "dotnet run" },
|
||||
f = { "<cmd>ToggleTerm direction=float<cr>", "Float" },
|
||||
h = { "<cmd>ToggleTerm direction=horizontal<cr>", "Horizontal" },
|
||||
},
|
||||
|
||||
T = {
|
||||
name = "Treesitter",
|
||||
h = { "<cmd>TSHighlightCapturesUnderCursor<cr>", "Highlight" },
|
||||
p = { "<cmd>TSPlaygroundToggle<cr>", "Playground" },
|
||||
r = { "<cmd>TSToggle rainbow<cr>", "Rainbow" },
|
||||
},
|
||||
T = {
|
||||
name = "Treesitter",
|
||||
h = { "<cmd>TSHighlightCapturesUnderCursor<cr>", "Highlight" },
|
||||
p = { "<cmd>TSPlaygroundToggle<cr>", "Playground" },
|
||||
r = { "<cmd>TSToggle rainbow<cr>", "Rainbow" },
|
||||
},
|
||||
|
||||
N = {
|
||||
name = "Notes (zk)",
|
||||
n = { "<cmd>ZkNew<cr>", "New Note" },
|
||||
e = { "<cmd>ZkNotes<cr>", "Edit Notes" },
|
||||
}
|
||||
}
|
||||
|
||||
local vopts = {
|
||||
mode = "v", -- VISUAL mode
|
||||
prefix = "<leader>",
|
||||
buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings
|
||||
silent = true, -- use `silent` when creating keymaps
|
||||
noremap = true, -- use `noremap` when creating keymaps
|
||||
nowait = true, -- use `nowait` when creating keymaps
|
||||
mode = "v", -- VISUAL mode
|
||||
prefix = "<leader>",
|
||||
buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings
|
||||
silent = true, -- use `silent` when creating keymaps
|
||||
noremap = true, -- use `noremap` when creating keymaps
|
||||
nowait = true, -- use `nowait` when creating keymaps
|
||||
}
|
||||
|
||||
local vmappings = {
|
||||
["/"] = { '<ESC><CMD>lua require("Comment.api").toggle.linewise(vim.fn.visualmode())<CR>', "Comment" },
|
||||
s = { "<esc><cmd>'<,'>SnipRun<cr>", "Run range" },
|
||||
-- z = { "<cmd>TZNarrow<cr>", "Narrow" },
|
||||
["/"] = { '<ESC><CMD>lua require("Comment.api").toggle.linewise(vim.fn.visualmode())<CR>', "Comment" },
|
||||
}
|
||||
|
||||
which_key.setup(setup)
|
||||
|
||||
@ -1,108 +1,40 @@
|
||||
local M = {}
|
||||
|
||||
M.winbar_filetype_exclude = {
|
||||
"help",
|
||||
"startify",
|
||||
"dashboard",
|
||||
"packer",
|
||||
"neogitstatus",
|
||||
"NvimTree",
|
||||
"Trouble",
|
||||
"alpha",
|
||||
"lir",
|
||||
"Outline",
|
||||
"spectre_panel",
|
||||
"toggleterm",
|
||||
"DressingSelect",
|
||||
"Jaq",
|
||||
"harpoon",
|
||||
"dapui_scopes",
|
||||
"dapui_breakpoints",
|
||||
"dapui_stacks",
|
||||
"dapui_watches",
|
||||
"dap-repl",
|
||||
"dap-terminal",
|
||||
"dapui_console",
|
||||
"lab",
|
||||
"Markdown",
|
||||
"",
|
||||
}
|
||||
|
||||
M.get_filename = function()
|
||||
local filename = vim.fn.expand "%:t"
|
||||
local extension = vim.fn.expand "%:e"
|
||||
local f = require "user.functions"
|
||||
|
||||
if not f.isempty(filename) then
|
||||
local file_icon, file_icon_color =
|
||||
require("nvim-web-devicons").get_icon_color(filename, extension, { default = true })
|
||||
|
||||
local hl_group = "FileIconColor" .. extension
|
||||
|
||||
vim.api.nvim_set_hl(0, hl_group, { fg = file_icon_color })
|
||||
if f.isempty(file_icon) then
|
||||
file_icon = ""
|
||||
file_icon_color = ""
|
||||
end
|
||||
|
||||
-- local navic_text = vim.api.nvim_get_hl_by_name("NavicText", true)
|
||||
-- vim.api.nvim_set_hl(0, "Winbar", { fg = navic_text.foreground })
|
||||
|
||||
return " " .. "%#" .. hl_group .. "#" .. file_icon .. "%*" .. " " .. "%#Winbar#" .. filename .. "%*"
|
||||
end
|
||||
local status_ok, winbar = pcall(require, "winbar")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local excludes = function()
|
||||
if vim.tbl_contains(M.winbar_filetype_exclude, vim.bo.filetype) then
|
||||
vim.opt_local.winbar = nil
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
winbar.setup({
|
||||
enabled = true,
|
||||
|
||||
M.get_winbar = function()
|
||||
if excludes() then
|
||||
return
|
||||
end
|
||||
local f = require "user.functions"
|
||||
local value = M.get_filename()
|
||||
show_file_path = true,
|
||||
show_symbols = true,
|
||||
|
||||
if not f.isempty(value) and f.get_buf_option "mod" then
|
||||
local mod = "%#LspCodeLens#" .. require("user.icons").ui.Circle .. "%*"
|
||||
value = value .. mod
|
||||
end
|
||||
colors = {
|
||||
path = '', -- You can customize colors like #c946fd
|
||||
file_name = '',
|
||||
symbols = '',
|
||||
},
|
||||
|
||||
local num_tabs = #vim.api.nvim_list_tabpages()
|
||||
icons = {
|
||||
file_icon_default = '',
|
||||
seperator = '>',
|
||||
editor_state = '●',
|
||||
lock_icon = '',
|
||||
},
|
||||
|
||||
if num_tabs > 1 and not f.isempty(value) then
|
||||
local tabpage_number = tostring(vim.api.nvim_tabpage_get_number(0))
|
||||
value = value .. "%=" .. tabpage_number .. "/" .. tostring(num_tabs)
|
||||
end
|
||||
|
||||
local status_ok, _ = pcall(vim.api.nvim_set_option_value, "winbar", value, { scope = "local" })
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
M.create_winbar = function()
|
||||
vim.api.nvim_create_augroup("_winbar", {})
|
||||
if vim.fn.has "nvim-0.8" == 1 then
|
||||
vim.api.nvim_create_autocmd(
|
||||
{ "CursorMoved", "CursorHold", "BufWinEnter", "BufFilePost", "InsertEnter", "BufWritePost", "TabClosed" },
|
||||
{
|
||||
group = "_winbar",
|
||||
callback = function()
|
||||
local status_ok, _ = pcall(vim.api.nvim_buf_get_var, 0, "lsp_floating_window")
|
||||
if not status_ok then
|
||||
require("user.winbar").get_winbar()
|
||||
end
|
||||
end,
|
||||
}
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
M.create_winbar()
|
||||
|
||||
return M
|
||||
exclude_filetype = {
|
||||
'help',
|
||||
'startify',
|
||||
'dashboard',
|
||||
'packer',
|
||||
'neogitstatus',
|
||||
'NvimTree',
|
||||
'Trouble',
|
||||
'alpha',
|
||||
'lir',
|
||||
'Outline',
|
||||
'spectre_panel',
|
||||
'toggleterm',
|
||||
'qf',
|
||||
}
|
||||
})
|
||||
|
||||
@ -7,7 +7,6 @@ zen_mode.setup {
|
||||
window = {
|
||||
backdrop = 1,
|
||||
height = 0.9,
|
||||
-- width = 0.5,
|
||||
width = 80,
|
||||
options = {
|
||||
signcolumn = "no",
|
||||
@ -15,8 +14,6 @@ zen_mode.setup {
|
||||
relativenumber = false,
|
||||
cursorline = true,
|
||||
cursorcolumn = false, -- disable cursor column
|
||||
-- foldcolumn = "0", -- disable fold column
|
||||
-- list = false, -- disable whitespace characters
|
||||
},
|
||||
},
|
||||
plugins = {
|
||||
@ -25,7 +22,6 @@ zen_mode.setup {
|
||||
twilight = { enabled = false },
|
||||
},
|
||||
on_open = function()
|
||||
require("lsp-inlayhints").toggle()
|
||||
vim.g.cmp_active = false
|
||||
vim.cmd [[LspStop]]
|
||||
local status_ok, _ = pcall(vim.api.nvim_set_option_value, "winbar", nil, { scope = "local" })
|
||||
@ -37,7 +33,6 @@ zen_mode.setup {
|
||||
end
|
||||
end,
|
||||
on_close = function()
|
||||
require("lsp-inlayhints").toggle()
|
||||
vim.g.cmp_active = true
|
||||
vim.cmd [[LspStart]]
|
||||
require("user.winbar").create_winbar()
|
||||
|
||||
21
.config/nvim/lua/user/zk.lua
Normal file
21
.config/nvim/lua/user/zk.lua
Normal file
@ -0,0 +1,21 @@
|
||||
require("zk").setup({
|
||||
-- can be "telescope", "fzf" or "select" (`vim.ui.select`)
|
||||
-- it's recommended to use "telescope" or "fzf"
|
||||
picker = "telescope",
|
||||
|
||||
lsp = {
|
||||
-- `config` is passed to `vim.lsp.start_client(config)`
|
||||
config = {
|
||||
cmd = { "zk", "lsp" },
|
||||
name = "zk",
|
||||
-- on_attach = ...
|
||||
-- etc, see `:h vim.lsp.start_client()`
|
||||
},
|
||||
|
||||
-- automatically attach buffers in a zk notebook that match the given filetypes
|
||||
auto_attach = {
|
||||
enabled = true,
|
||||
filetypes = { "markdown" },
|
||||
},
|
||||
},
|
||||
})
|
||||
@ -1,137 +0,0 @@
|
||||
let mapleader ="="
|
||||
|
||||
if ! filereadable(system('echo -n "${XDG_CONFIG_HOME:-$HOME/.config}/nvim/autoload/plug.vim"'))
|
||||
echo "Downloading junegunn/vim-plug to manage plugins..."
|
||||
silent !mkdir -p ${XDG_CONFIG_HOME:-$HOME/.config}/nvim/autoload/
|
||||
silent !curl "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim" > ${XDG_CONFIG_HOME:-$HOME/.config}/nvim/autoload/plug.vim
|
||||
autocmd VimEnter * PlugInstall
|
||||
endif
|
||||
|
||||
call plug#begin(system('echo -n "${XDG_CONFIG_HOME:-$HOME/.config}/nvim/plugged"'))
|
||||
Plug 'tpope/vim-surround'
|
||||
Plug 'preservim/nerdtree'
|
||||
Plug 'junegunn/goyo.vim'
|
||||
Plug 'jreybert/vimagit'
|
||||
Plug 'vimwiki/vimwiki'
|
||||
Plug 'vim-airline/vim-airline'
|
||||
Plug 'tpope/vim-commentary'
|
||||
Plug 'ap/vim-css-color'
|
||||
call plug#end()
|
||||
|
||||
set title
|
||||
set bg=light
|
||||
set go=a
|
||||
set mouse=a
|
||||
set nohlsearch
|
||||
set clipboard+=unnamedplus
|
||||
set noshowmode
|
||||
set noruler
|
||||
set laststatus=0
|
||||
set noshowcmd
|
||||
|
||||
" Some basics:
|
||||
nnoremap c "_c
|
||||
set nocompatible
|
||||
filetype plugin on
|
||||
syntax on
|
||||
set encoding=utf-8
|
||||
set number relativenumber
|
||||
" Enable autocompletion:
|
||||
set wildmode=longest,list,full
|
||||
" Disables automatic commenting on newline:
|
||||
autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o
|
||||
" Perform dot commands over visual blocks:
|
||||
vnoremap . :normal .<CR>
|
||||
" Goyo plugin makes text more readable when writing prose:
|
||||
map <leader>f :Goyo \| set bg=light \| set linebreak<CR>
|
||||
" Spell-check set to <leader>o, 'o' for 'orthography':
|
||||
map <leader>o :setlocal spell! spelllang=en_us<CR>
|
||||
" Splits open at the bottom and right, which is non-retarded, unlike vim defaults.
|
||||
set splitbelow splitright
|
||||
|
||||
" Nerd tree
|
||||
map <leader>n :NERDTreeToggle<CR>
|
||||
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
|
||||
if has('nvim')
|
||||
let NERDTreeBookmarksFile = stdpath('data') . '/NERDTreeBookmarks'
|
||||
else
|
||||
let NERDTreeBookmarksFile = '~/.vim' . '/NERDTreeBookmarks'
|
||||
endif
|
||||
|
||||
" Shortcutting split navigation, saving a keypress:
|
||||
map <C-h> <C-w>h
|
||||
map <C-j> <C-w>j
|
||||
map <C-k> <C-w>k
|
||||
map <C-l> <C-w>l
|
||||
|
||||
" Add C-c and C-p to get stuff in and out of + buffer (if using gvim)
|
||||
vnoremap <C-c> "+y
|
||||
map <C-p> "+p
|
||||
|
||||
" Replace ex mode with gq
|
||||
map Q gq
|
||||
|
||||
" Check file in shellcheck:
|
||||
map <leader>s :!clear && shellcheck -x %<CR>
|
||||
|
||||
" Replace all is aliased to S.
|
||||
nnoremap S :%s//g<Left><Left>
|
||||
|
||||
" Compile document, be it groff/LaTeX/markdown/etc.
|
||||
map <leader>c :w! \| !compiler "<c-r>%"<CR>
|
||||
|
||||
" Open corresponding .pdf/.html or preview
|
||||
map <leader>p :!opout <c-r>%<CR><CR>
|
||||
|
||||
" Runs a script that cleans out tex build files whenever I close out of a .tex file.
|
||||
autocmd VimLeave *.tex !texclear %
|
||||
|
||||
" Ensure files are read as what I want:
|
||||
let g:vimwiki_ext2syntax = {'.Rmd': 'markdown', '.rmd': 'markdown','.md': 'markdown', '.markdown': 'markdown', '.mdown': 'markdown'}
|
||||
map <leader>v :VimwikiIndex<CR>
|
||||
let g:vimwiki_list = [{'path': '~/.local/share/nvim/vimwiki', 'syntax': 'markdown', 'ext': '.md'}]
|
||||
autocmd BufRead,BufNewFile /tmp/calcurse*,~/.calcurse/notes/* set filetype=markdown
|
||||
autocmd BufRead,BufNewFile *.ms,*.me,*.mom,*.man set filetype=groff
|
||||
autocmd BufRead,BufNewFile *.tex set filetype=tex
|
||||
|
||||
" Save file as sudo on files that require root permission
|
||||
cnoremap w!! execute 'silent! write !sudo tee % >/dev/null' <bar> edit!
|
||||
|
||||
" Automatically deletes all trailing whitespace and newlines at end of file on save. & reset cursor position
|
||||
autocmd BufWritePre * let currPos = getpos(".")
|
||||
autocmd BufWritePre * %s/\s\+$//e
|
||||
autocmd BufWritePre * %s/\n\+\%$//e
|
||||
autocmd BufWritePre *.[ch] %s/\%$/\r/e
|
||||
autocmd BufWritePre * cal cursor(currPos[1], currPos[2])
|
||||
|
||||
" When shortcut files are updated, renew bash and ranger configs with new material:
|
||||
autocmd BufWritePost bm-files,bm-dirs !shortcuts
|
||||
" Run xrdb whenever Xdefaults or Xresources are updated.
|
||||
autocmd BufRead,BufNewFile Xresources,Xdefaults,xresources,xdefaults set filetype=xdefaults
|
||||
autocmd BufWritePost Xresources,Xdefaults,xresources,xdefaults !xrdb %
|
||||
" Recompile xmonad on edit, also on xmobar edits
|
||||
autocmd BufWritePost ~/.xmonad/xmonad.hs,~/.config/xmobar/xmobar-main.hs,~/.config/xmobar/xmobar-sub.hs,~/.config/xmobar/xmobar-single.hs !xmonad --recompile && xmonad --restart
|
||||
|
||||
" Turns off highlighting on the bits of code that are changed, so the line that is changed is highlighted but the actual text that has changed stands out on the line and is readable.
|
||||
if &diff
|
||||
highlight! link DiffText MatchParen
|
||||
endif
|
||||
|
||||
" Function for toggling the bottom statusbar:
|
||||
let s:hidden_all = 0
|
||||
function! ToggleHiddenAll()
|
||||
if s:hidden_all == 0
|
||||
let s:hidden_all = 1
|
||||
set noshowmode
|
||||
set noruler
|
||||
set laststatus=0
|
||||
set noshowcmd
|
||||
else
|
||||
let s:hidden_all = 0
|
||||
set showmode
|
||||
set ruler
|
||||
set laststatus=2
|
||||
set showcmd
|
||||
endif
|
||||
endfunction
|
||||
nnoremap <leader>h :call ToggleHiddenAll()<CR>
|
||||
@ -55,7 +55,9 @@ alias \
|
||||
# Alias tmux commands for ease of use
|
||||
alias \
|
||||
tmn="tmux new" \
|
||||
tma="tmux attach"
|
||||
tma="tmux-worker" \
|
||||
tms="tmux-sessioniser" \
|
||||
tm.="tmux-sessioniser \"$(pwd)\""
|
||||
|
||||
# Alias some extra things for ease of use
|
||||
alias \
|
||||
|
||||
@ -45,6 +45,7 @@ export QT_QPA_PLATFORMTHEME="gtk2" # Have QT use gtk2 theme.
|
||||
export MOZ_USE_XINPUT2="1" # Mozilla smooth scrolling/touchpads.
|
||||
export AWT_TOOLKIT="MToolkit wmname LG3D" #May have to install wmname
|
||||
export _JAVA_AWT_WM_NONREPARENTING=1 # Fix for Java applications in dwm
|
||||
export ZK_NOTEBOOK_DIR="$HOME/notes"
|
||||
|
||||
# This is the list for lf icons:
|
||||
export LF_ICONS="di=:\
|
||||
|
||||
8
.config/tmux/tmux.conf
Normal file
8
.config/tmux/tmux.conf
Normal file
@ -0,0 +1,8 @@
|
||||
set -ga terminal-overrides ",xterm-256color*:Tc"
|
||||
set -s escape-time 0
|
||||
|
||||
bind r source-file ~/.tmux.conf
|
||||
|
||||
# forget the find window. That is for chumps
|
||||
bind-key -r f run-shell "tmux neww tmux-sessionizer"
|
||||
bind-key -r i run-shell "tmux neww cht.sh"
|
||||
@ -12,14 +12,14 @@ else
|
||||
HOST=$(hostname)
|
||||
fi
|
||||
|
||||
if [ "$HOST" == "archmetabox" ] ; then
|
||||
if [ "$HOST" = "archmetabox" ] ; then
|
||||
# this is specifically for the laptop so check hostname
|
||||
xrandr --setprovideroutputsource modesetting NVIDIA-G0
|
||||
xrandr --auto
|
||||
fi
|
||||
|
||||
# start gnome keyring to, used to be done by login manager.
|
||||
eval $(gnome-keyring-daemon --start)
|
||||
eval "$(gnome-keyring-daemon --start)"
|
||||
export SSH_AUTH_SOCK
|
||||
|
||||
# My default is still xmonad, maybe dwm in future?
|
||||
@ -32,7 +32,7 @@ case $session in
|
||||
dwmblocks &
|
||||
exec dwm;;
|
||||
xmonad)
|
||||
exec $HOME/.xmonad/start-xmonad.sh;;
|
||||
exec "$HOME/.xmonad/start-xmonad.sh";;
|
||||
# No known session, try to run it as command
|
||||
*)
|
||||
exec twm;;
|
||||
|
||||
@ -14,7 +14,7 @@ Config {
|
||||
-- layout
|
||||
, sepChar = "%" -- delineator between plugin names and straight text
|
||||
, alignSep = "}{" -- separator between left-right alignment
|
||||
, template = "<action=`xdotool key super+a`><icon=haskell_20.xpm/></action> %bat% <fc=#bd93f9>%cpu% %memory%</fc> <action=`nm-connection-editor`>%network%</action> <action=`toggle-sink-mute`>%volume%</action> <fc=#6272a4>|</fc> %UnsafeStdinReader% }{ %keyboard% <fc=#6272a4>|</fc> %disk% <fc=#6272a4>|</fc> %date% <fc=#6272a4>|</fc> %weather% <fc=#6272a4>|</fc> %updates% %trayerpad%"
|
||||
, template = "<action=`xdotool key super+a`><icon=haskell_20.xpm/></action> %bat% <fc=#bd93f9>%cpu% %memory%</fc> <action=`nm-connection-editor`>%network%</action> <action=`toggle-sink-mute`>%volume%</action> <fc=#6272a4>|</fc> %UnsafeStdinReader% }{ %keyboard% <fc=#6272a4>|</fc> %disk% <fc=#6272a4>|</fc> %date% <fc=#6272a4>|</fc> %updates% %trayerpad%"
|
||||
|
||||
-- general behavior
|
||||
, lowerOnStart = True -- send to bottom of window stack on start
|
||||
|
||||
@ -43,7 +43,7 @@ ZSH_THEME="inkletblotsh"
|
||||
plugins=(git
|
||||
battery
|
||||
git-flow
|
||||
git-prompt)
|
||||
git-prompt vi-mode)
|
||||
|
||||
source $ZSH/oh-my-zsh.sh
|
||||
|
||||
|
||||
1
.tmux.conf
Symbolic link
1
.tmux.conf
Symbolic link
@ -0,0 +1 @@
|
||||
.config/tmux/tmux.conf
|
||||
@ -73,7 +73,6 @@ import XMonad.Util.SpawnOnce
|
||||
isLaptop :: Bool
|
||||
isLaptop = True
|
||||
|
||||
|
||||
--THEME
|
||||
-- Currently Dracula
|
||||
colorBackground :: String
|
||||
@ -112,7 +111,6 @@ colorRed = "#ff5555"
|
||||
colorYellow :: String
|
||||
colorYellow = "#f1fa8c"
|
||||
|
||||
|
||||
-- The preferred terminal program, which is used in a binding below and by
|
||||
-- certain contrib modules.
|
||||
myTerminal :: String
|
||||
@ -124,6 +122,9 @@ myFileManager = "thunar"
|
||||
myBrowser :: String
|
||||
myBrowser = "firefox"
|
||||
|
||||
myEditor :: String
|
||||
myEditor = "nvim"
|
||||
|
||||
-- The font to be used
|
||||
myFont :: String
|
||||
myFont = "xft:Fira Code:antialias=true:hinting=true"
|
||||
@ -138,7 +139,7 @@ myClickJustFocuses = False
|
||||
|
||||
-- Width of the window border in pixels.
|
||||
myBorderWidth :: Dimension
|
||||
myBorderWidth = 3
|
||||
myBorderWidth = 0
|
||||
|
||||
-- Border colors for unfocused and focused windows, respectively.
|
||||
myNormalBorderColor :: String
|
||||
@ -173,7 +174,7 @@ myWorkspaces :: [String]
|
||||
|
||||
|
||||
-- myWorkspaces = [" 1 ", " 2 ", " 3 ", " 4 ", " 5 ", " 6 ", " 7 ", " 8 ", " 9 "]
|
||||
myWorkspaces = ["web", "game", "dev", "doc", "mus", "vid", "sys", "chat", "mail"]
|
||||
myWorkspaces = ["web", "term", "dev", "doc", "task", "media", "sys", "chat", "mail"]
|
||||
myWorkspaceIndices = M.fromList $ zip myWorkspaces [1..] -- (,) == \x y -> (x,y)
|
||||
|
||||
clickable ws = "<action=xdotool key super+"++show i++">"++ws++"</action>"
|
||||
@ -221,7 +222,7 @@ myAppGrid = [ ("Runelite", "runelite")
|
||||
, ("Slack", "slack")
|
||||
, ("Steam", "steam")
|
||||
, ("Gimp", "gimp")
|
||||
, ("Blueman Manager", "blueman-manager")
|
||||
, ("Blueberry", "blueberry")
|
||||
, ("LibreOffice Impress", "loimpress")
|
||||
, ("LibreOffice Calc", "localc")
|
||||
, ("LibreOffice Writer", "lowriter")
|
||||
@ -271,7 +272,6 @@ myScratchPads = [ NS "terminal" spawnTerm findTerm manageTerm
|
||||
t = 0.75 -h
|
||||
l = 0.70 -w
|
||||
|
||||
|
||||
------------------------------------------------------------------------
|
||||
-- Key bindings. Add, modify or remove key bindings here.
|
||||
-- These are general keybindings custom script bindings are not included.h
|
||||
@ -287,8 +287,11 @@ myStandardEZKeys =
|
||||
, ("M-a", spawn "dmenu_run -bw 3 -c -l 15 -h 26") -- open dmenu
|
||||
|
||||
--NOTE keybound programs
|
||||
, ("M-S-<Return>", spawn (myTerminal)) -- open a terminal
|
||||
, ("M-l", spawn (myFileManager)) -- open a file manager
|
||||
, ("M-S-<Return>", spawn (myTerminal ++ " -e " ++ "tmux-worker")) -- open a terminal with system tmux session
|
||||
, ("M-C-S-<Return>", spawn (myTerminal)) -- open a terminal
|
||||
, ("M-e", spawn (myFileManager)) -- open a file manager
|
||||
, ("M-S-e", spawn (myTerminal ++ " -e " ++ "lfub")) -- launch lf in alacritty
|
||||
, ("M-i", spawn (myTerminal ++ " -e " ++ myEditor)) -- launch vim in alacritty
|
||||
|
||||
--NOTE file manager bindings
|
||||
, ("C-l l", spawn (myFileManager)) -- open file manager
|
||||
@ -299,22 +302,24 @@ myStandardEZKeys =
|
||||
, ("C-l d", spawn (myFileManager ++ " $HOME/Downloads")) -- open downloads
|
||||
|
||||
--NOTE wm controls
|
||||
, ("M-/ d", spawn ("setxkbmap dvorak")) -- switch keyboard to dvorak input
|
||||
, ("M-/ u", spawn ("setxkbmap us")) -- switch keyboard to us input
|
||||
, ("M-/ d", spawn ("switchkb dvorak $HOME/.config/x11/.Xmodmap")) -- switch keyboard to dvorak input
|
||||
, ("M-/ u", spawn ("switchkb us $HOME/.config/x11/.Xmodmap")) -- switch keyboard to us input
|
||||
, ("M-'", kill1) -- kill focused windown
|
||||
, ("M-S-<Space>", sendMessage NextLayout) -- rotate through layouts
|
||||
-- , ("M-S-<space>", setLayout $ Xmonad.layoutHook conf) -- reset layout to default
|
||||
, ("M-<Space>", sendMessage NextLayout) -- rotate through layouts
|
||||
, ("M-S-<Space>", sendMessage FirstLayout) -- reset to default layout
|
||||
, ("M-S-y", refresh) -- reset current window to correct size
|
||||
, ("M-<Tab>", windows W.focusDown) -- focus next window
|
||||
, ("M-S-<Tab>", windows W.focusUp) -- focus previous window
|
||||
, ("M-m", windows W.focusMaster) -- focus master window
|
||||
, ("M-<Return>", windows W.swapMaster) -- swap window with master
|
||||
, ("M-S-k", windows W.swapUp) -- swap window with next window
|
||||
, ("M-S-<Down>", windows W.swapDown) -- swap window with previous window
|
||||
, ("M-S-j", windows W.swapDown) -- swap window with previous window
|
||||
, ("M-S-l", shiftTo Next nonNSP >> moveTo Next nonNSP) -- shift window to next workspace
|
||||
, ("M-S-h", shiftTo Prev nonNSP >> moveTo Prev nonNSP) -- shift window to previous workspace
|
||||
, ("M-C-l", nextScreen) -- shift view to next screen
|
||||
, ("M-C-h", prevScreen) -- shift view to previous screen
|
||||
, ("M-l", moveTo Next nonNSP) -- shift view to previous workspace
|
||||
, ("M-h", moveTo Prev nonNSP) -- shift view to previous workspace
|
||||
, ("M-C-<Right>", nextScreen) -- shift view to next screen
|
||||
, ("M-C-<Left>", prevScreen) -- shift view to previous screen
|
||||
, ("M-<Left>", sendMessage Shrink) -- shrink master area
|
||||
, ("M-<Right>", sendMessage Expand) -- grow master area
|
||||
, ("M-<Down>", sendMessage MirrorShrink) -- shrink master area
|
||||
@ -322,12 +327,13 @@ myStandardEZKeys =
|
||||
, ("M-y", withFocused $ windows . W.sink) -- push floating window back into tiling
|
||||
, ("M-w", sendMessage (IncMasterN 1)) -- increment windows in master
|
||||
, ("M-v", sendMessage (IncMasterN (-1))) -- decrement windows in master
|
||||
, ("M-S-f", sendMessage ToggleStruts) -- toggle bar
|
||||
, ("M-f", sendMessage ToggleStruts) -- toggle bar
|
||||
, ("M-S-f", spawn "screenlayout") -- pick screenlayout from $HOME/.screenlayout/
|
||||
|
||||
-- NOTE Scratchpads
|
||||
-- NOTE Toggle show/hide these programs. They run on a hidden workspace.
|
||||
-- NOTE When you toggle them to show, it brings them to your current workspace.
|
||||
-- NOTE Toggle them to hide and it sends them back to hidden workspace (NSP).
|
||||
-- NOTE Scratchpads
|
||||
-- NOTE Toggle show/hide these programs. They run on a hidden workspace.
|
||||
-- NOTE When you toggle them to show, it brings them to your current workspace.
|
||||
-- NOTE Toggle them to hide and it sends them back to hidden workspace (NSP).
|
||||
, ("M-s t", namedScratchpadAction myScratchPads "terminal")
|
||||
, ("M-s m", namedScratchpadAction myScratchPads "jellyfin")
|
||||
, ("M-s c", namedScratchpadAction myScratchPads "calculator")
|
||||
@ -432,26 +438,33 @@ mySpacing i = spacingRaw True (Border i i i i) True (Border i i i i) True
|
||||
-- mySpacing n sets the gap size around the windows.
|
||||
tall = renamed [Replace "tall"]
|
||||
$ limitWindows 12
|
||||
$ mySpacing 8
|
||||
$ mySpacing 2
|
||||
-- $ Mirror
|
||||
$ ResizableTall 1 (3/100) (1/2) []
|
||||
wide = renamed [Replace "wide"]
|
||||
$ limitWindows 12
|
||||
$ mySpacing 2
|
||||
$ Mirror
|
||||
$ ResizableTall 1 (3/100) (1/2) []
|
||||
monocle = renamed [Replace "monocle"]
|
||||
$ limitWindows 20 Full
|
||||
floats = renamed [Replace "floats"]
|
||||
$ limitWindows 20 simplestFloat
|
||||
grid = renamed [Replace "grid"]
|
||||
$ limitWindows 12
|
||||
$ mySpacing 8
|
||||
$ mySpacing 2
|
||||
$ mkToggle (single MIRROR)
|
||||
$ Grid (16/10)
|
||||
spirals = renamed [Replace "spirals"]
|
||||
$ mySpacing 8
|
||||
$ mySpacing 2
|
||||
$ spiral (6/7)
|
||||
threeCol = renamed [Replace "threeCol"]
|
||||
$ limitWindows 7
|
||||
$ mySpacing 2
|
||||
$ ThreeCol 1 (3/100) (1/2)
|
||||
threeRow = renamed [Replace "threeRow"]
|
||||
$ limitWindows 7
|
||||
$ mySpacing 2
|
||||
-- Mirror takes a layout and rotates it by 90 degrees.
|
||||
-- So we are applying Mirror to the ThreeCol layout.
|
||||
$ Mirror
|
||||
@ -490,13 +503,13 @@ myLayout = avoidStruts $ mouseResize $ windowArrange $ T.toggleLayouts floats
|
||||
-- I've commented out the layouts I don't use.
|
||||
myDefaultLayout =
|
||||
tall
|
||||
||| wide
|
||||
||| noBorders monocle
|
||||
||| noBorders tabs
|
||||
-- unused layouts
|
||||
-- ||| spirals
|
||||
-- ||| grid
|
||||
-- ||| floats
|
||||
-- ||| threeRow
|
||||
-- ||| threeCol
|
||||
|
||||
|
||||
@ -530,11 +543,12 @@ myManageHook = composeAll
|
||||
, className =? "MusicBrainz Picard" --> doIgnore
|
||||
, className =? "Steam" --> doShift ( myWorkspaces !! (7-1) )
|
||||
, className =? "discord" --> doShift ( myWorkspaces !! (8-1) )
|
||||
, className =? "telegram-desktop" --> doShift ( myWorkspaces !! (8-1) )
|
||||
, className =? "TelegramDesktop" --> doShift ( myWorkspaces !! (8-1) )
|
||||
, className =? "slack" --> doShift ( myWorkspaces !! (8-1) )
|
||||
, className =? "Pavucontrol" --> doShift ( myWorkspaces !! (5-1) )
|
||||
, className =? "plexamp" --> doShift ( myWorkspaces !! (5-1) )
|
||||
, className =? "Jellyfin Media Player" --> doShift ( myWorkspaces !! (5-1) )
|
||||
, className =? "Pavucontrol" --> doShift ( myWorkspaces !! (6-1) )
|
||||
, className =? "plexamp" --> doShift ( myWorkspaces !! (6-1) )
|
||||
, className =? "Jellyfin Media Player" --> doShift ( myWorkspaces !! (7-1) )
|
||||
, className =? "thunderbird" --> doShift ( myWorkspaces !! (9-1) )
|
||||
]
|
||||
|
||||
------------------------------------------------------------------------
|
||||
@ -565,7 +579,7 @@ myLogHook = fadeInactiveLogHook fadeAmount
|
||||
myStartupHook = do
|
||||
-- System apps also in .xprofile
|
||||
spawnOnce "setxkbmap us &"
|
||||
spawnOnce "$HOME/.screenlayout/normal_3_screens.sh"
|
||||
spawnOnce "$HOME/.screenlayout/default.sh"
|
||||
spawnOnce "picom --experimental-backend &"
|
||||
spawnOnce "numlockx"
|
||||
spawnOnce "xsetroot -cursor_name left_ptr"
|
||||
@ -575,7 +589,7 @@ myStartupHook = do
|
||||
spawnOnce "source $HOME/.config/shell/profile"
|
||||
|
||||
-- Startup apps (tray) and settings
|
||||
spawnOnce "blueman-applet &"
|
||||
spawnOnce "blueberry-tray &"
|
||||
spawnOnce "/usr/lib/kdeconnectd &"
|
||||
spawnOnce "kdeconnect-indicator &"
|
||||
spawnOnce "dunst &" -- notification daemon
|
||||
|
||||
Loading…
Reference in New Issue
Block a user