From 387e08c52d9752bc839c71119f140ba8435c3d70 Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Fri, 18 Aug 2023 23:42:39 +0300 Subject: nvim: switch to lazy.nvim revert this as whole, if you miss the good old days --- .config/nvim/after/ftplugin/java.vim | 1 - .config/nvim/after/ftplugin/ledger.vim | 3 - .config/nvim/after/ftplugin/tex.vim | 22 - .config/nvim/init.lua | 23 +- .config/nvim/lazy-lock.json | 52 ++ .config/nvim/lua/au.lua | 50 -- .config/nvim/lua/autocmds.lua | 67 --- .config/nvim/lua/core/keymaps.lua | 77 +++ .config/nvim/lua/core/lazy.lua | 30 + .config/nvim/lua/core/options.lua | 98 +++ .config/nvim/lua/functions.lua | 24 - .config/nvim/lua/helpers/keys.lua | 21 + .config/nvim/lua/helpers/stale.lua | 159 +++++ .config/nvim/lua/mappings.lua | 183 ------ .config/nvim/lua/plugin_settings.lua | 722 ----------------------- .config/nvim/lua/plugins.lua | 168 ------ .config/nvim/lua/plugins/barbar.lua | 77 +++ .config/nvim/lua/plugins/cmp.lua | 114 ++++ .config/nvim/lua/plugins/colorscheme.lua | 45 ++ .config/nvim/lua/plugins/cutlass.lua | 51 ++ .config/nvim/lua/plugins/dashboard.lua | 36 ++ .config/nvim/lua/plugins/devicons.lua | 25 + .config/nvim/lua/plugins/git.lua | 95 +++ .config/nvim/lua/plugins/indent-blankline.lua | 14 + .config/nvim/lua/plugins/latex.lua | 16 + .config/nvim/lua/plugins/lsp.lua | 236 ++++++++ .config/nvim/lua/plugins/lualine.lua | 84 +++ .config/nvim/lua/plugins/misc.lua | 83 +++ .config/nvim/lua/plugins/nvim-tree.lua | 40 ++ .config/nvim/lua/plugins/telescope.lua | 45 ++ .config/nvim/lua/plugins/tpope.lua | 11 + .config/nvim/lua/plugins/treesitter.lua | 73 +++ .config/nvim/lua/plugins/trouble.lua | 14 + .config/nvim/lua/plugins/turkish-deasciifier.lua | 24 + .config/nvim/lua/plugins/vimwiki.lua | 28 + .config/nvim/lua/plugins/which-key.lua | 14 + .config/nvim/lua/settings.lua | 101 ---- .config/nvim/lua/stale.lua | 159 ----- .config/nvim/my_snippets/PKGBUILD.snippets | 5 - .config/nvim/my_snippets/all.snippets | 16 - .config/nvim/my_snippets/c.snippets | 8 - .config/nvim/my_snippets/ledger.snippets | 39 -- .config/nvim/my_snippets/mail.snippets | 5 - .config/nvim/my_snippets/markdown.snippets | 5 - .config/nvim/my_snippets/tex.snippets | 172 ------ .config/nvim/my_snippets/vimwiki.snippets | 29 - .config/nvim/neovim.cat | 13 - 47 files changed, 1571 insertions(+), 1806 deletions(-) delete mode 100644 .config/nvim/after/ftplugin/java.vim delete mode 100644 .config/nvim/after/ftplugin/ledger.vim delete mode 100644 .config/nvim/after/ftplugin/tex.vim create mode 100644 .config/nvim/lazy-lock.json delete mode 100644 .config/nvim/lua/au.lua delete mode 100644 .config/nvim/lua/autocmds.lua create mode 100644 .config/nvim/lua/core/keymaps.lua create mode 100644 .config/nvim/lua/core/lazy.lua create mode 100644 .config/nvim/lua/core/options.lua delete mode 100644 .config/nvim/lua/functions.lua create mode 100644 .config/nvim/lua/helpers/keys.lua create mode 100644 .config/nvim/lua/helpers/stale.lua delete mode 100644 .config/nvim/lua/mappings.lua delete mode 100644 .config/nvim/lua/plugin_settings.lua delete mode 100644 .config/nvim/lua/plugins.lua create mode 100644 .config/nvim/lua/plugins/barbar.lua create mode 100644 .config/nvim/lua/plugins/cmp.lua create mode 100644 .config/nvim/lua/plugins/colorscheme.lua create mode 100644 .config/nvim/lua/plugins/cutlass.lua create mode 100644 .config/nvim/lua/plugins/dashboard.lua create mode 100644 .config/nvim/lua/plugins/devicons.lua create mode 100644 .config/nvim/lua/plugins/git.lua create mode 100644 .config/nvim/lua/plugins/indent-blankline.lua create mode 100644 .config/nvim/lua/plugins/latex.lua create mode 100644 .config/nvim/lua/plugins/lsp.lua create mode 100644 .config/nvim/lua/plugins/lualine.lua create mode 100644 .config/nvim/lua/plugins/misc.lua create mode 100644 .config/nvim/lua/plugins/nvim-tree.lua create mode 100644 .config/nvim/lua/plugins/telescope.lua create mode 100644 .config/nvim/lua/plugins/tpope.lua create mode 100644 .config/nvim/lua/plugins/treesitter.lua create mode 100644 .config/nvim/lua/plugins/trouble.lua create mode 100644 .config/nvim/lua/plugins/turkish-deasciifier.lua create mode 100644 .config/nvim/lua/plugins/vimwiki.lua create mode 100644 .config/nvim/lua/plugins/which-key.lua delete mode 100644 .config/nvim/lua/settings.lua delete mode 100644 .config/nvim/lua/stale.lua delete mode 100644 .config/nvim/my_snippets/PKGBUILD.snippets delete mode 100644 .config/nvim/my_snippets/all.snippets delete mode 100644 .config/nvim/my_snippets/c.snippets delete mode 100644 .config/nvim/my_snippets/ledger.snippets delete mode 100644 .config/nvim/my_snippets/mail.snippets delete mode 100644 .config/nvim/my_snippets/markdown.snippets delete mode 100644 .config/nvim/my_snippets/tex.snippets delete mode 100644 .config/nvim/my_snippets/vimwiki.snippets delete mode 100644 .config/nvim/neovim.cat (limited to '.config/nvim') diff --git a/.config/nvim/after/ftplugin/java.vim b/.config/nvim/after/ftplugin/java.vim deleted file mode 100644 index 5441d82..0000000 --- a/.config/nvim/after/ftplugin/java.vim +++ /dev/null @@ -1 +0,0 @@ -let b:dispatch = 'javac %' diff --git a/.config/nvim/after/ftplugin/ledger.vim b/.config/nvim/after/ftplugin/ledger.vim deleted file mode 100644 index 022bcac..0000000 --- a/.config/nvim/after/ftplugin/ledger.vim +++ /dev/null @@ -1,3 +0,0 @@ -let b:dispatch = 'ledger -f ~/nextcloud/virtuals/ledger.ledger bal assets liab' -set foldmethod=expr -set foldexpr=nvim_treesitter#foldexpr() diff --git a/.config/nvim/after/ftplugin/tex.vim b/.config/nvim/after/ftplugin/tex.vim deleted file mode 100644 index 8ca7f23..0000000 --- a/.config/nvim/after/ftplugin/tex.vim +++ /dev/null @@ -1,22 +0,0 @@ -call sandwich#util#addlocal([{ - \ 'buns': ['\textbf{', '}'], - \ 'input': ['B'], -\ }]) - -call sandwich#util#addlocal([{ - \ 'buns': ['\emph{', '}'], - \ 'input': ['E'], -\ }]) - -call sandwich#util#addlocal([{ - \ 'buns': ['\texttt{', '}'], - \ 'input': ['T'], -\ }]) - -call sandwich#util#addlocal([{ - \ 'buns': ['\enquote{', '}'], - \ 'input': ['"'], -\ }]) - - -set signcolumn=yes diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 2dacd0b..c273f36 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -4,20 +4,15 @@ -- │▌ ▌▛▀ ▌ ▌▐▐ ▐ ▌▐ ▌│ -- │▘ ▘▝▀▘▝▀ ▘ ▀▘▘▝ ▘│ -- └──────────────────┘ --- ┌────────┐ --- │▜ │ --- │▐ ▌ ▌▝▀▖│ --- │▐ ▌ ▌▞▀▌│ --- │ ▘▝▀▘▝▀▘│ --- └────────┘ -require('impatient') +-- handle plugins with lazy.nvim +require("core.lazy") -require('plugins') -require('settings') -require('plugin_settings') -require('mappings') -require('autocmds') +-- general neovim keymaps +require("core.keymaps") --- personal plugins lol -require('stale').setup{} +-- other options +require("core.options") + +-- I have to clean this +require('helpers.stale').setup{} diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json new file mode 100644 index 0000000..e96ed42 --- /dev/null +++ b/.config/nvim/lazy-lock.json @@ -0,0 +1,52 @@ +{ + "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, + "LuaSnip": { "branch": "master", "commit": "c4d6298347f7707e9757351b2ee03d0c00da5c20" }, + "barbar.nvim": { "branch": "master", "commit": "8cca17ea0ced3ba564e5da972a25600edafe7d7b" }, + "catppuccin": { "branch": "main", "commit": "490078b1593c6609e6a50ad5001e7902ea601824" }, + "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" }, + "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, + "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, + "cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" }, + "dashboard-nvim": { "branch": "master", "commit": "c17d3210b3dec8798b4fc82a11c542989251f85d" }, + "dial.nvim": { "branch": "master", "commit": "c6657df5453a6cbe4e8356e1675e9652cadc332f" }, + "fidget.nvim": { "branch": "main", "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" }, + "friendly-snippets": { "branch": "main", "commit": "377d45475b49e37460a902d6d569d2093d4037d0" }, + "gitsigns.nvim": { "branch": "main", "commit": "5a2b1205841bc06ffb15719b14d54987e17b22ae" }, + "indent-blankline.nvim": { "branch": "master", "commit": "4541d690816cb99a7fc248f1486aa87f3abce91c" }, + "lazy.nvim": { "branch": "main", "commit": "dac844ed617dda4f9ec85eb88e9629ad2add5e05" }, + "leap.nvim": { "branch": "main", "commit": "5efe985cf68fac3b6a6dfe7a75fbfaca8db2af9c" }, + "ltex-extra.nvim": { "branch": "master", "commit": "9bed99b2b8488cc2daf66c76d2e0cf051ee80d13" }, + "lualine.nvim": { "branch": "master", "commit": "45e27ca739c7be6c49e5496d14fcf45a303c3a63" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "e86a4c84ff35240639643ffed56ee1c4d55f538e" }, + "mason.nvim": { "branch": "main", "commit": "b5bb138312dbd3f7729197ca659cbe5221d36a03" }, + "neodev.nvim": { "branch": "main", "commit": "47dacc6d8f74936f7719351b025421df740c789b" }, + "nvim-autopairs": { "branch": "master", "commit": "ae5b41ce880a6d850055e262d6dfebd362bb276e" }, + "nvim-cmp": { "branch": "main", "commit": "51f1e11a89ec701221877532ee1a23557d291dd5" }, + "nvim-lspconfig": { "branch": "master", "commit": "0d29cad8de3b2c654315203fc1fe12fde722a18a" }, + "nvim-surround": { "branch": "main", "commit": "0d6882635817a2677749a330127d12ac30a4f3c8" }, + "nvim-tree.lua": { "branch": "master", "commit": "18c7a3119839adc4599d838726deae662859c8b2" }, + "nvim-treesitter": { "branch": "master", "commit": "add1864bbf2d3b8e789ec6b4715bb5a4073e3b60" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "56272167a6dead91c47c02dbdbfe1ae5643c59f5" }, + "nvim-web-devicons": { "branch": "master", "commit": "cfc8824cc1db316a276b36517f093baccb8e799a" }, + "plenary.nvim": { "branch": "master", "commit": "267282a9ce242bbb0c5dc31445b6d353bed978bb" }, + "rust-tools.nvim": { "branch": "master", "commit": "0cc8adab23117783a0292a0c8a2fbed1005dc645" }, + "tabular": { "branch": "master", "commit": "339091ac4dd1f17e225fe7d57b48aff55f99b23a" }, + "targets.vim": { "branch": "master", "commit": "642d3a4ce306264b05ea3219920b13ea80931767" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "9bc8237565ded606e6c366a71c64c0af25cd7a50" }, + "telescope.nvim": { "branch": "master", "commit": "2d92125620417fbea82ec30303823e3cd69e90e8" }, + "trouble.nvim": { "branch": "main", "commit": "40aad004f53ae1d1ba91bcc5c29d59f07c5f01d3" }, + "turkish-deasciifier.vim": { "branch": "master", "commit": "5b3a0bfef7424d218df7ab3dac8ee9dab42a105e" }, + "vim-characterize": { "branch": "master", "commit": "1ba0fcf208464647e2df2e9f693247a2207f22a4" }, + "vim-cutlass": { "branch": "master", "commit": "7afd649415541634c8ce317fafbc31cd19d57589" }, + "vim-fugitive": { "branch": "master", "commit": "b3b838d690f315a503ec4af8c634bdff3b200aaf" }, + "vim-illuminate": { "branch": "master", "commit": "76f28e858f1caae87bfa45fb4fd09e4b053fc45b" }, + "vim-move": { "branch": "master", "commit": "244a2908ffbca3d09529b3ec24c2c090f489f401" }, + "vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" }, + "vim-subversive": { "branch": "master", "commit": "6286cda3f9222bfd490fe34a00a2d8cd4925adec" }, + "vim-unimpaired": { "branch": "master", "commit": "6d44a6dc2ec34607c41ec78acf81657248580bf1" }, + "vim-yoink": { "branch": "master", "commit": "89ed6934679fdbc3c20f552b50b1f869f624cd22" }, + "vimtex": { "branch": "master", "commit": "e3d0bea39dbcb6e064db751b646c958342a3460f" }, + "vimwiki": { "branch": "dev", "commit": "f0fe154ede6b11e3db9b058b930005a056a3d1c6" }, + "which-key.nvim": { "branch": "main", "commit": "7ccf476ebe0445a741b64e36c78a682c1c6118b7" } +} \ No newline at end of file diff --git a/.config/nvim/lua/au.lua b/.config/nvim/lua/au.lua deleted file mode 100644 index 305169c..0000000 --- a/.config/nvim/lua/au.lua +++ /dev/null @@ -1,50 +0,0 @@ --- --- https://gist.github.com/numToStr/1ab83dd2e919de9235f9f774ef8076da --- -local cmd = vim.api.nvim_command - -local function autocmd(this, event, spec) - local is_table = type(spec) == 'table' - local pattern = is_table and spec[1] or '*' - local action = is_table and spec[2] or spec - if type(action) == 'function' then - action = this.set(action) - end - local e = type(event) == 'table' and table.concat(event, ',') or event - cmd('autocmd ' .. e .. ' ' .. pattern .. ' ' .. action) -end - -local S = { - __au = {}, -} - -local X = setmetatable({}, { - __index = S, - __newindex = autocmd, - __call = autocmd, -}) - -function S.exec(id) - S.__au[id]() -end - -function S.set(fn) - local id = string.format('%p', fn) - S.__au[id] = fn - return string.format('lua require("au").exec("%s")', id) -end - -function S.group(grp, cmds) - cmd('augroup ' .. grp) - cmd('autocmd!') - if type(cmds) == 'function' then - cmds(X) - else - for _, au in ipairs(cmds) do - autocmd(S, au[1], { au[2], au[3] }) - end - end - cmd('augroup END') -end - -return X diff --git a/.config/nvim/lua/autocmds.lua b/.config/nvim/lua/autocmds.lua deleted file mode 100644 index 1b8751c..0000000 --- a/.config/nvim/lua/autocmds.lua +++ /dev/null @@ -1,67 +0,0 @@ --- ┌─────────────────────────┐ --- │ ▐ ▌ │ --- │▝▀▖▌ ▌▜▀ ▞▀▖▞▀▖▛▚▀▖▞▀▌▞▀▘│ --- │▞▀▌▌ ▌▐ ▖▌ ▌▌ ▖▌▐ ▌▌ ▌▝▀▖│ --- │▝▀▘▝▀▘ ▀ ▝▀ ▝▀ ▘▝ ▘▝▀▘▀▀ │ --- └─────────────────────────┘ - -local au = require('au') - -au.TextYankPost = function() - vim.highlight.on_yank { higroup="IncSearch", timeout=400 } -end - --- autocmd FileType vimwiki,latex,tex setlocal formatprg=/home/yigit/.local/bin/sentences -au.FileType = { - 'vimwiki,latex,tex', - function() - vim.bo.formatprg = "/home/yigit/.local/bin/sentences" - end, -} - --- autocmd VimLeave *.tex !texclear % -au.VimLeave = { - '*.tex', - function() - vim.cmd("!texclear %") - end, -} - --- autocmd FileType rust let b:dispatch = 'cargo run' -au.FileType = { - 'rust', - function() - vim.b.dispatch = 'cargo run' - end, -} - --- autocmd VimResized * :wincmd = -au.VimResized = { - '*', - function() - vim.cmd(":wincmd =") - end, -} - --- autocmd FileType markdown,tex setlocal spell -au.FileType = { - 'markdown,text', - function() - vim.wo.spell = true - end, -} - --- gf plugins -au.BufEnter = { - 'init.lua', - function() - vim.opt.path:append("./lua") - end -} - -au.BufLeave = { - 'init.lua', - function() - vim.opt.path:remove("./lua") - end -} diff --git a/.config/nvim/lua/core/keymaps.lua b/.config/nvim/lua/core/keymaps.lua new file mode 100644 index 0000000..b63156d --- /dev/null +++ b/.config/nvim/lua/core/keymaps.lua @@ -0,0 +1,77 @@ +local map = require("helpers.keys").map + +-- https://stackoverflow.com/questions/4256697/vim-search-and-highlight-but-do-not-jump +-- search & highlight but do not jump +map("n", "*", "keepjumps normal! mi*`i", "search forwards") +map("n", "#", "keepjumps normal! mi#`i", "search backwards") + +-- save file as sudo on files that require root permission +map("c", "w!!", 'execute "silent! write !sudo tee % >/dev/null" edit!', "save file as sudo", { silent = false }) + +-- replace ex mode with gq (format lines) +map("n", "Q", "gq", "format lines") + +-- set formatprg to sentences, for prose +-- TODO: can we do this with vim.o.formatprg? +map("n", "fp", "set formatprg=~/.local/bin/sentences", "switch to sentences view", { silent = false }) + +-- replace all is aliased to S. +map("n", "S", ":s//g", "replace all", { silent = false }) +map("v", "S", ":s//g", "replace all selection", { silent = false }) + +-- jump to buffer +map("n", "b", "ls:b", "jump to buffer") + +-- up and down are more logical with g.. +map("n", "k", '(v:count == 0 ? "gk" : "k")', "up", { expr = true }) +map("n", "j", '(v:count == 0 ? "gj" : "j")', "down", { expr = true }) +map("i", "", "gka") +map("i", "", "gja") + +-- space used to toggle folds, now it's x (because x is d) +map("n", "", '"_x') + +-- separate cut and delete +map("n", "x", "d") +map("x", "x", "d") +map("n", "xx", "dd") +map("n", "X", "D") + +-- change into pwd of current buffer +map("n", "cd", "lcd %:p:h:pwd", "cd to current buffer's pwd") + +-- call CreatePaper on word below cursor +map("n", "np", 'gewi[[/papers/Ea]]bb:call CreatePaper(expand(""))', + "vimwiki new paper on word under cursor") + +-- link paper +map("n", "lp", "gewi[[/papers/Ea]]", "vimwiki link wrap word under cursor") + +-- call CreateReference on word below cursor +map("n", "nr", 'call CreateReference(expand(""))', "vimwiki new reference word under cursor") + +-- create a new note +map("n", "nn", "call CreateNote()", "vimwiki new note for slipbox") + +-- :%% to get current file path +map('c', '%%', "getcmdtype() == ':' ? expand('%:h').'/' : '%%'", "get current file path", { expr = true, silent = false }) + +-- reselect visual selection after indent +map('v', '>', '>gv') +map('v', '<', 'ut", function() + if vim.o.background == "dark" then + vim.o.background = "light" + else + vim.o.background = "dark" + end +end, "toggle between light and dark background") diff --git a/.config/nvim/lua/core/lazy.lua b/.config/nvim/lua/core/lazy.lua new file mode 100644 index 0000000..8a91029 --- /dev/null +++ b/.config/nvim/lua/core/lazy.lua @@ -0,0 +1,30 @@ +-- install lazy.nvim if not already installed +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not vim.loop.fs_stat(lazypath) then + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", -- latest stable release + lazypath, + }) +end +vim.opt.rtp:prepend(lazypath) + +-- use a protected call so we don't error out on first use +local ok, lazy = pcall(require, "lazy") +if not ok then + return +end + +-- we have to set the leader key here for lazy.nvim to work +require("helpers.keys").set_leader("\\") + +-- load plugins from specifications +-- see: https://github.com/folke/lazy.nvim#-structuring-your-plugins +-- we are loading them as a lua module +lazy.setup("plugins") + +-- easy-access keybindings +require("helpers.keys").map("n", "L", lazy.show, "show lazy") diff --git a/.config/nvim/lua/core/options.lua b/.config/nvim/lua/core/options.lua new file mode 100644 index 0000000..3299e83 --- /dev/null +++ b/.config/nvim/lua/core/options.lua @@ -0,0 +1,98 @@ +local opts = { + -- this might not be needed anymore + termguicolors = true, + + -- copy indent on a new line + autoindent = true, + + -- :h tabstop, 2. point + -- use appropriate number of spaces to insert a + expandtab = true, + shiftwidth = 4, + softtabstop = 4, + tabstop = 8, + + -- use english for spellchecking + spelllang = "en_gb", + + -- tab completion, zsh style + wildmode = "longest:full,full", + + -- put one space for join (not two) + joinspaces = false, + + -- keep n lines above/below cursor while scrolling + scrolloff = 4, + + -- line numbers + number = true, + + -- manual folding + foldmethod = "marker", + + -- set the terminal title + title = true, + + -- wrap using 'breakat' character + linebreak = true, + + -- new split panes will split to below and right + splitbelow = true, + splitright = true, + + -- use relative line numbers + relativenumber = true, + + -- we are already using a cursorline, don't clobber linter messages + showmode = false, + + -- jump to the matching bracket briefly + showmatch = true, + + -- persistent undo + undofile = true, + + -- lower case searches ignore case, upper case searches do not + ignorecase = true, + smartcase = true, + + -- https://stackoverflow.com/a/3445040/ + -- switch case labels + cinoptions = "l1", + +} + +for opt, val in pairs(opts) do + vim.o[opt] = val +end + +-- set other options +-- local colorscheme = require("helpers.colorscheme") +-- vim.cmd.colorscheme(colorscheme) + +-- interact with system clipboard +vim.opt.clipboard:append('unnamedplus') + +vim.opt.wildignore = { + '*.o', '*.obj', '*.class', '*.aux', '*.lof', '*.log', '*.lot', '*.fls', + '*.toc', '*.fmt', '*.fot', '*.cb', '*.cb2', '.*.lb', '.dvi', '*.xdv', + '*.bbl', '*.bcf', '*.blg', '*-blx.aux', '*-blx.bib', '*.run.xml', + '*.fdb_latexmk', '*.synctex', '*.synctex(busy)', '*.synctex.gz', + '*.synctex.gz(busy)', '*.pdfsync' +} + +-- iwhite: ignore changes in amount of white space. +-- vertical: start diff mode with vertical splits +-- filler: show filler lines, +vim.opt.diffopt = { + "iwhite", "vertical", "filler", "algorithm:patience", "indent-heuristic" +} + +-- menu: use a popup menu to show the possible completions +-- preview: show extra information +vim.opt.completeopt = {"menu", "menuone", "noselect"} + +if vim.fn.executable("rg") then + vim.o.grepprg = "rg --vimgrep --no-heading --smart-case" + vim.o.grepformat = "%f:%l:%c:%m,%f:%l:%m" +end diff --git a/.config/nvim/lua/functions.lua b/.config/nvim/lua/functions.lua deleted file mode 100644 index daee597..0000000 --- a/.config/nvim/lua/functions.lua +++ /dev/null @@ -1,24 +0,0 @@ --- ┌──────────────────────────┐ --- │▗▀▖ ▐ ▗ │ --- │▐ ▌ ▌▛▀▖▞▀▖▜▀ ▄ ▞▀▖▛▀▖▞▀▘│ --- │▜▀ ▌ ▌▌ ▌▌ ▖▐ ▖▐ ▌ ▌▌ ▌▝▀▖│ --- │▐ ▝▀▘▘ ▘▝▀ ▀ ▀▘▝▀ ▘ ▘▀▀ │ --- └──────────────────────────┘ --- 2021-10-10 21:50 WIP, I don't know how to integrate these functions to init.lua and honestly, everything is a nvim_command or something anyway - -local random = math.random - -local function random_filename() - uuid = '' - for i=0,6 do - uuid = uuid .. (string.format('%x', random(0, 0xf))) - end - return uuid -end - -function create_note() - nvim_command("e! " .. nvim_call_function('fnameescape', '~/nextcloud/personal_wiki/text/box/' .. random_filename() .. ".wiki")) - local text = "= up =\n\n= down =\n\n= keywords =\n\n" - nvim_command("put! " .. text) - nvim_command("normal gg") -end diff --git a/.config/nvim/lua/helpers/keys.lua b/.config/nvim/lua/helpers/keys.lua new file mode 100644 index 0000000..ebbcf6e --- /dev/null +++ b/.config/nvim/lua/helpers/keys.lua @@ -0,0 +1,21 @@ +local M = {} + +M.map = function(mode, lhs, rhs, desc, opts) + local options = { noremap = true, silent = true, desc = desc } + if opts then + options = vim.tbl_extend("force", options, opts) + end + vim.keymap.set(mode, lhs, rhs, options) +end + +M.lsp_map = function(lhs, rhs, bufnr, desc) + vim.keymap.set("n", lhs, rhs, { silent = true, buffer = bufnr, desc = desc }) +end + +M.set_leader = function(key) + vim.g.mapleader = key + vim.g.maplocalleader = key + M.map({ "n", "v" }, key, "") +end + +return M diff --git a/.config/nvim/lua/helpers/stale.lua b/.config/nvim/lua/helpers/stale.lua new file mode 100644 index 0000000..062e3cf --- /dev/null +++ b/.config/nvim/lua/helpers/stale.lua @@ -0,0 +1,159 @@ +local M = {} +_VT_NS = vim.api.nvim_create_namespace("lsp_signature") + +local prescript +local prescript_hi +local due_hi +local ft +local future +local future_hi +local date_hi +local pattern_start +local pattern_end + +local use_clock_time +local default_due_time + +-- local date_pattern +local datetime_pattern +local datetime_pattern_match + +local function parseDue(due) + local year = 31556926 + local month = 2629743 + local week = 604800 + local day = 86400 + local hour = 3600 + local minute = 60 + local res = '' + + if due >= year then + res = res .. math.floor(due / year) .. 'y ' + due = due % year + end + + if due >= month then + res = res .. math.floor(due / month) .. 'm ' + due = due % month + end + + if due >= week then + res = res .. math.floor(due / week) .. 'w ' + due = due % week + end + + if use_clock_time == true then + if due >= day then + res = res .. math.floor(due / day) .. 'd ' + due = due % day + end + + if due >= hour then + res = res .. math.floor(due / hour) .. 'h ' + due = due % hour + end + + if due >= minute then + res = res .. math.floor(due / minute) .. 'min ' + due = due % minute + end + else + res = res .. math.floor(due / day) + 1 .. 'd ' + end + + return res +end + +function M.setup(c) + use_clock_time = c.use_clock_time or true + default_due_time = c.default_due_time or 'midnight' + prescript = c.prescript or 'has been: ' + prescript_hi = c.prescript_hi or 'Comment' + due_hi = c.due_hi or 'String' + ft = c.ft or '*.wiki' + future = c.future or 'future' + future_hi = c.future_hi or 'Error' + date_hi = c.date_hi or 'Conceal' + pattern_start = c.pattern_start or '(' + pattern_end = c.pattern_end or ')' + + local lua_start = pattern_start:gsub("[%(%)%.%%%+%-%*%?%[%^%$%]]", "%%%1") + local lua_end = pattern_end:gsub("[%(%)%.%%%+%-%*%?%[%^%$%]]", "%%%1") + + local regex_start = pattern_start:gsub("\\%^%$%.%*~%[%]&", "\\%1") + local regex_end = pattern_end:gsub("\\%^%$%.%*~%[%]&", "\\%1") + + datetime_pattern = lua_start .. '%d%d%d%d%-%d%d%-%d%d %d%d:%d%d' .. lua_end + datetime_pattern_match = lua_start .. '(%d%d%d%d)%-(%d%d)%-(%d%d) (%d%d):(%d%d)' .. lua_end + + local regex_hi = '/' .. regex_start .. '\\d*-*\\d\\+-\\d\\+' .. regex_end .. + '/' + + vim.api.nvim_command('autocmd BufEnter ' .. ft .. + ' lua require("helpers.stale").draw(0)') + vim.api.nvim_command('autocmd InsertLeave ' .. ft .. + ' lua require("helpers.stale").redraw(0)') + vim.api.nvim_command('autocmd TextChanged ' .. ft .. + ' lua require("helpers.stale").redraw(0)') + vim.api.nvim_command('autocmd TextChangedI ' .. ft .. + ' lua require("helpers.stale").redraw(0)') + + vim.api.nvim_command('autocmd BufEnter ' .. ft .. ' syn match DueDate ' .. + regex_hi .. + ' display containedin=mkdNonListItemBlock,mkdListItemLine,mkdBlockquote contained') + vim.api.nvim_command('autocmd BufEnter ' .. ft .. ' hi def link DueDate ' .. + date_hi) +end + +function M.draw(buf) + local user_time + local user_hour + local user_min + local user_sec = 00 + + -- get current time + local now = os.time(os.date('*t')) + + -- find which date pattern is being passed in by user + for key, value in pairs(vim.api.nvim_buf_get_lines(buf, 0, -1, {})) do + local dateTime = string.match(value, datetime_pattern) + local due + + if dateTime then + local cur_year, month, day, user_hour, user_min = dateTime:match(datetime_pattern_match) + user_time = os.time({ + year = cur_year, + month = month, + day = day, + hour = user_hour, + min = user_min, + sec = user_sec + }) + + due = now - user_time + end + + if due then + local parsed + + if due > 0 then + parsed = { parseDue(due), due_hi } + else + parsed = { future, future_hi } + end + + vim.api.nvim_buf_set_virtual_text(buf, _VT_NS, key - 1, { + { prescript, prescript_hi }, parsed + }, {}) + end + end +end + +function M.clear(buf) vim.api.nvim_buf_clear_namespace(buf, _VT_NS, 0, -1) end + +function M.redraw(buf) + M.clear(buf) + M.draw(buf) +end + +return M diff --git a/.config/nvim/lua/mappings.lua b/.config/nvim/lua/mappings.lua deleted file mode 100644 index adc68a9..0000000 --- a/.config/nvim/lua/mappings.lua +++ /dev/null @@ -1,183 +0,0 @@ --- ┌────────────────────────┐ --- │ ▗ │ --- │▛▚▀▖▝▀▖▛▀▖▛▀▖▄ ▛▀▖▞▀▌▞▀▘│ --- │▌▐ ▌▞▀▌▙▄▘▙▄▘▐ ▌ ▌▚▄▌▝▀▖│ --- │▘▝ ▘▝▀▘▌ ▌ ▀▘▘ ▘▗▄▘▀▀ │ --- └────────────────────────┘ - --- brute force deasciify everything -vim.keymap.set("n", "tc", "TurkishDeasciifyForce()", { expr = true }) -vim.keymap.set("n", "tctc", "TurkishDeasciifyForce() .. '_'", { expr = true }) -vim.keymap.set("x", "tc", "TurkishDeasciifyForce()", { expr = true }) - --- use turkish-mode to selectively deasciify -vim.keymap.set("n", "tr", "TurkishDeasciify()", {expr = true}) -vim.keymap.set("n", "trtr", "TurkishDeasciify() .. '_'", {expr = true}) -vim.keymap.set("x", "tr", "TurkishDeasciify()", {expr = true}) - --- ascii everything -vim.keymap.set("n", "rt", "TurkishAsciify()", {expr = true}) -vim.keymap.set("n", "rtrt", "TurkishAsciify() .. '_'", {expr = true}) -vim.keymap.set("x", "rt", "TurkishAsciify()", {expr = true}) - --- https://stackoverflow.com/questions/4256697/vim-search-and-highlight-but-do-not-jump --- search & highlight but do not jump -vim.keymap.set("n", "*", ":keepjumps normal! mi*`i") -vim.keymap.set("n", "#", ":keepjumps normal! mi#`i") - --- save file as sudo on files that require root permission -vim.keymap.set("c", "w!!", 'execute "silent! write !sudo tee % >/dev/null" edit!', { silent = false }) - --- replace ex mode with gq (format lines) -vim.keymap.set('n', 'Q', 'gq') - --- set formatprg to sentences, for prose -vim.keymap.set('n', 'fp', ":set formatprg=~/.local/bin/sentences", { silent = false }) - --- replace all is aliased to S. -vim.keymap.set('n', 'S', ':%s//g', { silent = false }) -vim.keymap.set('v', 'S', ':s//g', { silent = false }) - --- jump to buffer -vim.keymap.set('n', 'b', ':ls:b') - --- up and down are more logical with g.. -vim.keymap.set('n', 'k', '(v:count == 0 ? "gk" : "k")', { expr = true }) -vim.keymap.set('n', 'j', '(v:count == 0 ? "gj" : "j")', { expr = true }) -vim.keymap.set('i', '', 'gka') -vim.keymap.set('i', '', 'gja') - --- space used to toggle folds, now it's x (because x is d) -vim.keymap.set('n', '', '"_x') - --- separate cut and delete -vim.keymap.set('n', 'x', 'd') -vim.keymap.set('x', 'x', 'd') -vim.keymap.set('n', 'xx', 'dd') -vim.keymap.set('n', 'X', 'D') - --- change into pwd of current directory -vim.keymap.set('n', 'cd', ':lcd %:p:h:pwd') - --- call CreatePaper on word below cursor -vim.keymap.set('n', 'np', 'gewi[[/papers/Ea]]bb:call CreatePaper(expand(""))') - --- link paper -vim.keymap.set('n', 'lp', 'gewi[[/papers/Ea]]') - --- call CreateReference on word below cursor -vim.keymap.set('n', 'nr', ':call CreateReference(expand(""))') - --- create a new note -vim.keymap.set('n', 'nn', ':call CreateNote()') - --- :%% to get current file path -vim.keymap.set('c', '%%', "getcmdtype() == ':' ? expand('%:h').'/' : '%%'", { expr = true, silent = false }) - --- reselect visual selection after indent -vim.keymap.set('v', '>', '>gv') -vim.keymap.set('v', '<', '(YoinkPaste_p)') -vim.keymap.set('n', 'P', '(YoinkPaste_P)') - --- substitute from yank -vim.keymap.set('n', 'ys', '(SubversiveSubstitute)') -vim.keymap.set('n', 'yss', '(SubversiveSubstituteLine)') -vim.keymap.set('n', 'yS', '(SubversiveSubstituteToEndOfLine)') - --- substitute over range -vim.keymap.set('n', 's', '(SubversiveSubstituteRange)') -vim.keymap.set('x', 's', '(SubversiveSubstituteRange)') -vim.keymap.set('n', 'ss', '(SubversiveSubstituteWordRange)') - --- subvert over range -vim.keymap.set('n', 's', '(SubversiveSubvertRange)') -vim.keymap.set('x', 's', '(SubversiveSubvertRange)') -vim.keymap.set('n', 'ss', '(SubversiveSubvertWordRange)') - --- iterate over yank list -vim.keymap.set('n', '', '(YoinkPostPasteSwapBack)') -vim.keymap.set('n', '', '(YoinkPostPasteSwapForward)') - --- checkmarks on vimwiki -vim.keymap.set('n', 'v', 'VimwikiToggleListItem') --- add/increase header level -vim.keymap.set('n', 'a', 'VimwikiAddHeaderLevel') - --- vim-test bindings -vim.keymap.set('n', 't', ':TestNearest') -vim.keymap.set('n', 't', ':TestFile') -vim.keymap.set('n', 't', ':TestSuite') -vim.keymap.set('n', 't', ':TestLast') -vim.keymap.set('n', 't', ':TestVisit') - --- telescope bindings -vim.keymap.set('n', 'ff', "lua require('telescope.builtin').find_files()") -vim.keymap.set('n', 'fg', "lua require('telescope.builtin').live_grep()") -vim.keymap.set('n', 'fb', "lua require('telescope.builtin').buffers()") -vim.keymap.set('n', 'fh', "lua require('telescope.builtin').help_tags()") - --- nvim tree mappings -vim.keymap.set('n', 'vt', ':NvimTreeToggle') -vim.keymap.set('n', 'vr', ':NvimTreeRefresh') -vim.keymap.set('n', 'vs', ':NvimTreeFindFile!') - --- dial.nvim mappings -local opts = { noremap=true, silent=true } -vim.keymap.set("n", "", require("dial.map").inc_normal(), opts) -vim.keymap.set("n", "", require("dial.map").dec_normal(), opts) -vim.keymap.set("v", "", require("dial.map").inc_visual(), opts) -vim.keymap.set("v", "", require("dial.map").dec_visual(), opts) -vim.keymap.set("v", "g", require("dial.map").inc_gvisual(), opts) -vim.keymap.set("v", "g", require("dial.map").dec_gvisual(), opts) - --- leap.nvim mappings -vim.keymap.set('n', '`', '(leap-forward)', opts) -vim.keymap.set('n', '`', '(leap-backward)', opts) -vim.keymap.set('v', '`', '(leap-forward)', opts) -vim.keymap.set('v', '`', '(leap-backward)', opts) - --- barbar.nvim mappings -local opts = { noremap = true, silent = true } - --- move to previous/next -vim.keymap.set('n', '', 'BufferPrevious', opts) -vim.keymap.set('n', '', 'BufferNext', opts) --- re-order to previous/next -vim.keymap.set('n', '', 'BufferMovePrevious', opts) -vim.keymap.set('n', '', 'BufferMoveNext', opts) --- goto buffer in position... -vim.keymap.set('n', '', 'BufferGoto 1', opts) -vim.keymap.set('n', '', 'BufferGoto 2', opts) -vim.keymap.set('n', '', 'BufferGoto 3', opts) -vim.keymap.set('n', '', 'BufferGoto 4', opts) -vim.keymap.set('n', '', 'BufferGoto 5', opts) -vim.keymap.set('n', '', 'BufferGoto 6', opts) -vim.keymap.set('n', '', 'BufferGoto 7', opts) -vim.keymap.set('n', '', 'BufferGoto 8', opts) -vim.keymap.set('n', '', 'BufferGoto 9', opts) -vim.keymap.set('n', '', 'BufferLast', opts) --- pin/unpin buffer -vim.keymap.set('n', '', 'BufferPin', opts) --- close buffer -vim.keymap.set('n', '', 'BufferClose', opts) --- magic buffer-picking mode -vim.keymap.set('n', 'dg', 'BufferPick', opts) --- sort automatically by... -vim.keymap.set('n', 'db', 'BufferOrderByBufferNumber', opts) -vim.keymap.set('n', 'dd', 'BufferOrderByDirectory', opts) -vim.keymap.set('n', 'dl', 'BufferOrderByLanguage', opts) -vim.keymap.set('n', 'dw', 'BufferOrderByWindowNumber', opts) - --- }}} plug mappings -- diff --git a/.config/nvim/lua/plugin_settings.lua b/.config/nvim/lua/plugin_settings.lua deleted file mode 100644 index 351592d..0000000 --- a/.config/nvim/lua/plugin_settings.lua +++ /dev/null @@ -1,722 +0,0 @@ --- ┌─────────────────────────────────────┐ --- │ ▜ ▐ ▐ ▗ │ --- │▛▀▖▐ ▌ ▌▞▀▌▗▖▖▞▀▘▞▀▖▜▀ ▜▀ ▄ ▛▀▖▞▀▌▞▀▘│ --- │▙▄▘▐ ▌ ▌▚▄▌▘▝ ▝▀▖▛▀ ▐ ▖▐ ▖▐ ▌ ▌▚▄▌▝▀▖│ --- │▌ ▘▝▀▘▗▄▘ ▀▀ ▝▀▘ ▀ ▀ ▀▘▘ ▘▗▄▘▀▀ │ --- └─────────────────────────────────────┘ - -local g = vim.g -- global for let options -local opt = vim.opt -- convenient :set -local cmd = vim.cmd -- vim commands - --- vimwiki {{{ -- -g.vimwiki_list = { - { - path = '/home/yigit/nextcloud/personal_wiki/text', - path_html = '/home/yigit/nextcloud/personal_wiki/html', - auto_generate_tags = 1, - automatic_nested_syntaxes = 1, - template_path = '/home/yigit/nextcloud/personal_wiki/templates', - template_default = 'default_template', - template_ext = '.html', - auto_export = 1, - auto_tags = 1 - } -} - -g.vimwiki_global_ext = 0 -g.vimwiki_hl_headers = 1 --- }}} vimwiki -- - --- lualine {{{ -- - -local function lualine_spell() - if vim.wo.spell then - return "spell" - else - return - end -end - -local conditions = { - spell_on = function () - return vim.wo.spell - end, - filetype_is_tex = function() - return vim.bo.filetype == "tex" - end -} - --- https://www.reddit.com/r/neovim/comments/u2uc4p/your_lualine_custom_features/i4muvp6/ --- override 'encoding': don't display if encoding is utf-8. -local encoding = function() - local ret, _ = (vim.bo.fenc).gsub("^utf%-8$", "") - return ret -end - --- fileformat: don't display if &ff is unix. -local fileformat = function() - local ret, _ = vim.bo.fileformat.gsub("^unix$", "") - return ret -end - -require'lualine'.setup { - options = { - icons_enabled = true, - theme = "catppuccin", - section_separators = { left = '', right = '' }, - component_separators = { left = '', right = '' }, - }, - sections = { - lualine_a = {{'mode', fmt = string.lower}}, - lualine_b = {'branch', - { - 'diff', - diff_color= { - -- Same color values as the general color option can be used here. - added = { fg = 'LightGreen' }, - modified = { fg = 'LightBlue' }, -- Changes the diff's modified color - removed = { fg = 'LightRed' }, -- Changes the diff's removed color you - } - }, - { - lualine_spell, - cond = conditions.spell_on, - }}, - lualine_c = {'filename'}, - lualine_x = {encoding, fileformat, 'filetype'}, - lualine_y = {'progress'}, - lualine_z = { - 'location', { - 'diagnostics', - sources = {'nvim_diagnostic'}, - sections = {'error', 'warn', 'info', 'hint'}, - symbols = {error = 'e', warn = 'w', info = 'i', hint = 'h'} - } - } - }, - inactive_sections = { - lualine_a = {}, - lualine_b = {}, - lualine_c = {'filename'}, - lualine_x = {}, - lualine_y = {}, - lualine_z = {} - }, - tabline = {}, - extensions = {} -} - --- }}} lualine -- - --- cutlass suite {{{ -- - --- cutlass/yoink/subverse suite -g.yoinkIncludeDeleteOperations = 1 - --- fix the Target STRING not available -g.clipboard = { - name = 'xsel_override', - copy = { - ['+'] = 'xsel --input --clipboard', - ['*'] = 'xsel --input --primary', - }, - paste = { - ['+'] = 'xsel --output --clipboard', - ['*'] = 'xsel --output --primary', - }, - cache_enabled = 1, -} - --- }}} cutlass suite -- - --- UltiSnips {{{ -- -g.UltiSnipsEditSplit = "vertical" --- ctrl + l expands the snippet, c + j/k navigates placeholders -g.UltiSnipsExpandTrigger = "" -g.UltiSnipsEnableSnipMate = "1" -g.UltiSnipsSnippetDirectories = {"my_snippets", "UltiSnips"} --- }}} UltiSnips -- - --- vimtex {{{ -- -g.vimtex_view_method = 'zathura' -g.vimtex_quickfix_mode = 0 -g.vimtex_quickfix_ignore_filters = {"Underfull", "Overfull"} - -g.vimtex_compiler_latexmk = { - options = { - "-pdf", '-shell-escape', '-verbose', '-file-line-error', '-synctex=1', '-interaction=nonstopmode' - } -} - --- }}} vimtex -- - --- devicons {{{ -- -require'nvim-web-devicons'.setup { - override = { - wiki = { - icon = "󰂺", - color = "#D7827E", - name = "vimwiki" - }, - rem = { - icon = "", - color = "#B4637A", - name = "remind" - }, - mail = { - icon = "󰇰", - color = "#907AA9", - name = "mail" - }, - }; - - default = true -} --- }}} devicons -- - --- vim-slime {{{ -- -g.slime_target = "tmux" -g.slime_paste_file = "$HOME/.slime_paste" -g.slime_default_config = {socket_name = vim.call("get", vim.call("split", vim.env.TMUX, ','), "0"), target_pane = "{last}"} --- }}} vim-slime -- - --- gutentags {{{ -- -g.gutentags_enabled = 1 -g.gutentags_add_default_project_roots = 0 -g.gutentags_project_root = {'Makefile', '.git'} -g.gutentags_exclude_filetypes = {'gitcommit', 'gitconfig', 'gitrebase', 'gitsendemail', 'git'} -g.gutentags_generate_on_new = 1 -g.gutentags_generate_on_missing = 1 -g.gutentags_generate_on_write = 1 -g.gutentags_generate_on_empty_buffer = 0 -g.gutentags_ctags_exclude = { - '*.git', '*.svn', '*.hg', - 'cache', 'build', 'dist', 'bin', 'node_modules', 'bower_components', - '*-lock.json', '*.lock', - '*.min.*', - '*.bak', - '*.zip', - '*.pyc', - '*.class', - '*.sln', - '*.csproj', '*.csproj.user', - '*.tmp', - '*.cache', - '*.vscode', - '*.pdb', - '*.exe', '*.dll', '*.bin', - '*.mp3', '*.ogg', '*.flac', - '*.swp', '*.swo', - '.DS_Store', '*.plist', - '*.bmp', '*.gif', '*.ico', '*.jpg', '*.png', '*.svg', - '*.rar', '*.zip', '*.tar', '*.tar.gz', '*.tar.xz', '*.tar.bz2', - '*.pdf', '*.doc', '*.docx', '*.ppt', '*.pptx', '*.xls', -} --- }}} gutentags -- - --- telescope {{{ -- -require('telescope').setup { - extensions = { - fzf = { - fuzzy = true, -- false will only do exact matching - override_generic_sorter = true, -- override the generic sorter - override_file_sorter = true, -- override the file sorter - case_mode = "smart_case", -- or "ignore_case" or "respect_case" - -- the default case_mode is "smart_case" - } - } -} - -require('telescope').load_extension('fzf') --- }}} telescope -- - --- dashboard {{{ -- - -require('dashboard').setup { - theme = 'hyper', - config = { - week_header = { - enable = true, - }, - shortcut = { - { desc = ' Update', group = '@property', action = 'PackerSync', key = 'u' }, - { - icon = ' ', - icon_hl = '@variable', - desc = 'Files', - group = 'Label', - action = 'Telescope find_files', - key = 'f', - }, - }, - }, -} - --- }}} dashboard -- - --- treesitter {{{ -- - -require 'nvim-treesitter.configs'.setup { - ensure_installed = "all", - auto_install = true, - highlight = { - enable = true, - disable = { "latex" }, - additional_vim_regex_highlighting = false, - }, - incremental_selection = { - enable = true, - keymaps = { - init_selection = "gnn", - node_incremental = "grn", - scope_incremental = "grc", - node_decremental = "grm", - }, - }, - indent = { - enable = true - } -} --- }}} treesitter -- - --- nvim-cmp {{{ -- -local cmp = require'cmp' - -cmp.setup({ - snippet = { - expand = function(args) - vim.fn["UltiSnips#Anon"](args.body) - end, - }, - window = { - completion = cmp.config.window.bordered(), - documentation = cmp.config.window.bordered(), - }, - mapping = cmp.mapping.preset.insert({ - [''] = cmp.mapping(cmp.mapping.scroll_docs(-4), { 'i', 'c' }), - [''] = cmp.mapping(cmp.mapping.scroll_docs(4), { 'i', 'c' }), - [''] = cmp.mapping(cmp.mapping.complete(), { 'i', 'c' }), - [''] = cmp.mapping({ - i = cmp.mapping.abort(), - c = cmp.mapping.close(), - }), - [''] = cmp.mapping.confirm({ select = true }), - }), - sources = cmp.config.sources({ - { name = 'nvim_lsp' }, - { name = 'ultisnips' }, - }, { - { name = 'buffer' }, - { name = 'path' }, - }) -}) - --- }}} nvim-cmp -- - --- nvim-lspconfig {{{ -- -local nvim_lsp = require('lspconfig') - --- Mappings. -local opts = { noremap=true, silent=true } -vim.keymap.set('n', 'e', vim.diagnostic.open_float, opts) -vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts) -vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts) -vim.keymap.set('n', 'q', vim.diagnostic.setloclist, opts) - -local on_attach = function(client, bufnr) - -- enable completion triggered by - vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') - - -- see `:help vim.lsp.*` for documentation on any of the below functions - local bufopts = { noremap=true, silent=true, buffer=bufnr } - vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts) - vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts) - vim.keymap.set('n', 'vh', vim.lsp.buf.hover, bufopts) - vim.keymap.set('n', 'gh', vim.lsp.buf.implementation, bufopts) - vim.keymap.set('n', '', vim.lsp.buf.signature_help, bufopts) - vim.keymap.set('n', 'wa', vim.lsp.buf.add_workspace_folder, bufopts) - vim.keymap.set('n', 'wr', vim.lsp.buf.remove_workspace_folder, bufopts) - vim.keymap.set('n', 'wl', function() - print(vim.inspect(vim.lsp.buf.list_workspace_folders())) - end, bufopts) - vim.keymap.set('n', 'D', vim.lsp.buf.type_definition, bufopts) - vim.keymap.set('n', 'rn', vim.lsp.buf.rename, bufopts) - vim.keymap.set('n', 'ca', vim.lsp.buf.code_action, bufopts) - vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts) - vim.keymap.set('n', 'fm', function() vim.lsp.buf.format { async = true } end, bufopts) -end - --- bring in cmp_nvim_lsp -local capabilities = require('cmp_nvim_lsp').default_capabilities() - -local servers = { 'jedi_language_server', 'texlab', 'clangd', 'denols' } -for _, lsp in ipairs(servers) do - nvim_lsp[lsp].setup { - on_attach = on_attach, - capabilities = capabilities - } -end - -nvim_lsp['efm'].setup { - on_attach = on_attach, - filetypes = { 'sh' }, - capabilities = capabilities -} - -nvim_lsp.ltex.setup { - capabilities = capabilities, - on_attach = function(client, bufnr) - on_attach(client, bufnr) - require("ltex_extra").setup { - load_langs = { "en-GB" }, - init_check = true, - path = "/home/yigit/.local/share/nvim/ltex", - log_level = "none", - } - end, - settings = { - ltex = { - -- my settings here - } - } -} - --- rust-tools {{{ -- - --- Configure LSP through rust-tools.nvim plugin. --- rust-tools will configure and enable certain LSP features for us. --- See https://github.com/simrat39/rust-tools.nvim#configuration -local rust_opts = { - tools = { - runnables = { - use_telescope = true, - }, - inlay_hints = { - auto = true, - show_parameter_hints = true, - parameter_hints_prefix = "↸ ", - other_hints_prefix = "❱ ", - }, - }, - - -- all the opts to send to nvim-lspconfig - -- these override the defaults set by rust-tools.nvim - -- see https://github.com/neovim/nvim-lspconfig/blob/master/CONFIG.md#rust_analyzer - server = { - -- on_attach is a callback called when the language server attachs to the buffer - on_attach = on_attach, - settings = { - -- to enable rust-analyzer settings visit: - -- https://github.com/rust-analyzer/rust-analyzer/blob/master/docs/user/generated_config.adoc - ["rust-analyzer"] = { - -- enable clippy on save - checkOnSave = { - command = "clippy", - }, - }, - }, - }, -} - -require('rust-tools').setup(rust_opts) - --- }}} rust-tools -- - --- }}} nvim-lsp -- - --- indent-blankline {{{ -- -vim.opt.list = true - -require("indent_blankline").setup { - show_current_context = true, - char = "┊", - buftype_exclude = {"terminal"}, - filetype_exclude = {"dashboard", "help", "man"} -} --- }}} indent-blankline -- - --- nvim-autopairs {{{ -- - -require('nvim-autopairs').setup({ - disable_filetype = { "TelescopePrompt" }, -}) - -local cmp_autopairs = require('nvim-autopairs.completion.cmp') -local cmp = require('cmp') -cmp.event:on( 'confirm_done', cmp_autopairs.on_confirm_done()) - -local Rule = require('nvim-autopairs.rule') -local npairs = require('nvim-autopairs') - -npairs.add_rule(Rule('%"','%"',"remind")) -npairs.add_rule(Rule('/*','*/',"c")) - --- }}} nvim-autopairs -- - --- nvim-colorizer {{{ -- -require 'colorizer'.setup() --- }}} nvim-colorizer -- - --- gitsigns.nvim {{{ -- - -require('gitsigns').setup { - signs = { - add = { text = '│' }, - change = { text = '│' }, - delete = { text = '_' }, - topdelete = { text = '‾' }, - changedelete = { text = '~' }, - untracked = { text = '┆' }, - }, - signcolumn = true, -- Toggle with `:Gitsigns toggle_signs` - numhl = false, -- Toggle with `:Gitsigns toggle_numhl` - linehl = false, -- Toggle with `:Gitsigns toggle_linehl` - word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff` - watch_gitdir = { - follow_files = true - }, - attach_to_untracked = true, - current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame` - current_line_blame_opts = { - virt_text = true, - virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align' - delay = 1000, - ignore_whitespace = false, - }, - current_line_blame_formatter = ', - ', - sign_priority = 6, - update_debounce = 100, - status_formatter = nil, -- Use default - max_file_length = 40000, -- Disable if file is longer than this (in lines) - preview_config = { - -- Options passed to nvim_open_win - border = 'single', - style = 'minimal', - relative = 'cursor', - row = 0, - col = 1 - }, - yadm = { - enable = true - }, - - on_attach = function(bufnr) - local gs = package.loaded.gitsigns - - local function map(mode, l, r, opts) - opts = opts or {} - opts.buffer = bufnr - vim.keymap.set(mode, l, r, opts) - end - - -- Navigation - map('n', ']c', function() - if vim.wo.diff then return ']c' end - vim.schedule(function() gs.next_hunk() end) - return '' - end, {expr=true}) - - map('n', '[c', function() - if vim.wo.diff then return '[c' end - vim.schedule(function() gs.prev_hunk() end) - return '' - end, {expr=true}) - - -- Actions - map('n', 'hs', gs.stage_hunk) - map('n', 'hr', gs.reset_hunk) - map('v', 'hs', function() gs.stage_hunk {vim.fn.line('.'), vim.fn.line('v')} end) - map('v', 'hr', function() gs.reset_hunk {vim.fn.line('.'), vim.fn.line('v')} end) - map('n', 'hS', gs.stage_buffer) - map('n', 'hu', gs.undo_stage_hunk) - map('n', 'hR', gs.reset_buffer) - map('n', 'hp', gs.preview_hunk) - map('n', 'hb', function() gs.blame_line{full=true} end) - map('n', 'tb', gs.toggle_current_line_blame) - map('n', 'hd', gs.diffthis) - map('n', 'hD', function() gs.diffthis('~') end) - map('n', 'td', gs.toggle_deleted) - - -- Text object - map({'o', 'x'}, 'ih', ':Gitsigns select_hunk') - end -} - --- }}} gitsigns.nvim -- - --- Comment.nvim {{{ -- -require('Comment').setup() --- }}} Comment.nvim -- - --- catppuccin {{{ -- -require("catppuccin").setup({ - flavour = "mocha", -- latte, frappe, macchiato, mocha - background = { -- :h background - light = "latte", - dark = "mocha", - }, - transparent_background = false, - term_colors = false, - no_italic = true, -- force no italic - no_bold = false, -- force no bold - integrations = { - barbar = true, - cmp = true, - fidget = true, - gitsigns = true, - leap = true, - nvimtree = true, - telescope = true, - treesitter = true, - vimwiki = true, - }, - native_lsp = { - enabled = true, - underlines = { - errors = { "underline" }, - hints = { "underline" }, - warnings = { "underline" }, - information = { "underline" }, - }, - - }, - indent_blankline = { - enabled = true, - }, -}) - --- setup must be called before loading -vim.cmd.colorscheme "catppuccin" - --- }}} catppuccin -- - --- dial.nvim {{{ -- - -local augend = require("dial.augend") -require("dial.config").augends:register_group{ - -- default augends used when no group name is specified - default = { - augend.integer.alias.decimal, -- nonnegative decimal number (0, 1, 2, 3, ...) - augend.integer.alias.hex, -- nonnegative hex number (0x01, 0x1a1f, etc.) - augend.date.alias["%Y/%m/%d"], -- date (2022/02/19, etc.) - augend.date.alias["%Y-%m-%d"], - augend.semver.alias.semver, - augend.constant.new{ - elements = {"and", "or"}, - word = true, -- if false, "sand" is incremented into "sor", "doctor" into "doctand", etc. - cyclic = true, -- "or" is incremented into "and". - }, - augend.constant.new{ - elements = {"&&", "||"}, - word = false, - cyclic = true, - }, - }, -} - --- }}} dial.nvim -- - --- leap.nvim {{{ -- -require('leap').setup { - case_insensitive = true, - substitute_chars = { ['\r'] = '¬' } -} - --- }}} leap.nvim -- - --- fidget.nvim {{{ -- -require("fidget").setup{ --- https://github.com/j-hui/fidget.nvim/blob/main/doc/fidget.md - text = { - spinner = "triangle", - commenced = "started", -- message shown when task starts - completed = "done", -- message shown when task completes - }, -} --- }}} fidget.nvim -- - --- nvim-tree {{{ -- - -require("nvim-tree").setup({ - sort_by = "case_sensitive", - diagnostics = { - enable = false, - icons = { - hint = "❔", - info = "❕", - warning = "❗", - error = "❌", - } - }, - view = { - adaptive_size = true, - }, - renderer = { - group_empty = true, - }, - filters = { - dotfiles = true, - }, -}) - --- }}} nvim-tree -- - --- barbar.nvim {{{ -- - -vim.g.barbar_auto_setup = false -- disable auto-setup - -require'barbar'.setup { - animation = false, - auto_hide = true, - tabpages = true, - closable = true, - clickable = false, - icons = { - diagnostics = { - -- `vim.diagnostic.severity` - [vim.diagnostic.severity.ERROR] = {enabled = true, icon = '❌'}, - [vim.diagnostic.severity.WARN] = {enabled = false}, - [vim.diagnostic.severity.INFO] = {enabled = false}, - [vim.diagnostic.severity.HINT] = {enabled = true}, - }, - filetype = { - custom_colors = false, - enabled = true, - }, - separator = { left = '▎', right = ''}, - modified = { button = '•'}, - pinned = { button = '車', filename = true, separator = { right = ''}}, - }, - - insert_at_end = false, - insert_at_start = false, - - maximum_padding = 1, - minimum_padding = 1, - maximum_length = 30, - semantic_letters = true, - letters = 'arstneoidhqwfpluy;zxcvkmARSTNEOIDHQWFPLUYZXCVKM', - no_name_title = nil, -} - -local nvim_tree_events = require('nvim-tree.events') -local bufferline_api = require('bufferline.api') - -local function get_tree_size() - return require'nvim-tree.view'.View.width -end - -nvim_tree_events.subscribe('TreeOpen', function() - bufferline_api.set_offset(get_tree_size()) -end) - -nvim_tree_events.subscribe('Resize', function() - bufferline_api.set_offset(get_tree_size()) -end) - -nvim_tree_events.subscribe('TreeClose', function() - bufferline_api.set_offset(0) -end) - --- }}} barbar.nvim -- diff --git a/.config/nvim/lua/plugins.lua b/.config/nvim/lua/plugins.lua deleted file mode 100644 index a952ef3..0000000 --- a/.config/nvim/lua/plugins.lua +++ /dev/null @@ -1,168 +0,0 @@ --- ┌───────────────────┐ --- │ ▜ ▗ │ --- │▛▀▖▐ ▌ ▌▞▀▌▄ ▛▀▖▞▀▘│ --- │▙▄▘▐ ▌ ▌▚▄▌▐ ▌ ▌▝▀▖│ --- │▌ ▘▝▀▘▗▄▘▀▘▘ ▘▀▀ │ --- └───────────────────┘ - -return require('packer').startup(function(use) - -- packer can manage itself - use 'wbthomason/packer.nvim' - - -- improve startup time - -- remove when merged - -- https://github.com/neovim/neovim/pull/15436 - use 'lewis6991/impatient.nvim' - - -- latex suite - use {'lervag/vimtex', ft = {'tex', 'latex', 'plaintext'}} - -- provides external ltex file handling and other functions - use 'barreiroleo/ltex-extra.nvim' - - -- treesitter - use { - 'nvim-treesitter/nvim-treesitter', - run = ':TSUpdate' - } - -- quickstart lsp config - use 'neovim/nvim-lspconfig' - -- visualize lsp progress - use { - 'j-hui/fidget.nvim', - branch = 'legacy', - } - -- extra rust-analyzer functionality - use 'simrat39/rust-tools.nvim' - - -- annotation generator - use { - "danymat/neogen", - config = function() - require('neogen').setup {} - end, - requires = "nvim-treesitter/nvim-treesitter", - } - - -- dashboard - use { - 'glepnir/dashboard-nvim', - event = 'VimEnter', - requires = {'nvim-tree/nvim-web-devicons'} - } - - -- completion suite - use 'hrsh7th/nvim-cmp' - use ({ - 'hrsh7th/cmp-nvim-lsp', - 'hrsh7th/cmp-buffer', - 'hrsh7th/cmp-path', - 'quangnguyen30192/cmp-nvim-ultisnips', - after = { 'hrsh7th/nvim-cmp' }, - requires = { 'hrsh7th/nvim-cmp' }, - }) - - -- find, filter, preview, pick - use { - 'nvim-telescope/telescope.nvim', - requires = { 'nvim-lua/plenary.nvim' } - } - use {'nvim-telescope/telescope-fzf-native.nvim', run = 'make' } - - -- git integration for buffers - use { - 'lewis6991/gitsigns.nvim', - requires = { - 'nvim-lua/plenary.nvim' - }, - } - - -- manages tag files - use 'ludovicchabant/vim-gutentags' - -- type in file send to repl - use 'jpalardy/vim-slime' - -- snippets to expand - use {'SirVer/ultisnips', 'honza/vim-snippets'} - -- autopairs for neovim - use 'windwp/nvim-autopairs' - -- indent guides - use 'lukas-reineke/indent-blankline.nvim' - - -- i3 config filetype - use 'mboughaba/i3config.vim' - - -- file explorer - use 'kyazdani42/nvim-tree.lua' - - -- undo tree - use { - 'mbbill/undotree', - cmd = 'UndotreeToggle', - config = [[vim.g.undotree_SetFocusWhenToggle = 1]], - } - - -- highlight colors - use 'norcalli/nvim-colorizer.lua' - - -- cutlass suite, x, d, \ys etc. - use { - 'svermeulen/vim-cutlass', - 'svermeulen/vim-subversive', - 'svermeulen/vim-yoink' - } - - -- personal wiki - use 'vimwiki/vimwiki' - -- change ASCII text to Turkish text - use 'yigitsever/turkish-deasciifier.vim' - - -- text alignment \w :Tab - use 'godlygeek/tabular' - -- move selections up and down with alt+[j,k] - use 'matze/vim-move' - -- surround text objects; sa, sr and sd - use 'machakann/vim-sandwich' - -- see the contents of registers on "/ - use 'junegunn/vim-peekaboo' - -- use k to highlight multiple words) - use 'lfv89/vim-interestingwords' - -- swap delimited items using g>, g< - use 'machakann/vim-swap' - - -- sneak, but in l u a - use 'ggandor/leap.nvim' - -- additional text objects, don't remove this ever again you fuck - use 'wellle/targets.vim' - -- enhanced increment/decrement plugin ala speeddating - use 'monaqa/dial.nvim' - -- comment helper - use 'numToStr/Comment.nvim' - - -- icon pack - use 'nvim-tree/nvim-web-devicons' - -- statusline of the $CURRENT_YEAR - use { - 'nvim-lualine/lualine.nvim', - requires = {'nvim-tree/nvim-web-devicons', opt = true} - } - -- tabline - use {'romgrk/barbar.nvim', wants = 'nvim-web-devicons'} - -- colour theme of the $CURRENT_YEAR - use { "catppuccin/nvim", as = "catppuccin" } - - -- search for, substitute, and abbreviate multiple variants of a word - use 'tpope/vim-abolish' - -- enable repeating supported plugin maps with '.' - use 'tpope/vim-repeat' - -- pairs of handy bracket mappings - use 'tpope/vim-unimpaired' - -- git wrapper - use { - 'tpope/vim-fugitive', cmd = {'Git', 'Gstatus', 'Gblame', 'Gpush', 'Gpull'} - } - -- provides ga, show unicode stuff of char under cursor - use 'tpope/vim-characterize' - -- asynchronous build and test dispatcher - use {'tpope/vim-dispatch', opt = true, cmd = {'Dispatch', 'Make', 'Focus', 'Start'}} - -- automatically adjust 'shiftwidth' and 'expandtab' - use 'tpope/vim-sleuth' -end) diff --git a/.config/nvim/lua/plugins/barbar.lua b/.config/nvim/lua/plugins/barbar.lua new file mode 100644 index 0000000..7b6c69d --- /dev/null +++ b/.config/nvim/lua/plugins/barbar.lua @@ -0,0 +1,77 @@ +return { + { + "romgrk/barbar.nvim", + dependencies = { + 'lewis6991/gitsigns.nvim', + "nvim-tree/nvim-web-devicons" + }, + init = function() + vim.g.barbar_auto_setup = false -- disable auto-setup + local map = require("helpers.keys").map + + -- move to previous/next + map('n', '', 'BufferPrevious', "switch to previous buffer") + map('n', '', 'BufferNext', "switch to next buffer") + + -- re-order to previous/next + map('n', '', 'BufferMovePrevious', "move buffer back") + map('n', '', 'BufferMoveNext', "move buffer forward") + + -- goto buffer in position... + map('n', '', 'BufferGoto 1') + map('n', '', 'BufferGoto 2') + map('n', '', 'BufferGoto 3') + map('n', '', 'BufferGoto 4') + map('n', '', 'BufferGoto 5') + map('n', '', 'BufferGoto 6') + map('n', '', 'BufferGoto 7') + map('n', '', 'BufferGoto 8') + map('n', '', 'BufferGoto 9') + map('n', '', 'BufferLast') + + -- pin/unpin buffer + map('n', '', 'BufferPin', "pin buffer") + -- close buffer + map('n', '', 'BufferClose', "close buffer") + -- magic buffer-picking mode + map('n', 'dg', 'BufferPick', "buffer picking mode") + -- sort automatically by... + map('n', 'db', 'BufferOrderByBufferNumber', "sort buffers by number") + map('n', 'dd', 'BufferOrderByDirectory', "sort buffers by directory") + map('n', 'dl', 'BufferOrderByLanguage', "sort buffers by language") + map('n', 'dw', 'BufferOrderByWindowNumber', "sort buffers by window number") + end, + opts = { + animation = false, + auto_hide = true, + tabpages = true, + closable = true, + clickable = false, + icons = { + diagnostics = { + [vim.diagnostic.severity.ERROR] = {enabled = true, icon = '❌'}, + [vim.diagnostic.severity.WARN] = {enabled = false}, + [vim.diagnostic.severity.INFO] = {enabled = false}, + [vim.diagnostic.severity.HINT] = {enabled = true}, + }, + filetype = { + custom_colors = false, + enabled = true, + }, + separator = { left = '▎', right = ''}, + modified = { button = ''}, + pinned = { button = '', filename = true, separator = { right = ''}}, + }, + + insert_at_end = false, + insert_at_start = false, + + maximum_padding = 1, + minimum_padding = 1, + maximum_length = 30, + semantic_letters = true, + letters = 'arstneoidhqwfpluy;zxcvkmARSTNEOIDHQWFPLUYZXCVKM', + no_name_title = nil, + }, + }, +} diff --git a/.config/nvim/lua/plugins/cmp.lua b/.config/nvim/lua/plugins/cmp.lua new file mode 100644 index 0000000..78ff9a9 --- /dev/null +++ b/.config/nvim/lua/plugins/cmp.lua @@ -0,0 +1,114 @@ +-- autocompletion +return { + { + "hrsh7th/nvim-cmp", + event = "InsertEnter", + dependencies = { + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-nvim-lua", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + "L3MON4D3/LuaSnip", + "saadparwaiz1/cmp_luasnip", + "rafamadriz/friendly-snippets", + }, + config = function() + local cmp = require("cmp") + local luasnip = require("luasnip") + + require("luasnip/loaders/from_vscode").lazy_load() + + local kind_icons = { + Text = "󰊄", + Method = "m", + Function = "󰊕", + Constructor = "", + Field = "󰽏", + Variable = "󰫧", + Class = "󰌗", + Interface = "", + Module = "", + Property = "", + Unit = "", + Value = "󰎠", + Enum = "", + Keyword = "", + Snippet = "", + Color = "󰏘", + File = "󰈙", + Reference = "", + Folder = "󰉋", + EnumMember = "", + Constant = "󰇽", + Struct = "", + Event = "", + Operator = "󰆕", + TypeParameter = "", + } + + cmp.setup({ + enabled = true, + snippet = { + expand = function(args) + luasnip.lsp_expand(args.body) + end, + }, + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.select_prev_item(), + [""] = cmp.mapping.select_next_item(), + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.confirm({ + behavior = cmp.ConfirmBehavior.Replace, + select = false, + }), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + elseif luasnip.expand_or_jumpable() then + luasnip.expand_or_jump() + else + fallback() + end + end, { "i", "s" }), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif luasnip.jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, { "i", "s" }), + }), + formatting = { + fields = { "kind", "abbr", "menu" }, + format = function(entry, vim_item) + -- kind icons + vim_item.kind = string.format("%s", kind_icons[vim_item.kind]) + vim_item.menu = ({ + nvim_lsp = "[lsp]", + luasnip = "[snippet]", + buffer = "[buffer]", + path = "[path]", + })[entry.source.name] + return vim_item + end, + }, + sources = { + { name = "nvim_lsp" }, + { name = "luasnip" }, + { name = "buffer" }, + { name = "path" }, + }, + }) + + -- If you want insert `(` after select function or method item + local cmp_autopairs = require('nvim-autopairs.completion.cmp') + cmp.event:on( + 'confirm_done', + cmp_autopairs.on_confirm_done() + ) + end, + }, +} diff --git a/.config/nvim/lua/plugins/colorscheme.lua b/.config/nvim/lua/plugins/colorscheme.lua new file mode 100644 index 0000000..969d304 --- /dev/null +++ b/.config/nvim/lua/plugins/colorscheme.lua @@ -0,0 +1,45 @@ +return { + { + "catppuccin/nvim", + name = "catppuccin", + lazy = false, + priority = 1000, + config = function() + require("catppuccin").setup({ + flavour = "mocha", -- latte, frappe, macchiato, mocha + background = { + light = "latte", + dark = "mocha", + }, + transparent_background = false, + term_colors = false, + no_italic = true, -- force no italic + no_bold = false, -- force no bold + integrations = { + barbar = true, + cmp = true, + fidget = true, + gitsigns = true, + leap = true, + nvimtree = true, + telescope = true, + treesitter = true, + vimwiki = true, + }, + native_lsp = { + enabled = true, + underlines = { + errors = { "underline" }, + hints = { "underline" }, + warnings = { "underline" }, + information = { "underline" }, + }, + }, + indent_blankline = { + enabled = true, + }, + }) + vim.cmd("colorscheme catppuccin") + end, + }, +} diff --git a/.config/nvim/lua/plugins/cutlass.lua b/.config/nvim/lua/plugins/cutlass.lua new file mode 100644 index 0000000..0b8ef52 --- /dev/null +++ b/.config/nvim/lua/plugins/cutlass.lua @@ -0,0 +1,51 @@ +return { + { + 'svermeulen/vim-cutlass', + }, + { + 'svermeulen/vim-subversive', + config = function() + local map = require("helpers.keys").map + + -- substitute from yank + map('n', 'ys', '(SubversiveSubstitute)', "substitute from yank") + map('n', 'yss', '(SubversiveSubstituteLine)', "substitute from yank, line") + map('n', 'yS', '(SubversiveSubstituteToEndOfLine)', "substitute from yank, eol") + + -- substitute over range + map( { 'n', 'x' }, 's', '(SubversiveSubstituteRange)', "start substitude over range") + map('n', 'ss', '(SubversiveSubstituteWordRange)', "start substitude over range") + end + }, + { + 'svermeulen/vim-yoink', + config = function() + vim.g.yoinkIncludeDeleteOperations = 1 + + -- fix the Target STRING not available + vim.g.clipboard = { + name = 'xsel_override', + copy = { + ['+'] = 'xsel --input --clipboard', + ['*'] = 'xsel --input --primary', + }, + paste = { + ['+'] = 'xsel --output --clipboard', + ['*'] = 'xsel --output --primary', + }, + cache_enabled = 1, + } + + local map = require("helpers.keys").map + + -- yoink paste + map('n', 'p', '(YoinkPaste_p)') + map('n', 'P', '(YoinkPaste_P)') + + -- iterate over yank list + map('n', '', '(YoinkPostPasteSwapBack)') + map('n', '', '(YoinkPostPasteSwapForward)') + + end, + } +} diff --git a/.config/nvim/lua/plugins/dashboard.lua b/.config/nvim/lua/plugins/dashboard.lua new file mode 100644 index 0000000..074d3f5 --- /dev/null +++ b/.config/nvim/lua/plugins/dashboard.lua @@ -0,0 +1,36 @@ +return { + { + 'glepnir/dashboard-nvim', + event = 'VimEnter', + config = function() + require('dashboard').setup { + theme = 'hyper', + change_to_vcs_root = true, + config = { + week_header = { + enable = true, + }, + shortcut = { + { + desc = '󰊳 Update', group = '@property', action = 'Lazy update', key = 'u', + }, + { + icon = ' ', + icon_hl = '@variable', + desc = 'Files', + group = 'Label', + action = 'Telescope find_files', + key = 'f', + }, + }, + }, + + } + end, + dependencies = { + { + 'nvim-tree/nvim-web-devicons' + } + } + } +} diff --git a/.config/nvim/lua/plugins/devicons.lua b/.config/nvim/lua/plugins/devicons.lua new file mode 100644 index 0000000..712ecc6 --- /dev/null +++ b/.config/nvim/lua/plugins/devicons.lua @@ -0,0 +1,25 @@ +return { + { + "nvim-tree/nvim-web-devicons", + opts = { + override = { + wiki = { + icon = "󰂺", + color = "#D7827E", + name = "vimwiki" + }, + rem = { + icon = " ", + color = "#B4637A", + name = "remind" + }, + mail = { + icon = "󰇰 ", + color = "#907AA9", + name = "mail" + }, + }, + default = true + }, + }, +} diff --git a/.config/nvim/lua/plugins/git.lua b/.config/nvim/lua/plugins/git.lua new file mode 100644 index 0000000..0e4d7f5 --- /dev/null +++ b/.config/nvim/lua/plugins/git.lua @@ -0,0 +1,95 @@ +return { + { + "lewis6991/gitsigns.nvim", + opts = { + signs = { + add = { text = '│' }, + change = { text = '│' }, + delete = { text = '_' }, + topdelete = { text = '‾' }, + changedelete = { text = '~' }, + untracked = { text = '┆' }, + }, + signcolumn = true, -- Toggle with `:Gitsigns toggle_signs` + numhl = false, -- Toggle with `:Gitsigns toggle_numhl` + linehl = false, -- Toggle with `:Gitsigns toggle_linehl` + word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff` + watch_gitdir = { + follow_files = true + }, + attach_to_untracked = true, + current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame` + current_line_blame_opts = { + virt_text = true, + virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align' + delay = 1000, + ignore_whitespace = false, + }, + current_line_blame_formatter = ', - ', + sign_priority = 6, + update_debounce = 100, + status_formatter = nil, -- Use default + max_file_length = 40000, -- Disable if file is longer than this (in lines) + preview_config = { + -- Options passed to nvim_open_win + border = 'single', + style = 'minimal', + relative = 'cursor', + row = 0, + col = 1 + }, + yadm = { + enable = true + }, + + on_attach = function(bufnr) + local gs = package.loaded.gitsigns + + local function map(mode, l, r, desc, opts) + opts = opts or {} + opts.buffer = bufnr + opts.desc = desc + vim.keymap.set(mode, l, r, opts) + end + + -- navigation + map('n', ']c', function() + if vim.wo.diff then return ']c' end + vim.schedule(function() gs.next_hunk() end) + return '' + end, "jump to next hunk", { expr = true }) + + map('n', '[c', function() + if vim.wo.diff then return '[c' end + vim.schedule(function() gs.prev_hunk() end) + return '' + end, "jump to previous hunk", { expr = true }) + + -- Actions + map('n', 'hs', gs.stage_hunk, "stage hunk") + map('n', 'hr', gs.reset_hunk, "reset hunk") + map('v', 'hs', function() gs.stage_hunk { vim.fn.line('.'), vim.fn.line('v') } end, + "stage selection") + map('v', 'hr', function() gs.reset_hunk { vim.fn.line('.'), vim.fn.line('v') } end, + "reset selection") + map('n', 'hS', gs.stage_buffer, "stage buffer") + map('n', 'hu', gs.undo_stage_hunk, "undo stage hunk") + map('n', 'hR', gs.reset_buffer, "undo reset buffer") + map('n', 'hp', gs.preview_hunk, "preview hunk") + map('n', 'hb', function() gs.blame_line { full = true } end, "blame line") + map('n', 'tb', gs.toggle_current_line_blame, "toggle current line blame") + map('n', 'hd', gs.diffthis, "diff this") + map('n', 'hD', function() gs.diffthis('~') end, "diff whole buffer") + map('n', 'td', gs.toggle_deleted, "toggle deleted") + + -- Text object + map({ 'o', 'x' }, 'ih', ':Gitsigns select_hunk', "select hunk") + end + + }, + }, + { + "tpope/vim-fugitive", + cmd = { 'Git', 'Gstatus', 'Gblame', 'Gpush', 'Gpull' }, + }, +} diff --git a/.config/nvim/lua/plugins/indent-blankline.lua b/.config/nvim/lua/plugins/indent-blankline.lua new file mode 100644 index 0000000..42e5c62 --- /dev/null +++ b/.config/nvim/lua/plugins/indent-blankline.lua @@ -0,0 +1,14 @@ +return { + { + "lukas-reineke/indent-blankline.nvim", + init = function() + vim.opt.list = true + end, + config = { + show_current_context = true, + char = "┊", + buftype_exclude = {"terminal"}, + filetype_exclude = {"dashboard", "help", "man"} + }, + }, +} diff --git a/.config/nvim/lua/plugins/latex.lua b/.config/nvim/lua/plugins/latex.lua new file mode 100644 index 0000000..8582c6f --- /dev/null +++ b/.config/nvim/lua/plugins/latex.lua @@ -0,0 +1,16 @@ +return { + { + "lervag/vimtex", + ft = { 'tex', 'latex', 'plaintext' }, + init = function() + vim.g.vimtex_view_method = 'zathura' + vim.g.vimtex_quickfix_mode = 0 + vim.g.vimtex_quickfix_ignore_filters = {"Underfull", "Overfull"} + vim.g.vimtex_compiler_latexmk = { + options = { + "-pdf", '-shell-escape', '-verbose', '-file-line-error', '-synctex=1', '-interaction=nonstopmode' + } + } + end, + }, +} diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua new file mode 100644 index 0000000..d03d9af --- /dev/null +++ b/.config/nvim/lua/plugins/lsp.lua @@ -0,0 +1,236 @@ +return { + { + "neovim/nvim-lspconfig", + dependencies = { + "williamboman/mason.nvim", + "williamboman/mason-lspconfig.nvim", + "j-hui/fidget.nvim", + "folke/neodev.nvim", + "RRethy/vim-illuminate", + "hrsh7th/cmp-nvim-lsp", + }, + config = function() + local map = require("helpers.keys").map + + map('n', 'e', vim.diagnostic.open_float, "lsp: open diagnostics float") + map('n', '[d', vim.diagnostic.goto_prev, "lsp: goto previous diagnostic") + map('n', ']d', vim.diagnostic.goto_next, "lsp: goto next diagnostic") + + -- set up mason before anything else + require("mason").setup() + require("mason-lspconfig").setup({ + ensure_installed = { + "lua_ls", + "pylsp", + }, + automatic_installation = true, + }) + + -- quick access via keymap + require("helpers.keys").map("n", "M", "Mason", "show mason") + + -- neodev setup before lsp config + require("neodev").setup() + + -- set up cool signs for diagnostics + local signs = { Error = " ", Warn = "", Hint = "", Info = "" } + for type, icon in pairs(signs) do + local hl = "DiagnosticSign" .. type + vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" }) + end + + -- Diagnostic config + local config = { + virtual_text = false, + signs = { + active = signs, + }, + update_in_insert = true, + underline = true, + severity_sort = true, + float = { + focusable = true, + style = "minimal", + border = "rounded", + source = "always", + header = "", + prefix = "", + }, + } + vim.diagnostic.config(config) + + -- this function gets run when an lsp connects to a particular buffer. + local on_attach = function(client, bufnr) + map = require("helpers.keys").lsp_map + + map("lr", vim.lsp.buf.rename, bufnr, "lsp: rename symbol") + map("la", vim.lsp.buf.code_action, bufnr, "lsp: code action") + map("ld", vim.lsp.buf.type_definition, bufnr, "lsp: type definition") + map("ls", require("telescope.builtin").lsp_document_symbols, bufnr, "lsp: document symbols") + + map("gd", vim.lsp.buf.definition, bufnr, "lsp: goto definition") + map("gD", vim.lsp.buf.declaration, bufnr, "lsp: goto declaration") + map("gr", require("telescope.builtin").lsp_references, bufnr, "lsp: goto references") + map("gI", vim.lsp.buf.implementation, bufnr, "lsp: goto implementation") + map("K", vim.lsp.buf.hover, bufnr, "lsp: hover documentation") + map("", vim.lsp.buf.signature_help, bufnr, "lsp: signature help") + + -- Create a command `:Format` local to the LSP buffer + vim.api.nvim_buf_create_user_command(bufnr, "Format", function(_) + vim.lsp.buf.format() + end, { desc = "lsp: format current buffer" }) + + map("fm", "Format", bufnr, "lsp: format current buffer") + + -- Attach and configure vim-illuminate + -- apparently this is deprecated + -- https://github.com/RRethy/vim-illuminate/issues/111 + require("illuminate").on_attach(client) + end + + -- nvim-cmp supports additional completion capabilities, so broadcast that to servers + local capabilities = vim.lsp.protocol.make_client_capabilities() + capabilities = require("cmp_nvim_lsp").default_capabilities(capabilities) + + -- lua + require("lspconfig")["lua_ls"].setup({ + on_attach = on_attach, + capabilities = capabilities, + settings = { + Lua = { + completion = { + callSnippet = "Replace", + }, + diagnostics = { + globals = { "vim" }, + }, + workspace = { + library = { + [vim.fn.expand("$VIMRUNTIME/lua")] = true, + [vim.fn.stdpath("config") .. "/lua"] = true, + }, + }, + }, + }, + }) + + -- python + require("lspconfig")["pylsp"].setup({ + on_attach = on_attach, + capabilities = capabilities, + settings = { + pylsp = { + plugins = { + flake8 = { + enabled = true, + maxLineLength = 88, -- black's line length + }, + -- disable plugins overlapping with flake8 + pycodestyle = { + enabled = false, + }, + mccabe = { + enabled = false, + }, + pyflakes = { + enabled = false, + }, + -- use black as the formatter + autopep8 = { + enabled = false, + }, + }, + }, + }, + }) + + -- efm + require("lspconfig")["efm"].setup({ + on_attach = on_attach, + filetypes = { 'sh' }, + capabilities = capabilities + }) + + -- ltex + require("lspconfig")["ltex"].setup({ + capabilities = capabilities, + on_attach = function(client, bufnr) + on_attach(client, bufnr) + require("ltex_extra").setup { + load_langs = { "en-GB" }, + init_check = true, + log_level = "none", + } + end, + settings = { + ltex = { + -- my settings here + } + } + }) + + -- rust-tools + local rust_opts = { + tools = { + runnables = { + use_telescope = true, + }, + inlay_hints = { + auto = true, + show_parameter_hints = true, + parameter_hints_prefix = "↸ ", + other_hints_prefix = "❱ ", + }, + }, + + -- all the opts to send to nvim-lspconfig + -- these override the defaults set by rust-tools.nvim + -- see https://github.com/neovim/nvim-lspconfig/blob/master/CONFIG.md#rust_analyzer + server = { + on_attach = on_attach, + settings = { + -- to enable rust-analyzer settings visit: + -- https://github.com/rust-analyzer/rust-analyzer/blob/master/docs/user/generated_config.adoc + ["rust-analyzer"] = { + -- enable clippy on save + checkOnSave = { + command = "clippy", + }, + }, + }, + }, + } + + require('rust-tools').setup(rust_opts) + end, + }, + { + "barreiroleo/ltex-extra.nvim", + event = "LspAttach", + }, + { + "j-hui/fidget.nvim", + tag = "legacy", + event = "LspAttach", + opts = { + text = { + spinner = "triangle", + commenced = "started", -- message shown when task starts + completed = "done", -- message shown when task completes + }, + }, + }, + { + "simrat39/rust-tools.nvim", + event = "LspAttach", + }, + -- { + -- "RRethy/vim-illuminate", + -- opts = { + -- filetypes_denylist = { + -- 'NvimTree', + -- 'fugitive', + -- }, + -- }, + -- }, +} diff --git a/.config/nvim/lua/plugins/lualine.lua b/.config/nvim/lua/plugins/lualine.lua new file mode 100644 index 0000000..c528b69 --- /dev/null +++ b/.config/nvim/lua/plugins/lualine.lua @@ -0,0 +1,84 @@ +return { + "nvim-lualine/lualine.nvim", + dependencies = { + "nvim-tree/nvim-web-devicons" + }, + config = function() + local function lualine_spell() + if vim.wo.spell then + return "spell" + else + return + end + end + + local conditions = { + spell_on = function () + return vim.wo.spell + end, + filetype_is_tex = function() + return vim.bo.filetype == "tex" + end + } + + -- https://www.reddit.com/r/neovim/comments/u2uc4p/your_lualine_custom_features/i4muvp6/ + -- override 'encoding': don't display if encoding is utf-8. + local encoding = function() + local ret, _ = vim.bo.fenc:gsub("^utf%-8$", "") + return ret + end + + -- fileformat: don't display if &ff is unix. + local fileformat = function() + local ret, _ = vim.bo.fileformat:gsub("^unix$", "") + return ret + end + + require("lualine").setup({ + options = { + icons_enabled = true, + theme = "catppuccin", + section_separators = { left = '', right = '' }, + component_separators = { left = '', right = '' }, + }, + sections = { + lualine_a = {{'mode', fmt = string.lower}}, + lualine_b = {'branch', + { + 'diff', + diff_color= { + added = { fg = 'LightGreen' }, + modified = { fg = 'LightBlue' }, + removed = { fg = 'LightRed' }, + } + }, + { + lualine_spell, + cond = conditions.spell_on, + }}, + lualine_c = {'filename'}, + lualine_x = {encoding, fileformat, 'filetype'}, + lualine_y = {'progress'}, + lualine_z = { + 'location', { + 'diagnostics', + sources = {'nvim_diagnostic'}, + sections = {'error', 'warn', 'info', 'hint'}, + symbols = {error = 'e', warn = 'w', info = 'i', hint = 'h'} + } + } + }, + inactive_sections = { + lualine_a = {}, + lualine_b = {}, + lualine_c = {'filename'}, + lualine_x = {}, + lualine_y = {}, + lualine_z = {} + }, + tabline = {}, + extensions = {} + + }) + end, +} diff --git a/.config/nvim/lua/plugins/misc.lua b/.config/nvim/lua/plugins/misc.lua new file mode 100644 index 0000000..f99051e --- /dev/null +++ b/.config/nvim/lua/plugins/misc.lua @@ -0,0 +1,83 @@ +return { + { + "numToStr/Comment.nvim", + lazy = false, + opts = {}, + }, + { + "godlygeek/tabular", + lazy = false, + }, + { + "matze/vim-move" + }, + { + "ggandor/leap.nvim", + lazy = false, + init = function() + local map = require("helpers.keys").map + + map({ "n", "v" }, '`', '(leap-forward)', "leap forward") + map({ "n", "v" }, '`', '(leap-backward)', "leap backward") + end, + opts = { + case_insensitive = true, + substitute_chars = { ['\r'] = '¬' } + } + }, + { + "wellle/targets.vim" + }, + { + "monaqa/dial.nvim", + init = function() + local augend = require("dial.augend") + require("dial.config").augends:register_group { + -- default augends used when no group name is specified + default = { + augend.integer.alias.decimal, -- nonnegative decimal number (0, 1, 2, 3, ...) + augend.integer.alias.hex, -- nonnegative hex number (0x01, 0x1a1f, etc.) + augend.date.alias["%Y/%m/%d"], -- date (2022/02/19, etc.) + augend.date.alias["%Y-%m-%d"], + augend.semver.alias.semver, + augend.constant.new { + elements = { "and", "or" }, + word = true, -- if false, "sand" is incremented into "sor", "doctor" into "doctand", etc. + cyclic = true, -- "or" is incremented into "and". + }, + augend.constant.new { + elements = { "&&", "||" }, + word = false, + cyclic = true, + }, + }, + } + local map = require("helpers.keys").map + map("n", "", require("dial.map").inc_normal(), "dial: increment") + map("n", "", require("dial.map").dec_normal(), "dial: decrement") + map("v", "", require("dial.map").inc_visual(), "dial: visual increment") + map("v", "", require("dial.map").dec_visual(), "dial: visual decrement") + end, + }, + { + "kylechui/nvim-surround", + version = "*", -- Use for stability; omit to use `main` branch for the latest features + event = "VeryLazy", + config = function() + require("nvim-surround").setup({}) + end + }, + { + "windwp/nvim-autopairs", + event = "InsertEnter", + opts = { + disable_filetype = { "TelescopePrompt" }, + }, + init = function() + local Rule = require('nvim-autopairs.rule') + local npairs = require('nvim-autopairs') + + npairs.add_rule(Rule('%"', '%"', "remind")) + end + }, +} diff --git a/.config/nvim/lua/plugins/nvim-tree.lua b/.config/nvim/lua/plugins/nvim-tree.lua new file mode 100644 index 0000000..a2d4532 --- /dev/null +++ b/.config/nvim/lua/plugins/nvim-tree.lua @@ -0,0 +1,40 @@ +return { + { + "nvim-tree/nvim-tree.lua", + lazy = false, + dependencies = { + "nvim-tree/nvim-web-devicons", + }, + opts = { + sort_by = "case_sensitive", + diagnostics = { + enable = false, + icons = { + hint = "❔", + info = "❕", + warning = "❗", + error = "❌", + } + }, + view = { + adaptive_size = true, + }, + renderer = { + group_empty = true, + }, + filters = { + dotfiles = true, + }, + }, + init = function() + vim.g.loaded_netrw = 1 + vim.g.loaded_netrwPlugin = 1 + + local map = require("helpers.keys").map + + map("n", "vt", "NvimTreeToggle") + map("n", "vr", "NvimTreeRefresh") + map("n", "vs", "NvimTreeFindFile") + end, + }, +} diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua new file mode 100644 index 0000000..ecea32b --- /dev/null +++ b/.config/nvim/lua/plugins/telescope.lua @@ -0,0 +1,45 @@ +return { + { + "nvim-telescope/telescope.nvim", + dependencies = { + "nvim-lua/plenary.nvim", + { + "nvim-telescope/telescope-fzf-native.nvim", + build = "make", + cond = vim.fn.executable("make") == 1 + }, + }, + config = function() + require('telescope').setup({ + extensions = { + fzf = { + fuzzy = true, -- false will only do exact matching + override_generic_sorter = true, + override_file_sorter = true, + case_mode = "smart_case", + } + } + }) + -- Enable telescope fzf native, if installed + pcall(require("telescope").load_extension, "fzf") + + local map = require("helpers.keys").map + + map("n", "fr", require("telescope.builtin").oldfiles, "recently opened") + map("n", "", require("telescope.builtin").buffers, "open buffers") + map("n", "/", function() + -- You can pass additional configuration to telescope to change theme, layout, etc. + require("telescope.builtin").current_buffer_fuzzy_find(require("telescope.themes").get_dropdown({ + winblend = 10, + previewer = false, + })) + end, "search in current buffer") + + map("n", "sf", require("telescope.builtin").find_files, "files") + map("n", "sh", require("telescope.builtin").help_tags, "help") + map("n", "sw", require("telescope.builtin").grep_string, "current word") + map("n", "sg", require("telescope.builtin").live_grep, "grep") + map("n", "sd", require("telescope.builtin").diagnostics, "diagnostics") + end, + }, +} diff --git a/.config/nvim/lua/plugins/tpope.lua b/.config/nvim/lua/plugins/tpope.lua new file mode 100644 index 0000000..5396303 --- /dev/null +++ b/.config/nvim/lua/plugins/tpope.lua @@ -0,0 +1,11 @@ +return { + { + "tpope/vim-repeat" + }, + { + "tpope/vim-unimpaired" + }, + { + "tpope/vim-characterize" + }, +} diff --git a/.config/nvim/lua/plugins/treesitter.lua b/.config/nvim/lua/plugins/treesitter.lua new file mode 100644 index 0000000..c454b48 --- /dev/null +++ b/.config/nvim/lua/plugins/treesitter.lua @@ -0,0 +1,73 @@ +return { + { + "nvim-treesitter/nvim-treesitter", + build = function() + pcall(require("nvim-treesitter.install").update({ with_sync = true })) + end, + dependencies = { + "nvim-treesitter/nvim-treesitter-textobjects", + }, + config = function() + require("nvim-treesitter.configs").setup({ + ensure_installed = { "bash", "bibtex", "c", "cpp", "css", "fish", "http", "latex", "lua", "python", "rust", "vim" }, + ignore_install = { }, + auto_install = true, + sync_install = false, + highlight = { + enable = true, + disable = { "latex" }, + additional_vim_regex_highlighting = false, + }, + indent = { + enable = true, + disable = { "python" } + }, + incremental_selection = { + enable = true, + keymaps = { + init_selection = "gnn", + node_incremental = "grn", + scope_incremental = "grc", + node_decremental = "grm", + }, + }, + textobjects = { + select = { + enable = true, + lookahead = true, -- automatically jump forward to textobj, similar to targets.vim + keymaps = { + -- you can use the capture groups defined in textobjects.scm + ["aa"] = "@parameter.outer", + ["ia"] = "@parameter.inner", + ["af"] = "@function.outer", + ["if"] = "@function.inner", + ["ac"] = "@class.outer", + ["ic"] = "@class.inner", + }, + }, + move = { + enable = true, + set_jumps = true, -- whether to set jumps in the jumplist + goto_next_start = { + ["]m"] = "@function.outer", + ["]]"] = "@class.outer", + }, + goto_next_end = { + ["]M"] = "@function.outer", + ["]["] = "@class.outer", + }, + goto_previous_start = { + ["[m"] = "@function.outer", + ["[["] = "@class.outer", + }, + goto_previous_end = { + ["[M"] = "@function.outer", + ["[]"] = "@class.outer", + }, + }, + }, + modules = { }, + }) + end, + }, +} diff --git a/.config/nvim/lua/plugins/trouble.lua b/.config/nvim/lua/plugins/trouble.lua new file mode 100644 index 0000000..6d72bd9 --- /dev/null +++ b/.config/nvim/lua/plugins/trouble.lua @@ -0,0 +1,14 @@ +return { + "folke/trouble.nvim", + dependencies = { "nvim-tree/nvim-web-devicons" }, + opts = {}, + config = function() + local map = require("helpers.keys").map + map("n", "xx", function() require("trouble").open() end, "trouble: open") + map("n", "xw", function() require("trouble").open("workspace_diagnostics") end, "trouble: open workspace diagnostics") + map("n", "xd", function() require("trouble").open("document_diagnostics") end, "trouble: open document diagnostics") + map("n", "xq", function() require("trouble").open("quickfix") end, "trouble: open quickfix") + map("n", "xl", function() require("trouble").open("loclist") end, "trouble: open loclist") + map("n", "gR", function() require("trouble").open("lsp_references") end, "trouble: open lsp references") + end, +} diff --git a/.config/nvim/lua/plugins/turkish-deasciifier.lua b/.config/nvim/lua/plugins/turkish-deasciifier.lua new file mode 100644 index 0000000..c39a35d --- /dev/null +++ b/.config/nvim/lua/plugins/turkish-deasciifier.lua @@ -0,0 +1,24 @@ +return { + { + "yigitsever/turkish-deasciifier.vim", + init = function() + local map = require("helpers.keys").map + + -- brute force deasciify everything + map({ "n", "x" }, "tc", "TurkishDeasciifyForce()", "force turkish characters", + { expr = true }) + map("n", "tctc", "TurkishDeasciifyForce() .. '_'", "force turkish characters eol", + { expr = true }) + + -- use turkish-mode to selectively deasciify + map({ "n", "x" }, "tr", "TurkishDeasciify()", "infer turkish characters", { expr = true }) + map("n", "trtr", "TurkishDeasciify() .. '_'", "infer turkish characters eol", + { expr = true }) + + -- ascii everything + map({ "n", "x" }, "rt", "TurkishAsciify()", "remove turkish characters", { expr = true }) + map("n", "rtrt", "TurkishAsciify() .. '_'", "remove turkish characters eol", + { expr = true }) + end, + } +} diff --git a/.config/nvim/lua/plugins/vimwiki.lua b/.config/nvim/lua/plugins/vimwiki.lua new file mode 100644 index 0000000..11d4c2b --- /dev/null +++ b/.config/nvim/lua/plugins/vimwiki.lua @@ -0,0 +1,28 @@ +return { + { + "vimwiki/vimwiki", + init = function () + vim.g.vimwiki_list = { + { + path = '/home/yigit/nextcloud/personal_wiki/text', + path_html = '/home/yigit/nextcloud/personal_wiki/html', + auto_generate_tags = 1, + automatic_nested_syntaxes = 1, + template_path = '/home/yigit/nextcloud/personal_wiki/templates', + template_default = 'default_template', + template_ext = '.html', + auto_export = 1, + auto_tags = 1 + } + } + vim.g.vimwiki_hl_headers = 1 + + local map = require("helpers.keys").map + + --toggle checkmarks + map('n', 'v', 'VimwikiToggleListItem', "vimwiki: toggle checkmark") + -- add/increase header level + map('n', 'a', 'VimwikiAddHeaderLevel', "vimwiki: add header level") + end, + }, +} diff --git a/.config/nvim/lua/plugins/which-key.lua b/.config/nvim/lua/plugins/which-key.lua new file mode 100644 index 0000000..21048b9 --- /dev/null +++ b/.config/nvim/lua/plugins/which-key.lua @@ -0,0 +1,14 @@ +return { + { + "folke/which-key.nvim", + event = "VeryLazy", + init = function() + vim.o.timeout = true + vim.o.timeoutlen = 500 + end, + config = function() + local wk = require("which-key") + wk.setup() + end, + } +} diff --git a/.config/nvim/lua/settings.lua b/.config/nvim/lua/settings.lua deleted file mode 100644 index 27ad40d..0000000 --- a/.config/nvim/lua/settings.lua +++ /dev/null @@ -1,101 +0,0 @@ --- ┌───────────────────────┐ --- │ ▐ ▐ ▗ │ --- │▞▀▘▞▀▖▜▀ ▜▀ ▄ ▛▀▖▞▀▌▞▀▘│ --- │▝▀▖▛▀ ▐ ▖▐ ▖▐ ▌ ▌▚▄▌▝▀▖│ --- │▀▀ ▝▀▘ ▀ ▀ ▀▘▘ ▘▗▄▘▀▀ │ --- └───────────────────────┘ - -local o = vim.o -- [o]ptions -local wo = vim.wo -- [w]indow-local [o]ptions -local bo = vim.bo -- [b]uffer-local [o]ptions -local go = vim.go -- [g]lobal [o]ptions -local opt = vim.opt -- convenient :set - --- neovim filetype lua -go.do_filetype_lua = true -go.did_load_filetypes = false - --- look & feel -o.termguicolors = true - --- interact with system clipboard -opt.clipboard:append('unnamedplus') - --- copy indent on a new line -o.autoindent = true - --- :h tabstop, 2. point --- use appropriate number of spaces to insert a -o.expandtab = true -o.shiftwidth = 4 -o.softtabstop = 4 -o.tabstop = 8 - --- use english for spellchecking, but don't spellcheck by default -wo.spell = true -bo.spelllang = "en_gb" -wo.spell = false - --- tab completion, zsh style -o.wildmode = "longest:full,full" -opt.wildignore = { - '*.o', '*.obj', '*.class', '*.aux', '*.lof', '*.log', '*.lot', '*.fls', - '*.toc', '*.fmt', '*.fot', '*.cb', '*.cb2', '.*.lb', '.dvi', '*.xdv', - '*.bbl', '*.bcf', '*.blg', '*-blx.aux', '*-blx.bib', '*.run.xml', - '*.fdb_latexmk', '*.synctex', '*.synctex(busy)', '*.synctex.gz', - '*.synctex.gz(busy)', '*.pdfsync' -} - --- put one space while joining (not two) -o.joinspaces = false - --- keep n lines above/below cursor while scrolling -o.scrolloff = 4 --- line numbers -o.number = true --- fold manually, when I place markers -o.foldmethod = "marker" --- set the terminal title -o.title = true --- wrap using 'breakat' character -o.linebreak = true --- new split panes will split to below and right -o.splitbelow = true -o.splitright = true --- highlight the current line, yoc undoes -o.cursorline = true --- current line actual number, rest are relative -o.relativenumber = true --- we are already using a cursorline, don't clobber linter messages -o.showmode = false --- jump to the matching bracket briefly -o.showmatch = true --- wait 500 ms for a mapped sequence to complete -o.timeoutlen = 500 - --- persistent undo -o.undofile = true - --- lower case searches ignore case, upper case searches do not -o.ignorecase = true -o.smartcase = true - --- https://stackoverflow.com/a/3445040/ --- switch case labels -o.cinoptions = "l1" - -if vim.fn.executable("rg") then - o.grepprg = "rg --vimgrep --no-heading --smart-case" - o.grepformat = "%f:%l:%c:%m,%f:%l:%m" -end - --- iwhite: ignore changes in amount of white space. --- vertical: start diff mode with vertical splits --- filler: show filler lines, -opt.diffopt = { - "iwhite", "vertical", "filler", "algorithm:patience", "indent-heuristic" -} - --- menu: use a popup menu to show the possible completions --- preview: show extra information -opt.completeopt = {"menu", "menuone", "noselect"} diff --git a/.config/nvim/lua/stale.lua b/.config/nvim/lua/stale.lua deleted file mode 100644 index 0c79884..0000000 --- a/.config/nvim/lua/stale.lua +++ /dev/null @@ -1,159 +0,0 @@ -local M = {} -_VT_NS = vim.api.nvim_create_namespace("lsp_signature") - -local prescript -local prescript_hi -local due_hi -local ft -local future -local future_hi -local date_hi -local pattern_start -local pattern_end - -local use_clock_time -local default_due_time - --- local date_pattern -local datetime_pattern -local datetime_pattern_match - -local function parseDue(due) - local year = 31556926 - local month = 2629743 - local week = 604800 - local day = 86400 - local hour = 3600 - local minute = 60 - local res = '' - - if due >= year then - res = res .. math.floor(due / year) .. 'y ' - due = due % year - end - - if due >= month then - res = res .. math.floor(due / month) .. 'm ' - due = due % month - end - - if due >= week then - res = res .. math.floor(due / week) .. 'w ' - due = due % week - end - - if use_clock_time == true then - if due >= day then - res = res .. math.floor(due / day) .. 'd ' - due = due % day - end - - if due >= hour then - res = res .. math.floor(due / hour) .. 'h ' - due = due % hour - end - - if due >= minute then - res = res .. math.floor(due / minute) .. 'min ' - due = due % minute - end - else - res = res .. math.floor(due / day) + 1 .. 'd ' - end - - return res -end - -function M.setup(c) - use_clock_time = c.use_clock_time or true - default_due_time = c.default_due_time or 'midnight' - prescript = c.prescript or 'has been: ' - prescript_hi = c.prescript_hi or 'Comment' - due_hi = c.due_hi or 'String' - ft = c.ft or '*.wiki' - future = c.future or 'future' - future_hi = c.future_hi or 'Error' - date_hi = c.date_hi or 'Conceal' - pattern_start = c.pattern_start or '(' - pattern_end = c.pattern_end or ')' - - local lua_start = pattern_start:gsub("[%(%)%.%%%+%-%*%?%[%^%$%]]", "%%%1") - local lua_end = pattern_end:gsub("[%(%)%.%%%+%-%*%?%[%^%$%]]", "%%%1") - - local regex_start = pattern_start:gsub("\\%^%$%.%*~%[%]&", "\\%1") - local regex_end = pattern_end:gsub("\\%^%$%.%*~%[%]&", "\\%1") - - datetime_pattern = lua_start .. '%d%d%d%d%-%d%d%-%d%d %d%d:%d%d' .. lua_end - datetime_pattern_match = lua_start .. '(%d%d%d%d)%-(%d%d)%-(%d%d) (%d%d):(%d%d)' .. lua_end - - local regex_hi = '/' .. regex_start .. '\\d*-*\\d\\+-\\d\\+' .. regex_end .. - '/' - - vim.api.nvim_command('autocmd BufEnter ' .. ft .. - ' lua require("stale").draw(0)') - vim.api.nvim_command('autocmd InsertLeave ' .. ft .. - ' lua require("stale").redraw(0)') - vim.api.nvim_command('autocmd TextChanged ' .. ft .. - ' lua require("stale").redraw(0)') - vim.api.nvim_command('autocmd TextChangedI ' .. ft .. - ' lua require("stale").redraw(0)') - - vim.api.nvim_command('autocmd BufEnter ' .. ft .. ' syn match DueDate ' .. - regex_hi .. - ' display containedin=mkdNonListItemBlock,mkdListItemLine,mkdBlockquote contained') - vim.api.nvim_command('autocmd BufEnter ' .. ft .. ' hi def link DueDate ' .. - date_hi) -end - -function M.draw(buf) - local user_time - local user_hour - local user_min - local user_sec = 00 - - -- get current time - local now = os.time(os.date('*t')) - - -- find which date pattern is being passed in by user - for key, value in pairs(vim.api.nvim_buf_get_lines(buf, 0, -1, {})) do - local dateTime = string.match(value, datetime_pattern) - local due - - if dateTime then - local cur_year, month, day, user_hour, user_min = dateTime:match(datetime_pattern_match) - user_time = os.time({ - year = cur_year, - month = month, - day = day, - hour = user_hour, - min = user_min, - sec = user_sec - }) - - due = now - user_time - end - - if due then - local parsed - - if due > 0 then - parsed = { parseDue(due), due_hi } - else - parsed = { future, future_hi } - end - - vim.api.nvim_buf_set_virtual_text(buf, _VT_NS, key - 1, { - { prescript, prescript_hi }, parsed - }, {}) - end - end -end - -function M.clear(buf) vim.api.nvim_buf_clear_namespace(buf, _VT_NS, 0, -1) end - -function M.redraw(buf) - M.clear(buf) - M.draw(buf) -end - -return M diff --git a/.config/nvim/my_snippets/PKGBUILD.snippets b/.config/nvim/my_snippets/PKGBUILD.snippets deleted file mode 100644 index f00053f..0000000 --- a/.config/nvim/my_snippets/PKGBUILD.snippets +++ /dev/null @@ -1,5 +0,0 @@ -# vim:ft=snippets: - -snippet m "Maintainer line" b -# Maintainer: Yigit Sever -endsnippet diff --git a/.config/nvim/my_snippets/all.snippets b/.config/nvim/my_snippets/all.snippets deleted file mode 100644 index 338d1d7..0000000 --- a/.config/nvim/my_snippets/all.snippets +++ /dev/null @@ -1,16 +0,0 @@ -# vim:ft=snippets: - -global !p -from vimsnippets import get_comment_format -endglobal - -snippet fancybox "Box" -`!p snip.rv = '┌' + '─' * (len(t[1]) + 2) + '┐'` -│ $1 │ -`!p snip.rv = '└' + '─' * (len(t[1]) + 2) + '┘'` -$0 -endsnippet - -snippet todo "TODO comment" bw -`!p snip.rv=get_comment_format()[0]` TODO: $0 <`!v strftime('%d-%m-%y')`, yigit> `!p snip.rv=get_comment_format()[2]` -endsnippet diff --git a/.config/nvim/my_snippets/c.snippets b/.config/nvim/my_snippets/c.snippets deleted file mode 100644 index 524b47f..0000000 --- a/.config/nvim/my_snippets/c.snippets +++ /dev/null @@ -1,8 +0,0 @@ -# vim:ft=snippets: -priority 100 - -snippet if "if only" b -if (${1:true}) { - ${0:{VISUAL}} -} -endsnippet diff --git a/.config/nvim/my_snippets/ledger.snippets b/.config/nvim/my_snippets/ledger.snippets deleted file mode 100644 index 098a767..0000000 --- a/.config/nvim/my_snippets/ledger.snippets +++ /dev/null @@ -1,39 +0,0 @@ -# vim:ft=snippets: -# vim:set noexpandtab tabstop=4 shiftwidth=4: - -snippet c "New Checking Transaction" b -${1:`!v strftime("%Y")`}-${2:`!v strftime("%m")`}-${3:`!v strftime("%d")`} ${4:Payee} - Expenses:${5:} ${6:0.00} TL - Assets:Maas$0 -endsnippet - -snippet l "New Liabilities Transaction" b -${1:`!v strftime("%Y")`}-${2:`!v strftime("%m")`}-${3:`!v strftime("%d")`} ${4:Payee} - Expenses:${5:} ${6:0.00} TL - Liabilities:Maximum$0 -endsnippet - -snippet a "New Asmaalti Transaction" b -${1:`!v strftime("%Y")`}-${2:`!v strftime("%m")`}-${3:`!v strftime("%d")`} Asmaalti Piknik - Expenses:Food:Eating Out ${4:0.00} TL - ${5:Assets:Maas}$0 -endsnippet - -snippet y "New Yemeksepeti Transaction" b -${1:`!v strftime("%Y")`}-${2:`!v strftime("%m")`}-${3:`!v strftime("%d")`} Yemeksepeti - Expenses:Takeout ${4:0.00} TL - ${5:Liabilities:Maximum}$0 -endsnippet - -snippet m "New Migros Transaction" b -${1:`!v strftime("%Y")`}-${2:`!v strftime("%m")`}-${3:`!v strftime("%d")`} Migros Market - Expenses:Food:Groceries ${4:0.00} TL - ${5:Assets:Maas}$0 -endsnippet - -snippet sb "New Sosyal Bina Transaction" b -${1:`!v strftime("%Y")`}-${2:`!v strftime("%m")`}-${3:`!v strftime("%d")`} Sosyal Bina - Expenses:Food:Lunch 8.60 TL - Assets:Maas$0 -endsnippet - diff --git a/.config/nvim/my_snippets/mail.snippets b/.config/nvim/my_snippets/mail.snippets deleted file mode 100644 index 504b7fa..0000000 --- a/.config/nvim/my_snippets/mail.snippets +++ /dev/null @@ -1,5 +0,0 @@ -# vim:ft=snippets: - -snippet ~ "signature" b -~yigit -endsnippet diff --git a/.config/nvim/my_snippets/markdown.snippets b/.config/nvim/my_snippets/markdown.snippets deleted file mode 100644 index 3486dd2..0000000 --- a/.config/nvim/my_snippets/markdown.snippets +++ /dev/null @@ -1,5 +0,0 @@ -# vim:ft=snippets: - -snippet link "Link to something" b -[${1:${VISUAL:Text}}](`xsel -ob`)$0 -endsnippet diff --git a/.config/nvim/my_snippets/tex.snippets b/.config/nvim/my_snippets/tex.snippets deleted file mode 100644 index 727253f..0000000 --- a/.config/nvim/my_snippets/tex.snippets +++ /dev/null @@ -1,172 +0,0 @@ -# vim:ft=snippets: -# https://castel.dev/post/lecture-notes-1/ - -global !p -def math(): - return vim.eval('vimtex#syntax#in_mathzone()') == '1' -endglobal - -snippet template "Basic template" b -\documentclass[a4paper]{article} - -\usepackage[utf8]{inputenc} -\usepackage[T1]{fontenc} -\usepackage{textcomp} -\usepackage{babel} -\usepackage{amsmath, amssymb} - -% figure support -\usepackage{import} -\usepackage{xifthen} -\pdfminorversion=7 -\usepackage{pdfpages} -\usepackage{transparent} - -\begin{document} - $0 -\end{document} -endsnippet - -snippet beg "begin{} / end{}" bA -\\begin{$1} - $0 -\\end{$1} -endsnippet - -priority 100 -snippet ... "ldots" iA -\ldots -endsnippet - -snippet table "Table environment" b -\begin{table}[${1:htpb}] - \centering - \caption{${2:caption}}% - \label{tab:${3:label}} - \begin{tabular}{${5:c}} - $0${5/((?<=.)c|l|r)|./(?1: & )/g} - \end{tabular} -\end{table} -endsnippet - -snippet fig "Figure environment" b -\begin{figure}[${1:htpb}] - \centering - ${2:\includegraphics[width=0.8\textwidth]{$3}} - \caption{${4:$3}}% - \label{fig:${5:${3/\W+/-/g}}} -\end{figure} -endsnippet - -snippet enum "Enumerate" bA -\begin{enumerate} - \item $0 -\end{enumerate} -endsnippet - -snippet item "Itemize" bA -\begin{itemize} - \item $0 -\end{itemize} -endsnippet - -snippet desc "Description" b -\begin{description} - \item[$1] $0 -\end{description} -endsnippet - -snippet on "O(n)" b -\mathcal{O}(n) -endsnippet - -snippet mk "Math" wA -$${1}$`!p -if t[2] and t[2][0] not in [',', '.', '?', '-', ' ']: - snip.rv = ' ' -else: - snip.rv = '' -`$2 -endsnippet - -snippet dm "Math" wA -\[ -${1:${VISUAL}} -.\] $0 -endsnippet - -context "math()" -snippet '([A-Za-z])(\d)' "auto subscript" wrA -`!p snip.rv = match.group(1)`_`!p snip.rv = match.group(2)` -endsnippet - -context "math()" -snippet '([A-Za-z])_(\d\d)' "auto subscript2" wrA -`!p snip.rv = match.group(1)`_{`!p snip.rv = match.group(2)`} -endsnippet - -context "math()" -snippet // "Fraction" iA -\\frac{$1}{$2}$0 -endsnippet - -context "math()" -snippet '((\d+)|(\d*)(\\)?([A-Za-z]+)((\^|_)(\{\d+\}|\d))*)/' "Fraction" wrA -\\frac{`!p snip.rv = match.group(1)`}{$1}$0 -endsnippet - -snippet sec "Section" -\section{${1:${VISUAL:section name}}}% -\label{sec:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}} - -$0 -endsnippet - -snippet sec* "Section" -\section*{${1:${VISUAL:section name}}}% -\label{sec:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}} - -${0} -endsnippet - - -snippet sub "Subsection" -\subsection{${1:${VISUAL:subsection name}}}% -\label{sub:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}} - -$0 -endsnippet - -snippet sub* "Subsection" -\subsection*{${1:${VISUAL:subsection name}}}% -\label{sub:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}} - -${0} -endsnippet - -snippet ssub "Subsubsection" -\subsubsection{${1:${VISUAL:subsubsection name}}}% -\label{ssub:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}} - -$0 -endsnippet - -snippet ssub* "Subsubsection" -\subsubsection*{${1:${VISUAL:subsubsection name}}}% -\label{ssub:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}} - -${0} -endsnippet - -snippet "mint(ed)?( (\S+))?" "Minted code typeset" br -\begin{listing} -\begin{minted}[linenos,numbersep=5pt,frame=lines,framesep=2mm]{${1:`!p -snip.rv = match.group(3) if match.group(2) is not None else "language"`}} -${2:${VISUAL:code}} -\end{minted} -\caption{${3:caption name}} -\label{lst:${4:${3/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}} -\end{listing} - -$0 -endsnippet diff --git a/.config/nvim/my_snippets/vimwiki.snippets b/.config/nvim/my_snippets/vimwiki.snippets deleted file mode 100644 index daf93f7..0000000 --- a/.config/nvim/my_snippets/vimwiki.snippets +++ /dev/null @@ -1,29 +0,0 @@ -# vim:ft=snippets: - -snippet link "Link a static content" b -{{local:/home/yigit/nextcloud/personal_wiki/html/static/${1:filename}|${2:alt text}}} -endsnippet - -snippet on "O(n)" b -$\mathcal{O}(n)$ -endsnippet - -snippet s "Create a new spotlight item" b -- (`!v strftime("%F %R")`) `xsel -ob` -- ${1:Summary} -endsnippet - -snippet '- s' "Create a new spotlight item" w -- (`!v strftime("%F %R")`) `xsel -ob` -- ${1:Summary} -endsnippet - -snippet "h([1-6])" "Headings" rbA -`!p snip.rv = '=' * int(match.group(1)) ` ${1:${VISUAL}} `!p snip.rv = '=' * int(match.group(1))` -$0 -endsnippet - -snippet mcd "multi-line code" bA -{{{ $1 -${2:${VISUAL}} -}}} -$0 -endsnippet diff --git a/.config/nvim/neovim.cat b/.config/nvim/neovim.cat deleted file mode 100644 index fc33e6d..0000000 --- a/.config/nvim/neovim.cat +++ /dev/null @@ -1,13 +0,0 @@ -┌──────────────────────────────────────────────────────────────────────────────────┐ -│      ___           ___           ___           ___                       ___     │ -│     /\__\         /\  \         /\  \         /\__\          ___        /\__\    │ -│    /::|  |       /::\  \       /::\  \       /:/  /         /\  \      /::|  |   │ -│   /:|:|  |      /:/\:\  \     /:/\:\  \     /:/  /          \:\  \    /:|:|  |   │ -│  /:/|:|  |__   /::\~\:\  \   /:/  \:\  \   /:/__/  ___      /::\__\  /:/|:|__|__ │ -│ /:/ |:| /\__\ /:/\:\ \:\__\ /:/__/ \:\__\  |:|  | /\__\  __/:/\/__/ /:/ |::::\__\│ -│ \/__|:|/:/  / \:\~\:\ \/__/ \:\  \ /:/  /  |:|  |/:/  / /\/:/  /    \/__/~~/:/  /│ -│     |:/:/  /   \:\ \:\__\    \:\  /:/  /   |:|__/:/  /  \::/__/           /:/  / │ -│     |::/  /     \:\ \/__/     \:\/:/  /     \::::/__/    \:\__\          /:/  /  │ -│     /:/  /       \:\__\        \::/  /       ~~~~         \/__/         /:/  /   │ -│     \/__/         \/__/         \/__/                                   \/__/    │ -└──────────────────────────────────────────────────────────────────────────────────┘ -- cgit v1.2.3-70-g09d2