big changes to lf, neovim (now actually working mostly), and the addition of tmux

This commit is contained in:
Solomon Laing 2022-10-05 09:35:45 +10:30
parent b5fe43b9af
commit 293fe557bb
62 changed files with 1134 additions and 2661 deletions

View File

@ -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>

View File

@ -31,6 +31,7 @@ set previewer '~/.config/lf/scope'
# cmds/functions
cmd open ${{
case $(file --mime-type "$(readlink -f $f)" -b) in
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;;
@ -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"

View File

@ -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"

View File

@ -1,45 +1,18 @@
local status_ok, alpha = pcall(require, "alpha")
if not status_ok then
local s_ok, alpha = pcall(require, "alpha")
if not s_ok then
return
end
local dashboard = require"alpha.themes.dashboard"
local function button(sc, txt, keybind, keybind_opts)
local b = dashboard.button(sc, txt, keybind, keybind_opts)
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 = {
-- [[ ▟▙ ]],
-- [[ ▝▘ ]],
-- [[ ██▃▅▇█▆▖ ▗▟████▙▖ ▄████▄ ██▄ ▄██ ██ ▗▟█▆▄▄▆█▙▖]],
-- [[ ██▛▔ ▝██ ██▄▄▄▄██ ██▛▔▔▜██ ▝██ ██▘ ██ ██▛▜██▛▜██]],
-- [[ ██ ██ ██▀▀▀▀▀▘ ██▖ ▗██ ▜█▙▟█▛ ██ ██ ██ ██]],
-- [[ ██ ██ ▜█▙▄▄▄▟▊ ▀██▙▟██▀ ▝████▘ ██ ██ ██ ██]],
-- [[ ▀▀ ▀▀ ▝▀▀▀▀▀ ▀▀▀▀ ▀▀ ▀▀ ▀▀ ▀▀ ▀▀]],
-- }
-- ▄▀▀▄ ▀▄ ▄▀▀█▄▄▄▄ ▄▀▀▀▀▄ ▄▀▀▄ ▄▀▀▄ ▄▀▀█▀▄ ▄▀▀▄ ▄▀▄
-- █ █ █ █ ▐ ▄▀ ▐ █ █ █ █ █ █ █ █ █ █ ▀ █
-- ▐ █ ▀█ █▄▄▄▄▄ █ █ ▐ █ █ ▐ █ ▐ ▐ █ █
-- █ █ █ ▌ ▀▄ ▄▀ █ ▄▀ █ █ █
-- ▄▀ █ ▄▀▄▄▄▄ ▀▀▀▀ ▀▄▀ ▄▀▀▀▀▀▄ ▄▀ ▄▀
-- █ ▐ █ ▐ █ █ █ █
-- ▐ ▐ ▐ ▐ ▐ ▐
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)

View 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
]]

View File

@ -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
]]

View File

@ -1,4 +1,3 @@
-- Setup nvim-cmp.
local status_ok, npairs = pcall(require, "nvim-autopairs")
if not status_ok then
return
@ -12,8 +11,9 @@ npairs.setup {
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 = "<M-e>",
map = "<C-e>",
chars = { "{", "[", "(", '"', "'" },
pattern = string.gsub([[ [%'%"%)%>%]%)%}%,] ]], "%s+", ""),
offset = 0, -- Offset from pattern match

View File

@ -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)

View File

@ -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 = {

View File

@ -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()

View File

@ -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!")
local s_ok, _ = pcall(vim.cmd, "colorscheme " .. colorscheme)
if not s_ok then
vim.notify("Colorscheme" .. colorscheme .. " not found!")
return
end

View File

@ -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
},
},
},
}

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -1,11 +0,0 @@
require('illuminate').configure({
providers = {
'lsp',
'treesitter',
'regex',
},
delay = 100,
filetypes_denylist = {
'alpha',
},
})

View File

@ -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",
-- },
}

View File

@ -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)

View File

@ -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",
},
}

View File

@ -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,
}

View File

@ -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()

View File

@ -6,35 +6,15 @@ if not status_ok then
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
end

View File

@ -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

View File

@ -14,10 +14,10 @@ local servers = {
"emmet_ls",
"html",
"jdtls",
"jsonls",
"solc",
"solidity_ls",
"sumneko_lua",
"omnisharp",
"tflint",
"terraformls",
"tsserver",
@ -67,11 +67,6 @@ for _, server in pairs(servers) do
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)
@ -144,6 +139,11 @@ for _, server in pairs(servers) do
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

View File

@ -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)

View File

@ -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,
-- },
},
},
}

View 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"
}
}

View File

@ -1,5 +1,5 @@
return {
cmd = { "py" },
cmd = { "pyright" },
settings = {
python = {
analysis = {

View File

@ -0,0 +1 @@
return {}

View File

@ -8,27 +8,6 @@ local colors = {
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
@ -70,7 +49,7 @@ end
require('lualine').setup {
options = {
theme = 'gruvbox-material',
theme = 'gruvbox',
component_separators = '',
section_separators = { left = '', right = '' },
},

View File

@ -1,3 +0,0 @@
-- vim.g.matchup_enabled = 0
vim.g.matchup_matchparen_offscreen = { method = nil }
vim.g.matchup_matchpref = { html = { nolists = 1 } }

View File

@ -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 .. " ",

View File

@ -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)

View File

@ -16,34 +16,15 @@ 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,
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,
@ -108,14 +89,6 @@ nvim_tree.setup {
update_cwd = true,
ignore_list = {},
},
-- system_open = {
-- cmd = nil,
-- args = {},
-- },
-- filters = {
-- dotfiles = false,
-- custom = {},
-- },
git = {
enable = true,
ignore = true,
@ -123,10 +96,8 @@ nvim_tree.setup {
},
view = {
width = 30,
height = 30,
hide_root_folder = false,
side = "left",
-- auto_resize = true,
mappings = {
custom_only = false,
list = {
@ -138,4 +109,9 @@ nvim_tree.setup {
number = false,
relativenumber = false,
},
actions = {
open_file = {
quit_on_open = true,
}
}
}

View File

@ -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",
},
}

View File

@ -1,58 +1,46 @@
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
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 = 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
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, -- 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
relativenumber = true,
numberwidth = 2,
signcolumn = "yes",
wrap = false,
scrolloff = 8,
sidescrolloff = 8,
guifont = "monospace:h17", -- the font used in graphical neovim applications
guifont = "monospace:h17",
title = true,
-- colorcolumn = "80",
-- colorcolumn = "120",
}
-- 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
@ -60,4 +48,5 @@ for k, v in pairs(options) do
end
vim.cmd "set whichwrap+=<,>,[,],h,l"
vim.cmd "set colorcolumn=80"
vim.cmd [[set iskeyword+=-]]

View File

@ -2,7 +2,6 @@ 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",
@ -12,11 +11,11 @@ if fn.empty(fn.glob(install_path)) > 0 then
"https://github.com/wbthomason/packer.nvim",
install_path,
}
print "Installing packer close and reopen Neovim..."
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!
@ -24,114 +23,102 @@ vim.cmd [[
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
-- 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.
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 used ny lots of plugins
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/nvim-lsp-installer" -- simple to use language server installer
use "williamboman/mason.nvim"
use "williamboman/mason.nvim" -- language server manager/installer
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 "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"
use "hrsh7th/nvim-cmp" -- completion engine
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-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 bunch of snippets to use
use "rafamadriz/friendly-snippets" -- a collection of useful snippets
-- 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"
-- CEO of The Startup
use "ThePrimeagen/harpoon"
-- Fuzzy Finder/Telescope
-- Telescopic Johnston
use "nvim-telescope/telescope.nvim"
use "nvim-telescope/telescope-media-files.nvim"
-- Note Taking
use "mickael-menu/zk-nvim"
-- Color
-- Colour
use "NvChad/nvim-colorizer.lua"
use "ziontee113/color-picker.nvim"
-- Colorschemes
use "folke/tokyonight.nvim"
use "sainnhe/gruvbox-material"
use 'RRethy/nvim-base16'
use "sainnhe/sonokai"
use "dracula/vim"
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 "stevearc/dressing.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
-- Icons
use "kyazdani42/nvim-web-devicons"
-- Debugging
use "mfussenegger/nvim-dap"
use "rcarriga/nvim-dap-ui"
-- Also add later.
-- Tabline
use "akinsho/bufferline.nvim"
use "tiagovla/scope.nvim"
use "fgheng/winbar.nvim"
-- Statusline
use "christianchiarulli/lualine.nvim"
use "nvim-lualine/lualine.nvim"
-- Startup
use "goolord/alpha-nvim"
@ -141,61 +128,36 @@ return packer.startup(function(use)
-- File Explorer
use "kyazdani42/nvim-tree.lua"
-- use "christianchiarulli/lir.nvim"
-- use "preservim/nerdtree"
-- Comment
-- Comments
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 "vimwiki/vimwiki"
use "folke/zen-mode.nvim"
use "karb94/neoscroll.nvim"
use "junegunn/vim-slash"
use 'vimwiki/vimwiki'
-- Motion
-- use "phaazon/hop.nvim"
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"
-- 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
-- Automatically setup after cloning packer.nvim
if PACKER_BOOTSTRAP then
require("packer").sync()
end

View File

@ -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')

View File

@ -1 +0,0 @@
require("scope").setup()

View File

@ -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']]

View File

@ -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
}

View File

@ -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,

View File

@ -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
},
}

View File

@ -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 })

View File

@ -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,

View File

@ -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.

View File

@ -1 +0,0 @@
vim.cmd [[noremap <plug>(slash-after) zz]]

View File

@ -23,16 +23,9 @@ local setup = {
g = true, -- bindings for prefixed with g
},
},
-- 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
@ -40,8 +33,8 @@ local setup = {
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
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
@ -59,8 +52,6 @@ local setup = {
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
@ -89,53 +80,27 @@ local m_opts = {
}
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" },
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" },
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" },
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" },
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" },
w = { "<cmd>w<CR>", "Write" },
-- h = { "<cmd>nohlsearch<CR>", "No HL" },
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" },
-- :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" },
},
["'"] = { '<cmd>close<CR>', "Close split" },
b = {
name = "Buffer",
@ -173,18 +138,19 @@ local mappings = {
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" },
},
-- 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",
@ -228,19 +194,17 @@ local mappings = {
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" },
a = { "<cmd>CodeActionMenu<cr>", "Code Action" },
d = { "<cmd>TroubleToggle document_diagnostics<cr>", "Diagnostics" },
D = { "<cmd>lua vim.lsp.buf.definition()<cr>", "Definition" },
w = {
"<cmd>Telescope lsp_workspace_diagnostics<cr>",
"<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" },
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>",
@ -253,7 +217,6 @@ local mappings = {
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" },
@ -265,40 +228,16 @@ local mappings = {
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" },
},
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" },
},
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" },
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 size=10 direction=horizontal<cr>", "Horizontal" },
v = { "<cmd>ToggleTerm size=80 direction=vertical<cr>", "Vertical" },
h = { "<cmd>ToggleTerm direction=horizontal<cr>", "Horizontal" },
},
T = {
@ -307,6 +246,12 @@ local mappings = {
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 = {
@ -317,10 +262,9 @@ local vopts = {
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" },
}
which_key.setup(setup)

View File

@ -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
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
M.get_winbar = function()
if excludes() then
return
end
local f = require "user.functions"
local value = M.get_filename()
if not f.isempty(value) and f.get_buf_option "mod" then
local mod = "%#LspCodeLens#" .. require("user.icons").ui.Circle .. "%*"
value = value .. mod
end
local num_tabs = #vim.api.nvim_list_tabpages()
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" })
local status_ok, winbar = pcall(require, "winbar")
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,
winbar.setup({
enabled = true,
show_file_path = true,
show_symbols = true,
colors = {
path = '', -- You can customize colors like #c946fd
file_name = '',
symbols = '',
},
icons = {
file_icon_default = '',
seperator = '>',
editor_state = '',
lock_icon = '',
},
exclude_filetype = {
'help',
'startify',
'dashboard',
'packer',
'neogitstatus',
'NvimTree',
'Trouble',
'alpha',
'lir',
'Outline',
'spectre_panel',
'toggleterm',
'qf',
}
)
end
end
M.create_winbar()
return M
})

View File

@ -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()

View 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" },
},
},
})

View File

@ -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>

View File

@ -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 \

View File

@ -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
View 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"

View File

@ -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;;

View File

@ -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

View File

@ -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
View File

@ -0,0 +1 @@
.config/tmux/tmux.conf

View File

@ -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,7 +327,8 @@ 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.
@ -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