summaryrefslogtreecommitdiffstats
path: root/.config/nvim
diff options
context:
space:
mode:
authorYigit Sever2023-08-18 23:42:39 +0300
committerYigit Sever2023-08-18 23:42:39 +0300
commit387e08c52d9752bc839c71119f140ba8435c3d70 (patch)
tree3bb20c0e58ccf1e65ced4cfdfb6459e226a24672 /.config/nvim
parent14c14cfcc9aeb4bada6d2429162ded2917f26a94 (diff)
downloaddotfiles-387e08c52d9752bc839c71119f140ba8435c3d70.tar.gz
dotfiles-387e08c52d9752bc839c71119f140ba8435c3d70.tar.bz2
dotfiles-387e08c52d9752bc839c71119f140ba8435c3d70.zip
nvim: switch to lazy.nvim
revert this as whole, if you miss the good old days
Diffstat (limited to '.config/nvim')
-rw-r--r--.config/nvim/after/ftplugin/java.vim1
-rw-r--r--.config/nvim/after/ftplugin/ledger.vim3
-rw-r--r--.config/nvim/after/ftplugin/tex.vim22
-rw-r--r--.config/nvim/init.lua23
-rw-r--r--.config/nvim/lazy-lock.json52
-rw-r--r--.config/nvim/lua/au.lua50
-rw-r--r--.config/nvim/lua/autocmds.lua67
-rw-r--r--.config/nvim/lua/core/keymaps.lua77
-rw-r--r--.config/nvim/lua/core/lazy.lua30
-rw-r--r--.config/nvim/lua/core/options.lua98
-rw-r--r--.config/nvim/lua/functions.lua24
-rw-r--r--.config/nvim/lua/helpers/keys.lua21
-rw-r--r--.config/nvim/lua/helpers/stale.lua (renamed from .config/nvim/lua/stale.lua)8
-rw-r--r--.config/nvim/lua/mappings.lua183
-rw-r--r--.config/nvim/lua/plugin_settings.lua722
-rw-r--r--.config/nvim/lua/plugins.lua168
-rw-r--r--.config/nvim/lua/plugins/barbar.lua77
-rw-r--r--.config/nvim/lua/plugins/cmp.lua114
-rw-r--r--.config/nvim/lua/plugins/colorscheme.lua45
-rw-r--r--.config/nvim/lua/plugins/cutlass.lua51
-rw-r--r--.config/nvim/lua/plugins/dashboard.lua36
-rw-r--r--.config/nvim/lua/plugins/devicons.lua25
-rw-r--r--.config/nvim/lua/plugins/git.lua95
-rw-r--r--.config/nvim/lua/plugins/indent-blankline.lua14
-rw-r--r--.config/nvim/lua/plugins/latex.lua16
-rw-r--r--.config/nvim/lua/plugins/lsp.lua236
-rw-r--r--.config/nvim/lua/plugins/lualine.lua84
-rw-r--r--.config/nvim/lua/plugins/misc.lua83
-rw-r--r--.config/nvim/lua/plugins/nvim-tree.lua40
-rw-r--r--.config/nvim/lua/plugins/telescope.lua45
-rw-r--r--.config/nvim/lua/plugins/tpope.lua11
-rw-r--r--.config/nvim/lua/plugins/treesitter.lua73
-rw-r--r--.config/nvim/lua/plugins/trouble.lua14
-rw-r--r--.config/nvim/lua/plugins/turkish-deasciifier.lua24
-rw-r--r--.config/nvim/lua/plugins/vimwiki.lua28
-rw-r--r--.config/nvim/lua/plugins/which-key.lua14
-rw-r--r--.config/nvim/lua/settings.lua101
-rw-r--r--.config/nvim/my_snippets/PKGBUILD.snippets5
-rw-r--r--.config/nvim/my_snippets/all.snippets16
-rw-r--r--.config/nvim/my_snippets/c.snippets8
-rw-r--r--.config/nvim/my_snippets/ledger.snippets39
-rw-r--r--.config/nvim/my_snippets/mail.snippets5
-rw-r--r--.config/nvim/my_snippets/markdown.snippets5
-rw-r--r--.config/nvim/my_snippets/tex.snippets172
-rw-r--r--.config/nvim/my_snippets/vimwiki.snippets29
-rw-r--r--.config/nvim/neovim.cat13
46 files changed, 1416 insertions, 1651 deletions
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 @@
1let 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 @@
1let b:dispatch = 'ledger -f ~/nextcloud/virtuals/ledger.ledger bal assets liab'
2set foldmethod=expr
3set 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 @@
1call sandwich#util#addlocal([{
2 \ 'buns': ['\textbf{', '}'],
3 \ 'input': ['B'],
4\ }])
5
6call sandwich#util#addlocal([{
7 \ 'buns': ['\emph{', '}'],
8 \ 'input': ['E'],
9\ }])
10
11call sandwich#util#addlocal([{
12 \ 'buns': ['\texttt{', '}'],
13 \ 'input': ['T'],
14\ }])
15
16call sandwich#util#addlocal([{
17 \ 'buns': ['\enquote{', '}'],
18 \ 'input': ['"'],
19\ }])
20
21
22set 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 @@
4-- │▌ ▌▛▀ ▌ ▌▐▐ ▐ ▌▐ ▌│ 4-- │▌ ▌▛▀ ▌ ▌▐▐ ▐ ▌▐ ▌│
5-- │▘ ▘▝▀▘▝▀ ▘ ▀▘▘▝ ▘│ 5-- │▘ ▘▝▀▘▝▀ ▘ ▀▘▘▝ ▘│
6-- └──────────────────┘ 6-- └──────────────────┘
7-- ┌────────┐
8-- │▜ │
9-- │▐ ▌ ▌▝▀▖│
10-- │▐ ▌ ▌▞▀▌│
11-- │ ▘▝▀▘▝▀▘│
12-- └────────┘
13 7
14require('impatient') 8-- handle plugins with lazy.nvim
9require("core.lazy")
15 10
16require('plugins') 11-- general neovim keymaps
17require('settings') 12require("core.keymaps")
18require('plugin_settings')
19require('mappings')
20require('autocmds')
21 13
22-- personal plugins lol 14-- other options
23require('stale').setup{} 15require("core.options")
16
17-- I have to clean this
18require('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 @@
1{
2 "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" },
3 "LuaSnip": { "branch": "master", "commit": "c4d6298347f7707e9757351b2ee03d0c00da5c20" },
4 "barbar.nvim": { "branch": "master", "commit": "8cca17ea0ced3ba564e5da972a25600edafe7d7b" },
5 "catppuccin": { "branch": "main", "commit": "490078b1593c6609e6a50ad5001e7902ea601824" },
6 "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
7 "cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" },
8 "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" },
9 "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
10 "cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" },
11 "dashboard-nvim": { "branch": "master", "commit": "c17d3210b3dec8798b4fc82a11c542989251f85d" },
12 "dial.nvim": { "branch": "master", "commit": "c6657df5453a6cbe4e8356e1675e9652cadc332f" },
13 "fidget.nvim": { "branch": "main", "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" },
14 "friendly-snippets": { "branch": "main", "commit": "377d45475b49e37460a902d6d569d2093d4037d0" },
15 "gitsigns.nvim": { "branch": "main", "commit": "5a2b1205841bc06ffb15719b14d54987e17b22ae" },
16 "indent-blankline.nvim": { "branch": "master", "commit": "4541d690816cb99a7fc248f1486aa87f3abce91c" },
17 "lazy.nvim": { "branch": "main", "commit": "dac844ed617dda4f9ec85eb88e9629ad2add5e05" },
18 "leap.nvim": { "branch": "main", "commit": "5efe985cf68fac3b6a6dfe7a75fbfaca8db2af9c" },
19 "ltex-extra.nvim": { "branch": "master", "commit": "9bed99b2b8488cc2daf66c76d2e0cf051ee80d13" },
20 "lualine.nvim": { "branch": "master", "commit": "45e27ca739c7be6c49e5496d14fcf45a303c3a63" },
21 "mason-lspconfig.nvim": { "branch": "main", "commit": "e86a4c84ff35240639643ffed56ee1c4d55f538e" },
22 "mason.nvim": { "branch": "main", "commit": "b5bb138312dbd3f7729197ca659cbe5221d36a03" },
23 "neodev.nvim": { "branch": "main", "commit": "47dacc6d8f74936f7719351b025421df740c789b" },
24 "nvim-autopairs": { "branch": "master", "commit": "ae5b41ce880a6d850055e262d6dfebd362bb276e" },
25 "nvim-cmp": { "branch": "main", "commit": "51f1e11a89ec701221877532ee1a23557d291dd5" },
26 "nvim-lspconfig": { "branch": "master", "commit": "0d29cad8de3b2c654315203fc1fe12fde722a18a" },
27 "nvim-surround": { "branch": "main", "commit": "0d6882635817a2677749a330127d12ac30a4f3c8" },
28 "nvim-tree.lua": { "branch": "master", "commit": "18c7a3119839adc4599d838726deae662859c8b2" },
29 "nvim-treesitter": { "branch": "master", "commit": "add1864bbf2d3b8e789ec6b4715bb5a4073e3b60" },
30 "nvim-treesitter-textobjects": { "branch": "master", "commit": "56272167a6dead91c47c02dbdbfe1ae5643c59f5" },
31 "nvim-web-devicons": { "branch": "master", "commit": "cfc8824cc1db316a276b36517f093baccb8e799a" },
32 "plenary.nvim": { "branch": "master", "commit": "267282a9ce242bbb0c5dc31445b6d353bed978bb" },
33 "rust-tools.nvim": { "branch": "master", "commit": "0cc8adab23117783a0292a0c8a2fbed1005dc645" },
34 "tabular": { "branch": "master", "commit": "339091ac4dd1f17e225fe7d57b48aff55f99b23a" },
35 "targets.vim": { "branch": "master", "commit": "642d3a4ce306264b05ea3219920b13ea80931767" },
36 "telescope-fzf-native.nvim": { "branch": "main", "commit": "9bc8237565ded606e6c366a71c64c0af25cd7a50" },
37 "telescope.nvim": { "branch": "master", "commit": "2d92125620417fbea82ec30303823e3cd69e90e8" },
38 "trouble.nvim": { "branch": "main", "commit": "40aad004f53ae1d1ba91bcc5c29d59f07c5f01d3" },
39 "turkish-deasciifier.vim": { "branch": "master", "commit": "5b3a0bfef7424d218df7ab3dac8ee9dab42a105e" },
40 "vim-characterize": { "branch": "master", "commit": "1ba0fcf208464647e2df2e9f693247a2207f22a4" },
41 "vim-cutlass": { "branch": "master", "commit": "7afd649415541634c8ce317fafbc31cd19d57589" },
42 "vim-fugitive": { "branch": "master", "commit": "b3b838d690f315a503ec4af8c634bdff3b200aaf" },
43 "vim-illuminate": { "branch": "master", "commit": "76f28e858f1caae87bfa45fb4fd09e4b053fc45b" },
44 "vim-move": { "branch": "master", "commit": "244a2908ffbca3d09529b3ec24c2c090f489f401" },
45 "vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" },
46 "vim-subversive": { "branch": "master", "commit": "6286cda3f9222bfd490fe34a00a2d8cd4925adec" },
47 "vim-unimpaired": { "branch": "master", "commit": "6d44a6dc2ec34607c41ec78acf81657248580bf1" },
48 "vim-yoink": { "branch": "master", "commit": "89ed6934679fdbc3c20f552b50b1f869f624cd22" },
49 "vimtex": { "branch": "master", "commit": "e3d0bea39dbcb6e064db751b646c958342a3460f" },
50 "vimwiki": { "branch": "dev", "commit": "f0fe154ede6b11e3db9b058b930005a056a3d1c6" },
51 "which-key.nvim": { "branch": "main", "commit": "7ccf476ebe0445a741b64e36c78a682c1c6118b7" }
52} \ 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 @@
1--
2-- https://gist.github.com/numToStr/1ab83dd2e919de9235f9f774ef8076da
3--
4local cmd = vim.api.nvim_command
5
6local function autocmd(this, event, spec)
7 local is_table = type(spec) == 'table'
8 local pattern = is_table and spec[1] or '*'
9 local action = is_table and spec[2] or spec
10 if type(action) == 'function' then
11 action = this.set(action)
12 end
13 local e = type(event) == 'table' and table.concat(event, ',') or event
14 cmd('autocmd ' .. e .. ' ' .. pattern .. ' ' .. action)
15end
16
17local S = {
18 __au = {},
19}
20
21local X = setmetatable({}, {
22 __index = S,
23 __newindex = autocmd,
24 __call = autocmd,
25})
26
27function S.exec(id)
28 S.__au[id]()
29end
30
31function S.set(fn)
32 local id = string.format('%p', fn)
33 S.__au[id] = fn
34 return string.format('lua require("au").exec("%s")', id)
35end
36
37function S.group(grp, cmds)
38 cmd('augroup ' .. grp)
39 cmd('autocmd!')
40 if type(cmds) == 'function' then
41 cmds(X)
42 else
43 for _, au in ipairs(cmds) do
44 autocmd(S, au[1], { au[2], au[3] })
45 end
46 end
47 cmd('augroup END')
48end
49
50return 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 @@
1-- ┌─────────────────────────┐
2-- │ ▐ ▌ │
3-- │▝▀▖▌ ▌▜▀ ▞▀▖▞▀▖▛▚▀▖▞▀▌▞▀▘│
4-- │▞▀▌▌ ▌▐ ▖▌ ▌▌ ▖▌▐ ▌▌ ▌▝▀▖│
5-- │▝▀▘▝▀▘ ▀ ▝▀ ▝▀ ▘▝ ▘▝▀▘▀▀ │
6-- └─────────────────────────┘
7
8local au = require('au')
9
10au.TextYankPost = function()
11 vim.highlight.on_yank { higroup="IncSearch", timeout=400 }
12end
13
14-- autocmd FileType vimwiki,latex,tex setlocal formatprg=/home/yigit/.local/bin/sentences
15au.FileType = {
16 'vimwiki,latex,tex',
17 function()
18 vim.bo.formatprg = "/home/yigit/.local/bin/sentences"
19 end,
20}
21
22-- autocmd VimLeave *.tex !texclear %
23au.VimLeave = {
24 '*.tex',
25 function()
26 vim.cmd("!texclear %")
27 end,
28}
29
30-- autocmd FileType rust let b:dispatch = 'cargo run'
31au.FileType = {
32 'rust',
33 function()
34 vim.b.dispatch = 'cargo run'
35 end,
36}
37
38-- autocmd VimResized * :wincmd =
39au.VimResized = {
40 '*',
41 function()
42 vim.cmd(":wincmd =")
43 end,
44}
45
46-- autocmd FileType markdown,tex setlocal spell
47au.FileType = {
48 'markdown,text',
49 function()
50 vim.wo.spell = true
51 end,
52}
53
54-- gf plugins
55au.BufEnter = {
56 'init.lua',
57 function()
58 vim.opt.path:append("./lua")
59 end
60}
61
62au.BufLeave = {
63 'init.lua',
64 function()
65 vim.opt.path:remove("./lua")
66 end
67}
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 @@
1local map = require("helpers.keys").map
2
3-- https://stackoverflow.com/questions/4256697/vim-search-and-highlight-but-do-not-jump
4-- search & highlight but do not jump
5map("n", "*", "<cmd>keepjumps normal! mi*`i<CR>", "search forwards")
6map("n", "#", "<cmd>keepjumps normal! mi#`i<CR>", "search backwards")
7
8-- save file as sudo on files that require root permission
9map("c", "w!!", 'execute "silent! write !sudo tee % >/dev/null" <bar> edit!<CR>', "save file as sudo", { silent = false })
10
11-- replace ex mode with gq (format lines)
12map("n", "Q", "gq", "format lines")
13
14-- set formatprg to sentences, for prose
15-- TODO: can we do this with vim.o.formatprg?
16map("n", "<Leader>fp", "<cmd>set formatprg=~/.local/bin/sentences<CR>", "switch to sentences view", { silent = false })
17
18-- replace all is aliased to S.
19map("n", "S", ":s//g<Left><Left>", "replace all", { silent = false })
20map("v", "S", ":s//g<Left><Left>", "replace all selection", { silent = false })
21
22-- jump to buffer
23map("n", "<Leader>b", "<cmd>ls<cr>:b<space>", "jump to buffer")
24
25-- up and down are more logical with g..
26map("n", "k", '(v:count == 0 ? "gk" : "k")', "up", { expr = true })
27map("n", "j", '(v:count == 0 ? "gj" : "j")', "down", { expr = true })
28map("i", "<Up>", "<Esc>gka")
29map("i", "<Down>", "<Esc>gja")
30
31-- space used to toggle folds, now it's x (because x is d)
32map("n", "<Space>", '"_x')
33
34-- separate cut and delete
35map("n", "x", "d")
36map("x", "x", "d")
37map("n", "xx", "dd")
38map("n", "X", "D")
39
40-- change into pwd of current buffer
41map("n", "<Leader>cd", "<cmd>lcd %:p:h<CR>:pwd<CR>", "cd to current buffer's pwd")
42
43-- call CreatePaper on word below cursor
44map("n", "<leader>np", 'gewi[[/papers/<ESC>Ea]]<ESC>bb:call CreatePaper(expand("<cword>"))<CR>',
45 "vimwiki new paper on word under cursor")
46
47-- link paper
48map("n", "<leader>lp", "gewi[[/papers/<ESC>Ea]]<ESC>", "vimwiki link wrap word under cursor")
49
50-- call CreateReference on word below cursor
51map("n", "<leader>nr", '<cmd>call CreateReference(expand("<cword>"))<CR>', "vimwiki new reference word under cursor")
52
53-- create a new note
54map("n", "<leader>nn", "<cmd>call CreateNote()<CR>", "vimwiki new note for slipbox")
55
56-- :%% to get current file path
57map('c', '%%', "getcmdtype() == ':' ? expand('%:h').'/' : '%%'", "get current file path", { expr = true, silent = false })
58
59-- reselect visual selection after indent
60map('v', '>', '>gv')
61map('v', '<', '<gv')
62
63-- keep cursor position after visual yank
64map('v', 'y', 'myy`y')
65map('v', 'Y', 'myY`y')
66
67-- ` is more useful than '
68map('n', "'", '`')
69
70-- switch between light and dark modes
71map("n", "<leader>ut", function()
72 if vim.o.background == "dark" then
73 vim.o.background = "light"
74 else
75 vim.o.background = "dark"
76 end
77end, "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 @@
1-- install lazy.nvim if not already installed
2local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
3if not vim.loop.fs_stat(lazypath) then
4 vim.fn.system({
5 "git",
6 "clone",
7 "--filter=blob:none",
8 "https://github.com/folke/lazy.nvim.git",
9 "--branch=stable", -- latest stable release
10 lazypath,
11 })
12end
13vim.opt.rtp:prepend(lazypath)
14
15-- use a protected call so we don't error out on first use
16local ok, lazy = pcall(require, "lazy")
17if not ok then
18 return
19end
20
21-- we have to set the leader key here for lazy.nvim to work
22require("helpers.keys").set_leader("\\")
23
24-- load plugins from specifications
25-- see: https://github.com/folke/lazy.nvim#-structuring-your-plugins
26-- we are loading them as a lua module
27lazy.setup("plugins")
28
29-- easy-access keybindings
30require("helpers.keys").map("n", "<leader>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 @@
1local opts = {
2 -- this might not be needed anymore
3 termguicolors = true,
4
5 -- copy indent on a new line
6 autoindent = true,
7
8 -- :h tabstop, 2. point
9 -- use appropriate number of spaces to insert a <Tab>
10 expandtab = true,
11 shiftwidth = 4,
12 softtabstop = 4,
13 tabstop = 8,
14
15 -- use english for spellchecking
16 spelllang = "en_gb",
17
18 -- tab completion, zsh style
19 wildmode = "longest:full,full",
20
21 -- put one space for join (not two)
22 joinspaces = false,
23
24 -- keep n lines above/below cursor while scrolling
25 scrolloff = 4,
26
27 -- line numbers
28 number = true,
29
30 -- manual folding
31 foldmethod = "marker",
32
33 -- set the terminal title
34 title = true,
35
36 -- wrap using 'breakat' character
37 linebreak = true,
38
39 -- new split panes will split to below and right
40 splitbelow = true,
41 splitright = true,
42
43 -- use relative line numbers
44 relativenumber = true,
45
46 -- we are already using a cursorline, don't clobber linter messages
47 showmode = false,
48
49 -- jump to the matching bracket briefly
50 showmatch = true,
51
52 -- persistent undo
53 undofile = true,
54
55 -- lower case searches ignore case, upper case searches do not
56 ignorecase = true,
57 smartcase = true,
58
59 -- https://stackoverflow.com/a/3445040/
60 -- switch case labels
61 cinoptions = "l1",
62
63}
64
65for opt, val in pairs(opts) do
66 vim.o[opt] = val
67end
68
69-- set other options
70-- local colorscheme = require("helpers.colorscheme")
71-- vim.cmd.colorscheme(colorscheme)
72
73-- interact with system clipboard
74vim.opt.clipboard:append('unnamedplus')
75
76vim.opt.wildignore = {
77 '*.o', '*.obj', '*.class', '*.aux', '*.lof', '*.log', '*.lot', '*.fls',
78 '*.toc', '*.fmt', '*.fot', '*.cb', '*.cb2', '.*.lb', '.dvi', '*.xdv',
79 '*.bbl', '*.bcf', '*.blg', '*-blx.aux', '*-blx.bib', '*.run.xml',
80 '*.fdb_latexmk', '*.synctex', '*.synctex(busy)', '*.synctex.gz',
81 '*.synctex.gz(busy)', '*.pdfsync'
82}
83
84-- iwhite: ignore changes in amount of white space.
85-- vertical: start diff mode with vertical splits
86-- filler: show filler lines,
87vim.opt.diffopt = {
88 "iwhite", "vertical", "filler", "algorithm:patience", "indent-heuristic"
89}
90
91-- menu: use a popup menu to show the possible completions
92-- preview: show extra information
93vim.opt.completeopt = {"menu", "menuone", "noselect"}
94
95if vim.fn.executable("rg") then
96 vim.o.grepprg = "rg --vimgrep --no-heading --smart-case"
97 vim.o.grepformat = "%f:%l:%c:%m,%f:%l:%m"
98end
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 @@
1-- ┌──────────────────────────┐
2-- │▗▀▖ ▐ ▗ │
3-- │▐ ▌ ▌▛▀▖▞▀▖▜▀ ▄ ▞▀▖▛▀▖▞▀▘│
4-- │▜▀ ▌ ▌▌ ▌▌ ▖▐ ▖▐ ▌ ▌▌ ▌▝▀▖│
5-- │▐ ▝▀▘▘ ▘▝▀ ▀ ▀▘▝▀ ▘ ▘▀▀ │
6-- └──────────────────────────┘
7-- 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
8
9local random = math.random
10
11local function random_filename()
12 uuid = ''
13 for i=0,6 do
14 uuid = uuid .. (string.format('%x', random(0, 0xf)))
15 end
16 return uuid
17end
18
19function create_note()
20 nvim_command("e! " .. nvim_call_function('fnameescape', '~/nextcloud/personal_wiki/text/box/' .. random_filename() .. ".wiki"))
21 local text = "= up =\n\n= down =\n\n= keywords =\n\n"
22 nvim_command("put! " .. text)
23 nvim_command("normal gg")
24end
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 @@
1local M = {}
2
3M.map = function(mode, lhs, rhs, desc, opts)
4 local options = { noremap = true, silent = true, desc = desc }
5 if opts then
6 options = vim.tbl_extend("force", options, opts)
7 end
8 vim.keymap.set(mode, lhs, rhs, options)
9end
10
11M.lsp_map = function(lhs, rhs, bufnr, desc)
12 vim.keymap.set("n", lhs, rhs, { silent = true, buffer = bufnr, desc = desc })
13end
14
15M.set_leader = function(key)
16 vim.g.mapleader = key
17 vim.g.maplocalleader = key
18 M.map({ "n", "v" }, key, "<nop>")
19end
20
21return M
diff --git a/.config/nvim/lua/stale.lua b/.config/nvim/lua/helpers/stale.lua
index 0c79884..062e3cf 100644
--- a/.config/nvim/lua/stale.lua
+++ b/.config/nvim/lua/helpers/stale.lua
@@ -90,13 +90,13 @@ function M.setup(c)
90 '/' 90 '/'
91 91
92 vim.api.nvim_command('autocmd BufEnter ' .. ft .. 92 vim.api.nvim_command('autocmd BufEnter ' .. ft ..
93 ' lua require("stale").draw(0)') 93 ' lua require("helpers.stale").draw(0)')
94 vim.api.nvim_command('autocmd InsertLeave ' .. ft .. 94 vim.api.nvim_command('autocmd InsertLeave ' .. ft ..
95 ' lua require("stale").redraw(0)') 95 ' lua require("helpers.stale").redraw(0)')
96 vim.api.nvim_command('autocmd TextChanged ' .. ft .. 96 vim.api.nvim_command('autocmd TextChanged ' .. ft ..
97 ' lua require("stale").redraw(0)') 97 ' lua require("helpers.stale").redraw(0)')
98 vim.api.nvim_command('autocmd TextChangedI ' .. ft .. 98 vim.api.nvim_command('autocmd TextChangedI ' .. ft ..
99 ' lua require("stale").redraw(0)') 99 ' lua require("helpers.stale").redraw(0)')
100 100
101 vim.api.nvim_command('autocmd BufEnter ' .. ft .. ' syn match DueDate ' .. 101 vim.api.nvim_command('autocmd BufEnter ' .. ft .. ' syn match DueDate ' ..
102 regex_hi .. 102 regex_hi ..
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 @@
1-- ┌────────────────────────┐
2-- │ ▗ │
3-- │▛▚▀▖▝▀▖▛▀▖▛▀▖▄ ▛▀▖▞▀▌▞▀▘│
4-- │▌▐ ▌▞▀▌▙▄▘▙▄▘▐ ▌ ▌▚▄▌▝▀▖│
5-- │▘▝ ▘▝▀▘▌ ▌ ▀▘▘ ▘▗▄▘▀▀ │
6-- └────────────────────────┘
7
8-- brute force deasciify everything
9vim.keymap.set("n", "<leader>tc", "TurkishDeasciifyForce()", { expr = true })
10vim.keymap.set("n", "<leader>tctc", "TurkishDeasciifyForce() .. '_'", { expr = true })
11vim.keymap.set("x", "<leader>tc", "TurkishDeasciifyForce()", { expr = true })
12
13-- use turkish-mode to selectively deasciify
14vim.keymap.set("n", "<Leader>tr", "TurkishDeasciify()", {expr = true})
15vim.keymap.set("n", "<Leader>trtr", "TurkishDeasciify() .. '_'", {expr = true})
16vim.keymap.set("x", "<Leader>tr", "TurkishDeasciify()", {expr = true})
17
18-- ascii everything
19vim.keymap.set("n", "<Leader>rt", "TurkishAsciify()", {expr = true})
20vim.keymap.set("n", "<Leader>rtrt", "TurkishAsciify() .. '_'", {expr = true})
21vim.keymap.set("x", "<Leader>rt", "TurkishAsciify()", {expr = true})
22
23-- https://stackoverflow.com/questions/4256697/vim-search-and-highlight-but-do-not-jump
24-- search & highlight but do not jump
25vim.keymap.set("n", "*", ":keepjumps normal! mi*`i<CR>")
26vim.keymap.set("n", "#", ":keepjumps normal! mi#`i<CR>")
27
28-- save file as sudo on files that require root permission
29vim.keymap.set("c", "w!!", 'execute "silent! write !sudo tee % >/dev/null" <bar> edit!<CR>', { silent = false })
30
31-- replace ex mode with gq (format lines)
32vim.keymap.set('n', 'Q', 'gq')
33
34-- set formatprg to sentences, for prose
35vim.keymap.set('n', '<Leader>fp', ":set formatprg=~/.local/bin/sentences<CR>", { silent = false })
36
37-- replace all is aliased to S.
38vim.keymap.set('n', 'S', ':%s//g<Left><Left>', { silent = false })
39vim.keymap.set('v', 'S', ':s//g<Left><Left>', { silent = false })
40
41-- jump to buffer
42vim.keymap.set('n', '<Leader>b', ':ls<cr>:b<space>')
43
44-- up and down are more logical with g..
45vim.keymap.set('n', 'k', '(v:count == 0 ? "gk" : "k")', { expr = true })
46vim.keymap.set('n', 'j', '(v:count == 0 ? "gj" : "j")', { expr = true })
47vim.keymap.set('i', '<Up>', '<Esc>gka')
48vim.keymap.set('i', '<Down>', '<Esc>gja')
49
50-- space used to toggle folds, now it's x (because x is d)
51vim.keymap.set('n', '<Space>', '"_x')
52
53-- separate cut and delete
54vim.keymap.set('n', 'x', 'd')
55vim.keymap.set('x', 'x', 'd')
56vim.keymap.set('n', 'xx', 'dd')
57vim.keymap.set('n', 'X', 'D')
58
59-- change into pwd of current directory
60vim.keymap.set('n', '<Leader>cd', ':lcd %:p:h<CR>:pwd<CR>')
61
62-- call CreatePaper on word below cursor
63vim.keymap.set('n', '<leader>np', 'gewi[[/papers/<ESC>Ea]]<ESC>bb:call CreatePaper(expand("<cword>"))<CR>')
64
65-- link paper
66vim.keymap.set('n', '<leader>lp', 'gewi[[/papers/<ESC>Ea]]<ESC>')
67
68-- call CreateReference on word below cursor
69vim.keymap.set('n', '<leader>nr', ':call CreateReference(expand("<cword>"))<CR>')
70
71-- create a new note
72vim.keymap.set('n', '<leader>nn', ':call CreateNote()<CR>')
73
74-- :%% to get current file path
75vim.keymap.set('c', '%%', "getcmdtype() == ':' ? expand('%:h').'/' : '%%'", { expr = true, silent = false })
76
77-- reselect visual selection after indent
78vim.keymap.set('v', '>', '>gv')
79vim.keymap.set('v', '<', '<gv')
80
81-- keep cursor position after visual yank
82vim.keymap.set('v', 'y', 'myy`y')
83vim.keymap.set('v', 'Y', 'myY`y')
84
85-- ` is more useful than `
86vim.keymap.set('n', "'", '`')
87
88-- plug mappings {{{ --
89
90-- use the special yoink paste that rotates
91vim.keymap.set('n', 'p', '<Plug>(YoinkPaste_p)')
92vim.keymap.set('n', 'P', '<Plug>(YoinkPaste_P)')
93
94-- substitute from yank
95vim.keymap.set('n', '<Leader>ys', '<plug>(SubversiveSubstitute)')
96vim.keymap.set('n', '<Leader>yss', '<plug>(SubversiveSubstituteLine)')
97vim.keymap.set('n', '<Leader>yS', '<plug>(SubversiveSubstituteToEndOfLine)')
98
99-- substitute over range
100vim.keymap.set('n', '<Leader>s', '<plug>(SubversiveSubstituteRange)')
101vim.keymap.set('x', '<Leader>s', '<plug>(SubversiveSubstituteRange)')
102vim.keymap.set('n', '<Leader>ss', '<plug>(SubversiveSubstituteWordRange)')
103
104-- subvert over range
105vim.keymap.set('n', '<Leader><Leader>s', '<plug>(SubversiveSubvertRange)')
106vim.keymap.set('x', '<Leader><Leader>s', '<plug>(SubversiveSubvertRange)')
107vim.keymap.set('n', '<Leader><Leader>ss', '<plug>(SubversiveSubvertWordRange)')
108
109-- iterate over yank list
110vim.keymap.set('n', '<c-n>', '<Plug>(YoinkPostPasteSwapBack)')
111vim.keymap.set('n', '<c-p>', '<Plug>(YoinkPostPasteSwapForward)')
112
113-- checkmarks on vimwiki
114vim.keymap.set('n', '<leader>v', '<Plug>VimwikiToggleListItem')
115-- add/increase header level
116vim.keymap.set('n', '<leader>a', '<Plug>VimwikiAddHeaderLevel')
117
118-- vim-test bindings
119vim.keymap.set('n', 't<C-n>', ':TestNearest<CR>')
120vim.keymap.set('n', 't<C-f>', ':TestFile<CR>')
121vim.keymap.set('n', 't<C-s>', ':TestSuite<CR>')
122vim.keymap.set('n', 't<C-l>', ':TestLast<CR>')
123vim.keymap.set('n', 't<C-g>', ':TestVisit<CR>')
124
125-- telescope bindings
126vim.keymap.set('n', '<leader>ff', "<cmd>lua require('telescope.builtin').find_files()<cr>")
127vim.keymap.set('n', '<leader>fg', "<cmd>lua require('telescope.builtin').live_grep()<cr>")
128vim.keymap.set('n', '<leader>fb', "<cmd>lua require('telescope.builtin').buffers()<cr>")
129vim.keymap.set('n', '<leader>fh', "<cmd>lua require('telescope.builtin').help_tags()<cr>")
130
131-- nvim tree mappings
132vim.keymap.set('n', 'vt', ':NvimTreeToggle<CR>')
133vim.keymap.set('n', 'vr', ':NvimTreeRefresh<CR>')
134vim.keymap.set('n', 'vs', ':NvimTreeFindFile!<CR>')
135
136-- dial.nvim mappings
137local opts = { noremap=true, silent=true }
138vim.keymap.set("n", "<C-a>", require("dial.map").inc_normal(), opts)
139vim.keymap.set("n", "<C-x>", require("dial.map").dec_normal(), opts)
140vim.keymap.set("v", "<C-a>", require("dial.map").inc_visual(), opts)
141vim.keymap.set("v", "<C-x>", require("dial.map").dec_visual(), opts)
142vim.keymap.set("v", "g<C-a>", require("dial.map").inc_gvisual(), opts)
143vim.keymap.set("v", "g<C-x>", require("dial.map").dec_gvisual(), opts)
144
145-- leap.nvim mappings
146vim.keymap.set('n', '`', '<Plug>(leap-forward)', opts)
147vim.keymap.set('n', '<Leader>`', '<Plug>(leap-backward)', opts)
148vim.keymap.set('v', '`', '<Plug>(leap-forward)', opts)
149vim.keymap.set('v', '<Leader>`', '<Plug>(leap-backward)', opts)
150
151-- barbar.nvim mappings
152local opts = { noremap = true, silent = true }
153
154-- move to previous/next
155vim.keymap.set('n', '<A-,>', '<Cmd>BufferPrevious<CR>', opts)
156vim.keymap.set('n', '<A-.>', '<Cmd>BufferNext<CR>', opts)
157-- re-order to previous/next
158vim.keymap.set('n', '<A-e>', '<Cmd>BufferMovePrevious<CR>', opts)
159vim.keymap.set('n', '<A-i>', '<Cmd>BufferMoveNext<CR>', opts)
160-- goto buffer in position...
161vim.keymap.set('n', '<A-1>', '<Cmd>BufferGoto 1<CR>', opts)
162vim.keymap.set('n', '<A-2>', '<Cmd>BufferGoto 2<CR>', opts)
163vim.keymap.set('n', '<A-3>', '<Cmd>BufferGoto 3<CR>', opts)
164vim.keymap.set('n', '<A-4>', '<Cmd>BufferGoto 4<CR>', opts)
165vim.keymap.set('n', '<A-5>', '<Cmd>BufferGoto 5<CR>', opts)
166vim.keymap.set('n', '<A-6>', '<Cmd>BufferGoto 6<CR>', opts)
167vim.keymap.set('n', '<A-7>', '<Cmd>BufferGoto 7<CR>', opts)
168vim.keymap.set('n', '<A-8>', '<Cmd>BufferGoto 8<CR>', opts)
169vim.keymap.set('n', '<A-9>', '<Cmd>BufferGoto 9<CR>', opts)
170vim.keymap.set('n', '<A-0>', '<Cmd>BufferLast<CR>', opts)
171-- pin/unpin buffer
172vim.keymap.set('n', '<A-p>', '<Cmd>BufferPin<CR>', opts)
173-- close buffer
174vim.keymap.set('n', '<A-c>', '<Cmd>BufferClose<CR>', opts)
175-- magic buffer-picking mode
176vim.keymap.set('n', '<leader>dg', '<Cmd>BufferPick<CR>', opts)
177-- sort automatically by...
178vim.keymap.set('n', '<Leader>db', '<Cmd>BufferOrderByBufferNumber<CR>', opts)
179vim.keymap.set('n', '<Leader>dd', '<Cmd>BufferOrderByDirectory<CR>', opts)
180vim.keymap.set('n', '<Leader>dl', '<Cmd>BufferOrderByLanguage<CR>', opts)
181vim.keymap.set('n', '<Leader>dw', '<Cmd>BufferOrderByWindowNumber<CR>', opts)
182
183-- }}} 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 @@
1-- ┌─────────────────────────────────────┐
2-- │ ▜ ▐ ▐ ▗ │
3-- │▛▀▖▐ ▌ ▌▞▀▌▗▖▖▞▀▘▞▀▖▜▀ ▜▀ ▄ ▛▀▖▞▀▌▞▀▘│
4-- │▙▄▘▐ ▌ ▌▚▄▌▘▝ ▝▀▖▛▀ ▐ ▖▐ ▖▐ ▌ ▌▚▄▌▝▀▖│
5-- │▌ ▘▝▀▘▗▄▘ ▀▀ ▝▀▘ ▀ ▀ ▀▘▘ ▘▗▄▘▀▀ │
6-- └─────────────────────────────────────┘
7
8local g = vim.g -- global for let options
9local opt = vim.opt -- convenient :set
10local cmd = vim.cmd -- vim commands
11
12-- vimwiki {{{ --
13g.vimwiki_list = {
14 {
15 path = '/home/yigit/nextcloud/personal_wiki/text',
16 path_html = '/home/yigit/nextcloud/personal_wiki/html',
17 auto_generate_tags = 1,
18 automatic_nested_syntaxes = 1,
19 template_path = '/home/yigit/nextcloud/personal_wiki/templates',
20 template_default = 'default_template',
21 template_ext = '.html',
22 auto_export = 1,
23 auto_tags = 1
24 }
25}
26
27g.vimwiki_global_ext = 0
28g.vimwiki_hl_headers = 1
29-- }}} vimwiki --
30
31-- lualine {{{ --
32
33local function lualine_spell()
34 if vim.wo.spell then
35 return "spell"
36 else
37 return
38 end
39end
40
41local conditions = {
42 spell_on = function ()
43 return vim.wo.spell
44 end,
45 filetype_is_tex = function()
46 return vim.bo.filetype == "tex"
47 end
48}
49
50-- https://www.reddit.com/r/neovim/comments/u2uc4p/your_lualine_custom_features/i4muvp6/
51-- override 'encoding': don't display if encoding is utf-8.
52local encoding = function()
53 local ret, _ = (vim.bo.fenc).gsub("^utf%-8$", "")
54 return ret
55end
56
57-- fileformat: don't display if &ff is unix.
58local fileformat = function()
59 local ret, _ = vim.bo.fileformat.gsub("^unix$", "")
60 return ret
61end
62
63require'lualine'.setup {
64 options = {
65 icons_enabled = true,
66 theme = "catppuccin",
67 section_separators = { left = '', right = '' },
68 component_separators = { left = '', right = '' },
69 },
70 sections = {
71 lualine_a = {{'mode', fmt = string.lower}},
72 lualine_b = {'branch',
73 {
74 'diff',
75 diff_color= {
76 -- Same color values as the general color option can be used here.
77 added = { fg = 'LightGreen' },
78 modified = { fg = 'LightBlue' }, -- Changes the diff's modified color
79 removed = { fg = 'LightRed' }, -- Changes the diff's removed color you
80 }
81 },
82 {
83 lualine_spell,
84 cond = conditions.spell_on,
85 }},
86 lualine_c = {'filename'},
87 lualine_x = {encoding, fileformat, 'filetype'},
88 lualine_y = {'progress'},
89 lualine_z = {
90 'location', {
91 'diagnostics',
92 sources = {'nvim_diagnostic'},
93 sections = {'error', 'warn', 'info', 'hint'},
94 symbols = {error = 'e', warn = 'w', info = 'i', hint = 'h'}
95 }
96 }
97 },
98 inactive_sections = {
99 lualine_a = {},
100 lualine_b = {},
101 lualine_c = {'filename'},
102 lualine_x = {},
103 lualine_y = {},
104 lualine_z = {}
105 },
106 tabline = {},
107 extensions = {}
108}
109
110-- }}} lualine --
111
112-- cutlass suite {{{ --
113
114-- cutlass/yoink/subverse suite
115g.yoinkIncludeDeleteOperations = 1
116
117-- fix the Target STRING not available
118g.clipboard = {
119 name = 'xsel_override',
120 copy = {
121 ['+'] = 'xsel --input --clipboard',
122 ['*'] = 'xsel --input --primary',
123 },
124 paste = {
125 ['+'] = 'xsel --output --clipboard',
126 ['*'] = 'xsel --output --primary',
127 },
128 cache_enabled = 1,
129}
130
131-- }}} cutlass suite --
132
133-- UltiSnips {{{ --
134g.UltiSnipsEditSplit = "vertical"
135-- ctrl + l expands the snippet, c + j/k navigates placeholders
136g.UltiSnipsExpandTrigger = "<tab>"
137g.UltiSnipsEnableSnipMate = "1"
138g.UltiSnipsSnippetDirectories = {"my_snippets", "UltiSnips"}
139-- }}} UltiSnips --
140
141-- vimtex {{{ --
142g.vimtex_view_method = 'zathura'
143g.vimtex_quickfix_mode = 0
144g.vimtex_quickfix_ignore_filters = {"Underfull", "Overfull"}
145
146g.vimtex_compiler_latexmk = {
147 options = {
148 "-pdf", '-shell-escape', '-verbose', '-file-line-error', '-synctex=1', '-interaction=nonstopmode'
149 }
150}
151
152-- }}} vimtex --
153
154-- devicons {{{ --
155require'nvim-web-devicons'.setup {
156 override = {
157 wiki = {
158 icon = "󰂺",
159 color = "#D7827E",
160 name = "vimwiki"
161 },
162 rem = {
163 icon = "",
164 color = "#B4637A",
165 name = "remind"
166 },
167 mail = {
168 icon = "󰇰",
169 color = "#907AA9",
170 name = "mail"
171 },
172 };
173
174 default = true
175}
176-- }}} devicons --
177
178-- vim-slime {{{ --
179g.slime_target = "tmux"
180g.slime_paste_file = "$HOME/.slime_paste"
181g.slime_default_config = {socket_name = vim.call("get", vim.call("split", vim.env.TMUX, ','), "0"), target_pane = "{last}"}
182-- }}} vim-slime --
183
184-- gutentags {{{ --
185g.gutentags_enabled = 1
186g.gutentags_add_default_project_roots = 0
187g.gutentags_project_root = {'Makefile', '.git'}
188g.gutentags_exclude_filetypes = {'gitcommit', 'gitconfig', 'gitrebase', 'gitsendemail', 'git'}
189g.gutentags_generate_on_new = 1
190g.gutentags_generate_on_missing = 1
191g.gutentags_generate_on_write = 1
192g.gutentags_generate_on_empty_buffer = 0
193g.gutentags_ctags_exclude = {
194 '*.git', '*.svn', '*.hg',
195 'cache', 'build', 'dist', 'bin', 'node_modules', 'bower_components',
196 '*-lock.json', '*.lock',
197 '*.min.*',
198 '*.bak',
199 '*.zip',
200 '*.pyc',
201 '*.class',
202 '*.sln',
203 '*.csproj', '*.csproj.user',
204 '*.tmp',
205 '*.cache',
206 '*.vscode',
207 '*.pdb',
208 '*.exe', '*.dll', '*.bin',
209 '*.mp3', '*.ogg', '*.flac',
210 '*.swp', '*.swo',
211 '.DS_Store', '*.plist',
212 '*.bmp', '*.gif', '*.ico', '*.jpg', '*.png', '*.svg',
213 '*.rar', '*.zip', '*.tar', '*.tar.gz', '*.tar.xz', '*.tar.bz2',
214 '*.pdf', '*.doc', '*.docx', '*.ppt', '*.pptx', '*.xls',
215}
216-- }}} gutentags --
217
218-- telescope {{{ --
219require('telescope').setup {
220 extensions = {
221 fzf = {
222 fuzzy = true, -- false will only do exact matching
223 override_generic_sorter = true, -- override the generic sorter
224 override_file_sorter = true, -- override the file sorter
225 case_mode = "smart_case", -- or "ignore_case" or "respect_case"
226 -- the default case_mode is "smart_case"
227 }
228 }
229}
230
231require('telescope').load_extension('fzf')
232-- }}} telescope --
233
234-- dashboard {{{ --
235
236require('dashboard').setup {
237 theme = 'hyper',
238 config = {
239 week_header = {
240 enable = true,
241 },
242 shortcut = {
243 { desc = ' Update', group = '@property', action = 'PackerSync', key = 'u' },
244 {
245 icon = ' ',
246 icon_hl = '@variable',
247 desc = 'Files',
248 group = 'Label',
249 action = 'Telescope find_files',
250 key = 'f',
251 },
252 },
253 },
254}
255
256-- }}} dashboard --
257
258-- treesitter {{{ --
259
260require 'nvim-treesitter.configs'.setup {
261 ensure_installed = "all",
262 auto_install = true,
263 highlight = {
264 enable = true,
265 disable = { "latex" },
266 additional_vim_regex_highlighting = false,
267 },
268 incremental_selection = {
269 enable = true,
270 keymaps = {
271 init_selection = "gnn",
272 node_incremental = "grn",
273 scope_incremental = "grc",
274 node_decremental = "grm",
275 },
276 },
277 indent = {
278 enable = true
279 }
280}
281-- }}} treesitter --
282
283-- nvim-cmp {{{ --
284local cmp = require'cmp'
285
286cmp.setup({
287 snippet = {
288 expand = function(args)
289 vim.fn["UltiSnips#Anon"](args.body)
290 end,
291 },
292 window = {
293 completion = cmp.config.window.bordered(),
294 documentation = cmp.config.window.bordered(),
295 },
296 mapping = cmp.mapping.preset.insert({
297 ['<C-b>'] = cmp.mapping(cmp.mapping.scroll_docs(-4), { 'i', 'c' }),
298 ['<C-f>'] = cmp.mapping(cmp.mapping.scroll_docs(4), { 'i', 'c' }),
299 ['<C-c>'] = cmp.mapping(cmp.mapping.complete(), { 'i', 'c' }),
300 ['<C-e>'] = cmp.mapping({
301 i = cmp.mapping.abort(),
302 c = cmp.mapping.close(),
303 }),
304 ['<C-l>'] = cmp.mapping.confirm({ select = true }),
305 }),
306 sources = cmp.config.sources({
307 { name = 'nvim_lsp' },
308 { name = 'ultisnips' },
309 }, {
310 { name = 'buffer' },
311 { name = 'path' },
312 })
313})
314
315-- }}} nvim-cmp --
316
317-- nvim-lspconfig {{{ --
318local nvim_lsp = require('lspconfig')
319
320-- Mappings.
321local opts = { noremap=true, silent=true }
322vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, opts)
323vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts)
324vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts)
325vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, opts)
326
327local on_attach = function(client, bufnr)
328 -- enable completion triggered by <c-x><c-o>
329 vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
330
331 -- see `:help vim.lsp.*` for documentation on any of the below functions
332 local bufopts = { noremap=true, silent=true, buffer=bufnr }
333 vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts)
334 vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts)
335 vim.keymap.set('n', 'vh', vim.lsp.buf.hover, bufopts)
336 vim.keymap.set('n', 'gh', vim.lsp.buf.implementation, bufopts)
337 vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, bufopts)
338 vim.keymap.set('n', '<leader>wa', vim.lsp.buf.add_workspace_folder, bufopts)
339 vim.keymap.set('n', '<leader>wr', vim.lsp.buf.remove_workspace_folder, bufopts)
340 vim.keymap.set('n', '<leader>wl', function()
341 print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
342 end, bufopts)
343 vim.keymap.set('n', '<leader>D', vim.lsp.buf.type_definition, bufopts)
344 vim.keymap.set('n', '<leader>rn', vim.lsp.buf.rename, bufopts)
345 vim.keymap.set('n', '<leader>ca', vim.lsp.buf.code_action, bufopts)
346 vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts)
347 vim.keymap.set('n', '<leader>fm', function() vim.lsp.buf.format { async = true } end, bufopts)
348end
349
350-- bring in cmp_nvim_lsp
351local capabilities = require('cmp_nvim_lsp').default_capabilities()
352
353local servers = { 'jedi_language_server', 'texlab', 'clangd', 'denols' }
354for _, lsp in ipairs(servers) do
355 nvim_lsp[lsp].setup {
356 on_attach = on_attach,
357 capabilities = capabilities
358 }
359end
360
361nvim_lsp['efm'].setup {
362 on_attach = on_attach,
363 filetypes = { 'sh' },
364 capabilities = capabilities
365}
366
367nvim_lsp.ltex.setup {
368 capabilities = capabilities,
369 on_attach = function(client, bufnr)
370 on_attach(client, bufnr)
371 require("ltex_extra").setup {
372 load_langs = { "en-GB" },
373 init_check = true,
374 path = "/home/yigit/.local/share/nvim/ltex",
375 log_level = "none",
376 }
377 end,
378 settings = {
379 ltex = {
380 -- my settings here
381 }
382 }
383}
384
385-- rust-tools {{{ --
386
387-- Configure LSP through rust-tools.nvim plugin.
388-- rust-tools will configure and enable certain LSP features for us.
389-- See https://github.com/simrat39/rust-tools.nvim#configuration
390local rust_opts = {
391 tools = {
392 runnables = {
393 use_telescope = true,
394 },
395 inlay_hints = {
396 auto = true,
397 show_parameter_hints = true,
398 parameter_hints_prefix = "↸ ",
399 other_hints_prefix = "❱ ",
400 },
401 },
402
403 -- all the opts to send to nvim-lspconfig
404 -- these override the defaults set by rust-tools.nvim
405 -- see https://github.com/neovim/nvim-lspconfig/blob/master/CONFIG.md#rust_analyzer
406 server = {
407 -- on_attach is a callback called when the language server attachs to the buffer
408 on_attach = on_attach,
409 settings = {
410 -- to enable rust-analyzer settings visit:
411 -- https://github.com/rust-analyzer/rust-analyzer/blob/master/docs/user/generated_config.adoc
412 ["rust-analyzer"] = {
413 -- enable clippy on save
414 checkOnSave = {
415 command = "clippy",
416 },
417 },
418 },
419 },
420}
421
422require('rust-tools').setup(rust_opts)
423
424-- }}} rust-tools --
425
426-- }}} nvim-lsp --
427
428-- indent-blankline {{{ --
429vim.opt.list = true
430
431require("indent_blankline").setup {
432 show_current_context = true,
433 char = "┊",
434 buftype_exclude = {"terminal"},
435 filetype_exclude = {"dashboard", "help", "man"}
436}
437-- }}} indent-blankline --
438
439-- nvim-autopairs {{{ --
440
441require('nvim-autopairs').setup({
442 disable_filetype = { "TelescopePrompt" },
443})
444
445local cmp_autopairs = require('nvim-autopairs.completion.cmp')
446local cmp = require('cmp')
447cmp.event:on( 'confirm_done', cmp_autopairs.on_confirm_done())
448
449local Rule = require('nvim-autopairs.rule')
450local npairs = require('nvim-autopairs')
451
452npairs.add_rule(Rule('%"','%"',"remind"))
453npairs.add_rule(Rule('/*','*/',"c"))
454
455-- }}} nvim-autopairs --
456
457-- nvim-colorizer {{{ --
458require 'colorizer'.setup()
459-- }}} nvim-colorizer --
460
461-- gitsigns.nvim {{{ --
462
463require('gitsigns').setup {
464 signs = {
465 add = { text = '│' },
466 change = { text = '│' },
467 delete = { text = '_' },
468 topdelete = { text = '‾' },
469 changedelete = { text = '~' },
470 untracked = { text = '┆' },
471 },
472 signcolumn = true, -- Toggle with `:Gitsigns toggle_signs`
473 numhl = false, -- Toggle with `:Gitsigns toggle_numhl`
474 linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
475 word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff`
476 watch_gitdir = {
477 follow_files = true
478 },
479 attach_to_untracked = true,
480 current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
481 current_line_blame_opts = {
482 virt_text = true,
483 virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align'
484 delay = 1000,
485 ignore_whitespace = false,
486 },
487 current_line_blame_formatter = '<author>, <author_time:%Y-%m-%d> - <summary>',
488 sign_priority = 6,
489 update_debounce = 100,
490 status_formatter = nil, -- Use default
491 max_file_length = 40000, -- Disable if file is longer than this (in lines)
492 preview_config = {
493 -- Options passed to nvim_open_win
494 border = 'single',
495 style = 'minimal',
496 relative = 'cursor',
497 row = 0,
498 col = 1
499 },
500 yadm = {
501 enable = true
502 },
503
504 on_attach = function(bufnr)
505 local gs = package.loaded.gitsigns
506
507 local function map(mode, l, r, opts)
508 opts = opts or {}
509 opts.buffer = bufnr
510 vim.keymap.set(mode, l, r, opts)
511 end
512
513 -- Navigation
514 map('n', ']c', function()
515 if vim.wo.diff then return ']c' end
516 vim.schedule(function() gs.next_hunk() end)
517 return '<Ignore>'
518 end, {expr=true})
519
520 map('n', '[c', function()
521 if vim.wo.diff then return '[c' end
522 vim.schedule(function() gs.prev_hunk() end)
523 return '<Ignore>'
524 end, {expr=true})
525
526 -- Actions
527 map('n', '<leader>hs', gs.stage_hunk)
528 map('n', '<leader>hr', gs.reset_hunk)
529 map('v', '<leader>hs', function() gs.stage_hunk {vim.fn.line('.'), vim.fn.line('v')} end)
530 map('v', '<leader>hr', function() gs.reset_hunk {vim.fn.line('.'), vim.fn.line('v')} end)
531 map('n', '<leader>hS', gs.stage_buffer)
532 map('n', '<leader>hu', gs.undo_stage_hunk)
533 map('n', '<leader>hR', gs.reset_buffer)
534 map('n', '<leader>hp', gs.preview_hunk)
535 map('n', '<leader>hb', function() gs.blame_line{full=true} end)
536 map('n', '<leader>tb', gs.toggle_current_line_blame)
537 map('n', '<leader>hd', gs.diffthis)
538 map('n', '<leader>hD', function() gs.diffthis('~') end)
539 map('n', '<leader>td', gs.toggle_deleted)
540
541 -- Text object
542 map({'o', 'x'}, 'ih', ':<C-U>Gitsigns select_hunk<CR>')
543 end
544}
545
546-- }}} gitsigns.nvim --
547
548-- Comment.nvim {{{ --
549require('Comment').setup()
550-- }}} Comment.nvim --
551
552-- catppuccin {{{ --
553require("catppuccin").setup({
554 flavour = "mocha", -- latte, frappe, macchiato, mocha
555 background = { -- :h background
556 light = "latte",
557 dark = "mocha",
558 },
559 transparent_background = false,
560 term_colors = false,
561 no_italic = true, -- force no italic
562 no_bold = false, -- force no bold
563 integrations = {
564 barbar = true,
565 cmp = true,
566 fidget = true,
567 gitsigns = true,
568 leap = true,
569 nvimtree = true,
570 telescope = true,
571 treesitter = true,
572 vimwiki = true,
573 },
574 native_lsp = {
575 enabled = true,
576 underlines = {
577 errors = { "underline" },
578 hints = { "underline" },
579 warnings = { "underline" },
580 information = { "underline" },
581 },
582
583 },
584 indent_blankline = {
585 enabled = true,
586 },
587})
588
589-- setup must be called before loading
590vim.cmd.colorscheme "catppuccin"
591
592-- }}} catppuccin --
593
594-- dial.nvim {{{ --
595
596local augend = require("dial.augend")
597require("dial.config").augends:register_group{
598 -- default augends used when no group name is specified
599 default = {
600 augend.integer.alias.decimal, -- nonnegative decimal number (0, 1, 2, 3, ...)
601 augend.integer.alias.hex, -- nonnegative hex number (0x01, 0x1a1f, etc.)
602 augend.date.alias["%Y/%m/%d"], -- date (2022/02/19, etc.)
603 augend.date.alias["%Y-%m-%d"],
604 augend.semver.alias.semver,
605 augend.constant.new{
606 elements = {"and", "or"},
607 word = true, -- if false, "sand" is incremented into "sor", "doctor" into "doctand", etc.
608 cyclic = true, -- "or" is incremented into "and".
609 },
610 augend.constant.new{
611 elements = {"&&", "||"},
612 word = false,
613 cyclic = true,
614 },
615 },
616}
617
618-- }}} dial.nvim --
619
620-- leap.nvim {{{ --
621require('leap').setup {
622 case_insensitive = true,
623 substitute_chars = { ['\r'] = '¬' }
624}
625
626-- }}} leap.nvim --
627
628-- fidget.nvim {{{ --
629require("fidget").setup{
630-- https://github.com/j-hui/fidget.nvim/blob/main/doc/fidget.md
631 text = {
632 spinner = "triangle",
633 commenced = "started", -- message shown when task starts
634 completed = "done", -- message shown when task completes
635 },
636}
637-- }}} fidget.nvim --
638
639-- nvim-tree {{{ --
640
641require("nvim-tree").setup({
642 sort_by = "case_sensitive",
643 diagnostics = {
644 enable = false,
645 icons = {
646 hint = "❔",
647 info = "❕",
648 warning = "❗",
649 error = "❌",
650 }
651 },
652 view = {
653 adaptive_size = true,
654 },
655 renderer = {
656 group_empty = true,
657 },
658 filters = {
659 dotfiles = true,
660 },
661})
662
663-- }}} nvim-tree --
664
665-- barbar.nvim {{{ --
666
667vim.g.barbar_auto_setup = false -- disable auto-setup
668
669require'barbar'.setup {
670 animation = false,
671 auto_hide = true,
672 tabpages = true,
673 closable = true,
674 clickable = false,
675 icons = {
676 diagnostics = {
677 -- `vim.diagnostic.severity`
678 [vim.diagnostic.severity.ERROR] = {enabled = true, icon = '❌'},
679 [vim.diagnostic.severity.WARN] = {enabled = false},
680 [vim.diagnostic.severity.INFO] = {enabled = false},
681 [vim.diagnostic.severity.HINT] = {enabled = true},
682 },
683 filetype = {
684 custom_colors = false,
685 enabled = true,
686 },
687 separator = { left = '▎', right = ''},
688 modified = { button = '•'},
689 pinned = { button = '車', filename = true, separator = { right = ''}},
690 },
691
692 insert_at_end = false,
693 insert_at_start = false,
694
695 maximum_padding = 1,
696 minimum_padding = 1,
697 maximum_length = 30,
698 semantic_letters = true,
699 letters = 'arstneoidhqwfpluy;zxcvkmARSTNEOIDHQWFPLUYZXCVKM',
700 no_name_title = nil,
701}
702
703local nvim_tree_events = require('nvim-tree.events')
704local bufferline_api = require('bufferline.api')
705
706local function get_tree_size()
707 return require'nvim-tree.view'.View.width
708end
709
710nvim_tree_events.subscribe('TreeOpen', function()
711 bufferline_api.set_offset(get_tree_size())
712end)
713
714nvim_tree_events.subscribe('Resize', function()
715 bufferline_api.set_offset(get_tree_size())
716end)
717
718nvim_tree_events.subscribe('TreeClose', function()
719 bufferline_api.set_offset(0)
720end)
721
722-- }}} 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 @@
1-- ┌───────────────────┐
2-- │ ▜ ▗ │
3-- │▛▀▖▐ ▌ ▌▞▀▌▄ ▛▀▖▞▀▘│
4-- │▙▄▘▐ ▌ ▌▚▄▌▐ ▌ ▌▝▀▖│
5-- │▌ ▘▝▀▘▗▄▘▀▘▘ ▘▀▀ │
6-- └───────────────────┘
7
8return require('packer').startup(function(use)
9 -- packer can manage itself
10 use 'wbthomason/packer.nvim'
11
12 -- improve startup time
13 -- remove when merged
14 -- https://github.com/neovim/neovim/pull/15436
15 use 'lewis6991/impatient.nvim'
16
17 -- latex suite
18 use {'lervag/vimtex', ft = {'tex', 'latex', 'plaintext'}}
19 -- provides external ltex file handling and other functions
20 use 'barreiroleo/ltex-extra.nvim'
21
22 -- treesitter
23 use {
24 'nvim-treesitter/nvim-treesitter',
25 run = ':TSUpdate'
26 }
27 -- quickstart lsp config
28 use 'neovim/nvim-lspconfig'
29 -- visualize lsp progress
30 use {
31 'j-hui/fidget.nvim',
32 branch = 'legacy',
33 }
34 -- extra rust-analyzer functionality
35 use 'simrat39/rust-tools.nvim'
36
37 -- annotation generator
38 use {
39 "danymat/neogen",
40 config = function()
41 require('neogen').setup {}
42 end,
43 requires = "nvim-treesitter/nvim-treesitter",
44 }
45
46 -- dashboard
47 use {
48 'glepnir/dashboard-nvim',
49 event = 'VimEnter',
50 requires = {'nvim-tree/nvim-web-devicons'}
51 }
52
53 -- completion suite
54 use 'hrsh7th/nvim-cmp'
55 use ({
56 'hrsh7th/cmp-nvim-lsp',
57 'hrsh7th/cmp-buffer',
58 'hrsh7th/cmp-path',
59 'quangnguyen30192/cmp-nvim-ultisnips',
60 after = { 'hrsh7th/nvim-cmp' },
61 requires = { 'hrsh7th/nvim-cmp' },
62 })
63
64 -- find, filter, preview, pick
65 use {
66 'nvim-telescope/telescope.nvim',
67 requires = { 'nvim-lua/plenary.nvim' }
68 }
69 use {'nvim-telescope/telescope-fzf-native.nvim', run = 'make' }
70
71 -- git integration for buffers
72 use {
73 'lewis6991/gitsigns.nvim',
74 requires = {
75 'nvim-lua/plenary.nvim'
76 },
77 }
78
79 -- manages tag files
80 use 'ludovicchabant/vim-gutentags'
81 -- type in file send to repl
82 use 'jpalardy/vim-slime'
83 -- snippets to expand
84 use {'SirVer/ultisnips', 'honza/vim-snippets'}
85 -- autopairs for neovim
86 use 'windwp/nvim-autopairs'
87 -- indent guides
88 use 'lukas-reineke/indent-blankline.nvim'
89
90 -- i3 config filetype
91 use 'mboughaba/i3config.vim'
92
93 -- file explorer
94 use 'kyazdani42/nvim-tree.lua'
95
96 -- undo tree
97 use {
98 'mbbill/undotree',
99 cmd = 'UndotreeToggle',
100 config = [[vim.g.undotree_SetFocusWhenToggle = 1]],
101 }
102
103 -- highlight colors
104 use 'norcalli/nvim-colorizer.lua'
105
106 -- cutlass suite, x, d, \ys etc.
107 use {
108 'svermeulen/vim-cutlass',
109 'svermeulen/vim-subversive',
110 'svermeulen/vim-yoink'
111 }
112
113 -- personal wiki
114 use 'vimwiki/vimwiki'
115 -- change ASCII text to Turkish text
116 use 'yigitsever/turkish-deasciifier.vim'
117
118 -- text alignment \w :Tab
119 use 'godlygeek/tabular'
120 -- move selections up and down with alt+[j,k]
121 use 'matze/vim-move'
122 -- surround text objects; sa, sr and sd
123 use 'machakann/vim-sandwich'
124 -- see the contents of registers on "/<CTRL-R>
125 use 'junegunn/vim-peekaboo'
126 -- use <leader>k to highlight multiple words)
127 use 'lfv89/vim-interestingwords'
128 -- swap delimited items using g>, g<
129 use 'machakann/vim-swap'
130
131 -- sneak, but in l u a
132 use 'ggandor/leap.nvim'
133 -- additional text objects, don't remove this ever again you fuck
134 use 'wellle/targets.vim'
135 -- enhanced increment/decrement plugin ala speeddating
136 use 'monaqa/dial.nvim'
137 -- comment helper
138 use 'numToStr/Comment.nvim'
139
140 -- icon pack
141 use 'nvim-tree/nvim-web-devicons'
142 -- statusline of the $CURRENT_YEAR
143 use {
144 'nvim-lualine/lualine.nvim',
145 requires = {'nvim-tree/nvim-web-devicons', opt = true}
146 }
147 -- tabline
148 use {'romgrk/barbar.nvim', wants = 'nvim-web-devicons'}
149 -- colour theme of the $CURRENT_YEAR
150 use { "catppuccin/nvim", as = "catppuccin" }
151
152 -- search for, substitute, and abbreviate multiple variants of a word
153 use 'tpope/vim-abolish'
154 -- enable repeating supported plugin maps with '.'
155 use 'tpope/vim-repeat'
156 -- pairs of handy bracket mappings
157 use 'tpope/vim-unimpaired'
158 -- git wrapper
159 use {
160 'tpope/vim-fugitive', cmd = {'Git', 'Gstatus', 'Gblame', 'Gpush', 'Gpull'}
161 }
162 -- provides ga, show unicode stuff of char under cursor
163 use 'tpope/vim-characterize'
164 -- asynchronous build and test dispatcher
165 use {'tpope/vim-dispatch', opt = true, cmd = {'Dispatch', 'Make', 'Focus', 'Start'}}
166 -- automatically adjust 'shiftwidth' and 'expandtab'
167 use 'tpope/vim-sleuth'
168end)
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 @@
1return {
2 {
3 "romgrk/barbar.nvim",
4 dependencies = {
5 'lewis6991/gitsigns.nvim',
6 "nvim-tree/nvim-web-devicons"
7 },
8 init = function()
9 vim.g.barbar_auto_setup = false -- disable auto-setup
10 local map = require("helpers.keys").map
11
12 -- move to previous/next
13 map('n', '<A-,>', '<Cmd>BufferPrevious<CR>', "switch to previous buffer")
14 map('n', '<A-.>', '<Cmd>BufferNext<CR>', "switch to next buffer")
15
16 -- re-order to previous/next
17 map('n', '<A-e>', '<Cmd>BufferMovePrevious<CR>', "move buffer back")
18 map('n', '<A-i>', '<Cmd>BufferMoveNext<CR>', "move buffer forward")
19
20 -- goto buffer in position...
21 map('n', '<A-1>', '<Cmd>BufferGoto 1<CR>')
22 map('n', '<A-2>', '<Cmd>BufferGoto 2<CR>')
23 map('n', '<A-3>', '<Cmd>BufferGoto 3<CR>')
24 map('n', '<A-4>', '<Cmd>BufferGoto 4<CR>')
25 map('n', '<A-5>', '<Cmd>BufferGoto 5<CR>')
26 map('n', '<A-6>', '<Cmd>BufferGoto 6<CR>')
27 map('n', '<A-7>', '<Cmd>BufferGoto 7<CR>')
28 map('n', '<A-8>', '<Cmd>BufferGoto 8<CR>')
29 map('n', '<A-9>', '<Cmd>BufferGoto 9<CR>')
30 map('n', '<A-0>', '<Cmd>BufferLast<CR>')
31
32 -- pin/unpin buffer
33 map('n', '<A-p>', '<Cmd>BufferPin<CR>', "pin buffer")
34 -- close buffer
35 map('n', '<A-c>', '<Cmd>BufferClose<CR>', "close buffer")
36 -- magic buffer-picking mode
37 map('n', '<leader>dg', '<Cmd>BufferPick<CR>', "buffer picking mode")
38 -- sort automatically by...
39 map('n', '<Leader>db', '<Cmd>BufferOrderByBufferNumber<CR>', "sort buffers by number")
40 map('n', '<Leader>dd', '<Cmd>BufferOrderByDirectory<CR>', "sort buffers by directory")
41 map('n', '<Leader>dl', '<Cmd>BufferOrderByLanguage<CR>', "sort buffers by language")
42 map('n', '<Leader>dw', '<Cmd>BufferOrderByWindowNumber<CR>', "sort buffers by window number")
43 end,
44 opts = {
45 animation = false,
46 auto_hide = true,
47 tabpages = true,
48 closable = true,
49 clickable = false,
50 icons = {
51 diagnostics = {
52 [vim.diagnostic.severity.ERROR] = {enabled = true, icon = '❌'},
53 [vim.diagnostic.severity.WARN] = {enabled = false},
54 [vim.diagnostic.severity.INFO] = {enabled = false},
55 [vim.diagnostic.severity.HINT] = {enabled = true},
56 },
57 filetype = {
58 custom_colors = false,
59 enabled = true,
60 },
61 separator = { left = '▎', right = ''},
62 modified = { button = ''},
63 pinned = { button = '', filename = true, separator = { right = ''}},
64 },
65
66 insert_at_end = false,
67 insert_at_start = false,
68
69 maximum_padding = 1,
70 minimum_padding = 1,
71 maximum_length = 30,
72 semantic_letters = true,
73 letters = 'arstneoidhqwfpluy;zxcvkmARSTNEOIDHQWFPLUYZXCVKM',
74 no_name_title = nil,
75 },
76 },
77}
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 @@
1-- autocompletion
2return {
3 {
4 "hrsh7th/nvim-cmp",
5 event = "InsertEnter",
6 dependencies = {
7 "hrsh7th/cmp-nvim-lsp",
8 "hrsh7th/cmp-nvim-lua",
9 "hrsh7th/cmp-buffer",
10 "hrsh7th/cmp-path",
11 "L3MON4D3/LuaSnip",
12 "saadparwaiz1/cmp_luasnip",
13 "rafamadriz/friendly-snippets",
14 },
15 config = function()
16 local cmp = require("cmp")
17 local luasnip = require("luasnip")
18
19 require("luasnip/loaders/from_vscode").lazy_load()
20
21 local kind_icons = {
22 Text = "󰊄",
23 Method = "m",
24 Function = "󰊕",
25 Constructor = "",
26 Field = "󰽏",
27 Variable = "󰫧",
28 Class = "󰌗",
29 Interface = "",
30 Module = "",
31 Property = "",
32 Unit = "",
33 Value = "󰎠",
34 Enum = "",
35 Keyword = "",
36 Snippet = "",
37 Color = "󰏘",
38 File = "󰈙",
39 Reference = "",
40 Folder = "󰉋",
41 EnumMember = "",
42 Constant = "󰇽",
43 Struct = "",
44 Event = "",
45 Operator = "󰆕",
46 TypeParameter = "",
47 }
48
49 cmp.setup({
50 enabled = true,
51 snippet = {
52 expand = function(args)
53 luasnip.lsp_expand(args.body)
54 end,
55 },
56 mapping = cmp.mapping.preset.insert({
57 ["<C-k>"] = cmp.mapping.select_prev_item(),
58 ["<C-j>"] = cmp.mapping.select_next_item(),
59 ["<C-d>"] = cmp.mapping.scroll_docs(-4),
60 ["<C-f>"] = cmp.mapping.scroll_docs(4),
61 ["<CR>"] = cmp.mapping.confirm({
62 behavior = cmp.ConfirmBehavior.Replace,
63 select = false,
64 }),
65 ["<Tab>"] = cmp.mapping(function(fallback)
66 if cmp.visible() then
67 cmp.select_next_item()
68 elseif luasnip.expand_or_jumpable() then
69 luasnip.expand_or_jump()
70 else
71 fallback()
72 end
73 end, { "i", "s" }),
74 ["<S-Tab>"] = cmp.mapping(function(fallback)
75 if cmp.visible() then
76 cmp.select_prev_item()
77 elseif luasnip.jumpable(-1) then
78 luasnip.jump(-1)
79 else
80 fallback()
81 end
82 end, { "i", "s" }),
83 }),
84 formatting = {
85 fields = { "kind", "abbr", "menu" },
86 format = function(entry, vim_item)
87 -- kind icons
88 vim_item.kind = string.format("%s", kind_icons[vim_item.kind])
89 vim_item.menu = ({
90 nvim_lsp = "[lsp]",
91 luasnip = "[snippet]",
92 buffer = "[buffer]",
93 path = "[path]",
94 })[entry.source.name]
95 return vim_item
96 end,
97 },
98 sources = {
99 { name = "nvim_lsp" },
100 { name = "luasnip" },
101 { name = "buffer" },
102 { name = "path" },
103 },
104 })
105
106 -- If you want insert `(` after select function or method item
107 local cmp_autopairs = require('nvim-autopairs.completion.cmp')
108 cmp.event:on(
109 'confirm_done',
110 cmp_autopairs.on_confirm_done()
111 )
112 end,
113 },
114}
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 @@
1return {
2 {
3 "catppuccin/nvim",
4 name = "catppuccin",
5 lazy = false,
6 priority = 1000,
7 config = function()
8 require("catppuccin").setup({
9 flavour = "mocha", -- latte, frappe, macchiato, mocha
10 background = {
11 light = "latte",
12 dark = "mocha",
13 },
14 transparent_background = false,
15 term_colors = false,
16 no_italic = true, -- force no italic
17 no_bold = false, -- force no bold
18 integrations = {
19 barbar = true,
20 cmp = true,
21 fidget = true,
22 gitsigns = true,
23 leap = true,
24 nvimtree = true,
25 telescope = true,
26 treesitter = true,
27 vimwiki = true,
28 },
29 native_lsp = {
30 enabled = true,
31 underlines = {
32 errors = { "underline" },
33 hints = { "underline" },
34 warnings = { "underline" },
35 information = { "underline" },
36 },
37 },
38 indent_blankline = {
39 enabled = true,
40 },
41 })
42 vim.cmd("colorscheme catppuccin")
43 end,
44 },
45}
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 @@
1return {
2 {
3 'svermeulen/vim-cutlass',
4 },
5 {
6 'svermeulen/vim-subversive',
7 config = function()
8 local map = require("helpers.keys").map
9
10 -- substitute from yank
11 map('n', '<Leader>ys', '<plug>(SubversiveSubstitute)', "substitute from yank")
12 map('n', '<Leader>yss', '<plug>(SubversiveSubstituteLine)', "substitute from yank, line")
13 map('n', '<Leader>yS', '<plug>(SubversiveSubstituteToEndOfLine)', "substitute from yank, eol")
14
15 -- substitute over range
16 map( { 'n', 'x' }, '<Leader>s', '<plug>(SubversiveSubstituteRange)', "start substitude over range")
17 map('n', '<Leader>ss', '<plug>(SubversiveSubstituteWordRange)', "start substitude over range")
18 end
19 },
20 {
21 'svermeulen/vim-yoink',
22 config = function()
23 vim.g.yoinkIncludeDeleteOperations = 1
24
25 -- fix the Target STRING not available
26 vim.g.clipboard = {
27 name = 'xsel_override',
28 copy = {
29 ['+'] = 'xsel --input --clipboard',
30 ['*'] = 'xsel --input --primary',
31 },
32 paste = {
33 ['+'] = 'xsel --output --clipboard',
34 ['*'] = 'xsel --output --primary',
35 },
36 cache_enabled = 1,
37 }
38
39 local map = require("helpers.keys").map
40
41 -- yoink paste
42 map('n', 'p', '<Plug>(YoinkPaste_p)')
43 map('n', 'P', '<Plug>(YoinkPaste_P)')
44
45 -- iterate over yank list
46 map('n', '<c-n>', '<Plug>(YoinkPostPasteSwapBack)')
47 map('n', '<c-p>', '<Plug>(YoinkPostPasteSwapForward)')
48
49 end,
50 }
51}
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 @@
1return {
2 {
3 'glepnir/dashboard-nvim',
4 event = 'VimEnter',
5 config = function()
6 require('dashboard').setup {
7 theme = 'hyper',
8 change_to_vcs_root = true,
9 config = {
10 week_header = {
11 enable = true,
12 },
13 shortcut = {
14 {
15 desc = '󰊳 Update', group = '@property', action = 'Lazy update', key = 'u',
16 },
17 {
18 icon = ' ',
19 icon_hl = '@variable',
20 desc = 'Files',
21 group = 'Label',
22 action = 'Telescope find_files',
23 key = 'f',
24 },
25 },
26 },
27
28 }
29 end,
30 dependencies = {
31 {
32 'nvim-tree/nvim-web-devicons'
33 }
34 }
35 }
36}
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 @@
1return {
2 {
3 "nvim-tree/nvim-web-devicons",
4 opts = {
5 override = {
6 wiki = {
7 icon = "󰂺",
8 color = "#D7827E",
9 name = "vimwiki"
10 },
11 rem = {
12 icon = " ",
13 color = "#B4637A",
14 name = "remind"
15 },
16 mail = {
17 icon = "󰇰 ",
18 color = "#907AA9",
19 name = "mail"
20 },
21 },
22 default = true
23 },
24 },
25}
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 @@
1return {
2 {
3 "lewis6991/gitsigns.nvim",
4 opts = {
5 signs = {
6 add = { text = '│' },
7 change = { text = '│' },
8 delete = { text = '_' },
9 topdelete = { text = '‾' },
10 changedelete = { text = '~' },
11 untracked = { text = '┆' },
12 },
13 signcolumn = true, -- Toggle with `:Gitsigns toggle_signs`
14 numhl = false, -- Toggle with `:Gitsigns toggle_numhl`
15 linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
16 word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff`
17 watch_gitdir = {
18 follow_files = true
19 },
20 attach_to_untracked = true,
21 current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
22 current_line_blame_opts = {
23 virt_text = true,
24 virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align'
25 delay = 1000,
26 ignore_whitespace = false,
27 },
28 current_line_blame_formatter = '<author>, <author_time:%Y-%m-%d> - <summary>',
29 sign_priority = 6,
30 update_debounce = 100,
31 status_formatter = nil, -- Use default
32 max_file_length = 40000, -- Disable if file is longer than this (in lines)
33 preview_config = {
34 -- Options passed to nvim_open_win
35 border = 'single',
36 style = 'minimal',
37 relative = 'cursor',
38 row = 0,
39 col = 1
40 },
41 yadm = {
42 enable = true
43 },
44
45 on_attach = function(bufnr)
46 local gs = package.loaded.gitsigns
47
48 local function map(mode, l, r, desc, opts)
49 opts = opts or {}
50 opts.buffer = bufnr
51 opts.desc = desc
52 vim.keymap.set(mode, l, r, opts)
53 end
54
55 -- navigation
56 map('n', ']c', function()
57 if vim.wo.diff then return ']c' end
58 vim.schedule(function() gs.next_hunk() end)
59 return '<Ignore>'
60 end, "jump to next hunk", { expr = true })
61
62 map('n', '[c', function()
63 if vim.wo.diff then return '[c' end
64 vim.schedule(function() gs.prev_hunk() end)
65 return '<Ignore>'
66 end, "jump to previous hunk", { expr = true })
67
68 -- Actions
69 map('n', '<leader>hs', gs.stage_hunk, "stage hunk")
70 map('n', '<leader>hr', gs.reset_hunk, "reset hunk")
71 map('v', '<leader>hs', function() gs.stage_hunk { vim.fn.line('.'), vim.fn.line('v') } end,
72 "stage selection")
73 map('v', '<leader>hr', function() gs.reset_hunk { vim.fn.line('.'), vim.fn.line('v') } end,
74 "reset selection")
75 map('n', '<leader>hS', gs.stage_buffer, "stage buffer")
76 map('n', '<leader>hu', gs.undo_stage_hunk, "undo stage hunk")
77 map('n', '<leader>hR', gs.reset_buffer, "undo reset buffer")
78 map('n', '<leader>hp', gs.preview_hunk, "preview hunk")
79 map('n', '<leader>hb', function() gs.blame_line { full = true } end, "blame line")
80 map('n', '<leader>tb', gs.toggle_current_line_blame, "toggle current line blame")
81 map('n', '<leader>hd', gs.diffthis, "diff this")
82 map('n', '<leader>hD', function() gs.diffthis('~') end, "diff whole buffer")
83 map('n', '<leader>td', gs.toggle_deleted, "toggle deleted")
84
85 -- Text object
86 map({ 'o', 'x' }, 'ih', ':<C-U>Gitsigns select_hunk<CR>', "select hunk")
87 end
88
89 },
90 },
91 {
92 "tpope/vim-fugitive",
93 cmd = { 'Git', 'Gstatus', 'Gblame', 'Gpush', 'Gpull' },
94 },
95}
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 @@
1return {
2 {
3 "lukas-reineke/indent-blankline.nvim",
4 init = function()
5 vim.opt.list = true
6 end,
7 config = {
8 show_current_context = true,
9 char = "┊",
10 buftype_exclude = {"terminal"},
11 filetype_exclude = {"dashboard", "help", "man"}
12 },
13 },
14}
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 @@
1return {
2 {
3 "lervag/vimtex",
4 ft = { 'tex', 'latex', 'plaintext' },
5 init = function()
6 vim.g.vimtex_view_method = 'zathura'
7 vim.g.vimtex_quickfix_mode = 0
8 vim.g.vimtex_quickfix_ignore_filters = {"Underfull", "Overfull"}
9 vim.g.vimtex_compiler_latexmk = {
10 options = {
11 "-pdf", '-shell-escape', '-verbose', '-file-line-error', '-synctex=1', '-interaction=nonstopmode'
12 }
13 }
14 end,
15 },
16}
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 @@
1return {
2 {
3 "neovim/nvim-lspconfig",
4 dependencies = {
5 "williamboman/mason.nvim",
6 "williamboman/mason-lspconfig.nvim",
7 "j-hui/fidget.nvim",
8 "folke/neodev.nvim",
9 "RRethy/vim-illuminate",
10 "hrsh7th/cmp-nvim-lsp",
11 },
12 config = function()
13 local map = require("helpers.keys").map
14
15 map('n', '<leader>e', vim.diagnostic.open_float, "lsp: open diagnostics float")
16 map('n', '[d', vim.diagnostic.goto_prev, "lsp: goto previous diagnostic")
17 map('n', ']d', vim.diagnostic.goto_next, "lsp: goto next diagnostic")
18
19 -- set up mason before anything else
20 require("mason").setup()
21 require("mason-lspconfig").setup({
22 ensure_installed = {
23 "lua_ls",
24 "pylsp",
25 },
26 automatic_installation = true,
27 })
28
29 -- quick access via keymap
30 require("helpers.keys").map("n", "<leader>M", "<cmd>Mason<cr>", "show mason")
31
32 -- neodev setup before lsp config
33 require("neodev").setup()
34
35 -- set up cool signs for diagnostics
36 local signs = { Error = " ", Warn = "", Hint = "", Info = "" }
37 for type, icon in pairs(signs) do
38 local hl = "DiagnosticSign" .. type
39 vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" })
40 end
41
42 -- Diagnostic config
43 local config = {
44 virtual_text = false,
45 signs = {
46 active = signs,
47 },
48 update_in_insert = true,
49 underline = true,
50 severity_sort = true,
51 float = {
52 focusable = true,
53 style = "minimal",
54 border = "rounded",
55 source = "always",
56 header = "",
57 prefix = "",
58 },
59 }
60 vim.diagnostic.config(config)
61
62 -- this function gets run when an lsp connects to a particular buffer.
63 local on_attach = function(client, bufnr)
64 map = require("helpers.keys").lsp_map
65
66 map("<leader>lr", vim.lsp.buf.rename, bufnr, "lsp: rename symbol")
67 map("<leader>la", vim.lsp.buf.code_action, bufnr, "lsp: code action")
68 map("<leader>ld", vim.lsp.buf.type_definition, bufnr, "lsp: type definition")
69 map("<leader>ls", require("telescope.builtin").lsp_document_symbols, bufnr, "lsp: document symbols")
70
71 map("gd", vim.lsp.buf.definition, bufnr, "lsp: goto definition")
72 map("gD", vim.lsp.buf.declaration, bufnr, "lsp: goto declaration")
73 map("gr", require("telescope.builtin").lsp_references, bufnr, "lsp: goto references")
74 map("gI", vim.lsp.buf.implementation, bufnr, "lsp: goto implementation")
75 map("K", vim.lsp.buf.hover, bufnr, "lsp: hover documentation")
76 map("<c-k>", vim.lsp.buf.signature_help, bufnr, "lsp: signature help")
77
78 -- Create a command `:Format` local to the LSP buffer
79 vim.api.nvim_buf_create_user_command(bufnr, "Format", function(_)
80 vim.lsp.buf.format()
81 end, { desc = "lsp: format current buffer" })
82
83 map("<leader>fm", "<cmd>Format<cr>", bufnr, "lsp: format current buffer")
84
85 -- Attach and configure vim-illuminate
86 -- apparently this is deprecated
87 -- https://github.com/RRethy/vim-illuminate/issues/111
88 require("illuminate").on_attach(client)
89 end
90
91 -- nvim-cmp supports additional completion capabilities, so broadcast that to servers
92 local capabilities = vim.lsp.protocol.make_client_capabilities()
93 capabilities = require("cmp_nvim_lsp").default_capabilities(capabilities)
94
95 -- lua
96 require("lspconfig")["lua_ls"].setup({
97 on_attach = on_attach,
98 capabilities = capabilities,
99 settings = {
100 Lua = {
101 completion = {
102 callSnippet = "Replace",
103 },
104 diagnostics = {
105 globals = { "vim" },
106 },
107 workspace = {
108 library = {
109 [vim.fn.expand("$VIMRUNTIME/lua")] = true,
110 [vim.fn.stdpath("config") .. "/lua"] = true,
111 },
112 },
113 },
114 },
115 })
116
117 -- python
118 require("lspconfig")["pylsp"].setup({
119 on_attach = on_attach,
120 capabilities = capabilities,
121 settings = {
122 pylsp = {
123 plugins = {
124 flake8 = {
125 enabled = true,
126 maxLineLength = 88, -- black's line length
127 },
128 -- disable plugins overlapping with flake8
129 pycodestyle = {
130 enabled = false,
131 },
132 mccabe = {
133 enabled = false,
134 },
135 pyflakes = {
136 enabled = false,
137 },
138 -- use black as the formatter
139 autopep8 = {
140 enabled = false,
141 },
142 },
143 },
144 },
145 })
146
147 -- efm
148 require("lspconfig")["efm"].setup({
149 on_attach = on_attach,
150 filetypes = { 'sh' },
151 capabilities = capabilities
152 })
153
154 -- ltex
155 require("lspconfig")["ltex"].setup({
156 capabilities = capabilities,
157 on_attach = function(client, bufnr)
158 on_attach(client, bufnr)
159 require("ltex_extra").setup {
160 load_langs = { "en-GB" },
161 init_check = true,
162 log_level = "none",
163 }
164 end,
165 settings = {
166 ltex = {
167 -- my settings here
168 }
169 }
170 })
171
172 -- rust-tools
173 local rust_opts = {
174 tools = {
175 runnables = {
176 use_telescope = true,
177 },
178 inlay_hints = {
179 auto = true,
180 show_parameter_hints = true,
181 parameter_hints_prefix = "↸ ",
182 other_hints_prefix = "❱ ",
183 },
184 },
185
186 -- all the opts to send to nvim-lspconfig
187 -- these override the defaults set by rust-tools.nvim
188 -- see https://github.com/neovim/nvim-lspconfig/blob/master/CONFIG.md#rust_analyzer
189 server = {
190 on_attach = on_attach,
191 settings = {
192 -- to enable rust-analyzer settings visit:
193 -- https://github.com/rust-analyzer/rust-analyzer/blob/master/docs/user/generated_config.adoc
194 ["rust-analyzer"] = {
195 -- enable clippy on save
196 checkOnSave = {
197 command = "clippy",
198 },
199 },
200 },
201 },
202 }
203
204 require('rust-tools').setup(rust_opts)
205 end,
206 },
207 {
208 "barreiroleo/ltex-extra.nvim",
209 event = "LspAttach",
210 },
211 {
212 "j-hui/fidget.nvim",
213 tag = "legacy",
214 event = "LspAttach",
215 opts = {
216 text = {
217 spinner = "triangle",
218 commenced = "started", -- message shown when task starts
219 completed = "done", -- message shown when task completes
220 },
221 },
222 },
223 {
224 "simrat39/rust-tools.nvim",
225 event = "LspAttach",
226 },
227 -- {
228 -- "RRethy/vim-illuminate",
229 -- opts = {
230 -- filetypes_denylist = {
231 -- 'NvimTree',
232 -- 'fugitive',
233 -- },
234 -- },
235 -- },
236}
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 @@
1return {
2 "nvim-lualine/lualine.nvim",
3 dependencies = {
4 "nvim-tree/nvim-web-devicons"
5 },
6 config = function()
7 local function lualine_spell()
8 if vim.wo.spell then
9 return "spell"
10 else
11 return
12 end
13 end
14
15 local conditions = {
16 spell_on = function ()
17 return vim.wo.spell
18 end,
19 filetype_is_tex = function()
20 return vim.bo.filetype == "tex"
21 end
22 }
23
24 -- https://www.reddit.com/r/neovim/comments/u2uc4p/your_lualine_custom_features/i4muvp6/
25 -- override 'encoding': don't display if encoding is utf-8.
26 local encoding = function()
27 local ret, _ = vim.bo.fenc:gsub("^utf%-8$", "")
28 return ret
29 end
30
31 -- fileformat: don't display if &ff is unix.
32 local fileformat = function()
33 local ret, _ = vim.bo.fileformat:gsub("^unix$", "")
34 return ret
35 end
36
37 require("lualine").setup({
38 options = {
39 icons_enabled = true,
40 theme = "catppuccin",
41 section_separators = { left = '', right = '' },
42 component_separators = { left = '', right = '' },
43 },
44 sections = {
45 lualine_a = {{'mode', fmt = string.lower}},
46 lualine_b = {'branch',
47 {
48 'diff',
49 diff_color= {
50 added = { fg = 'LightGreen' },
51 modified = { fg = 'LightBlue' },
52 removed = { fg = 'LightRed' },
53 }
54 },
55 {
56 lualine_spell,
57 cond = conditions.spell_on,
58 }},
59 lualine_c = {'filename'},
60 lualine_x = {encoding, fileformat, 'filetype'},
61 lualine_y = {'progress'},
62 lualine_z = {
63 'location', {
64 'diagnostics',
65 sources = {'nvim_diagnostic'},
66 sections = {'error', 'warn', 'info', 'hint'},
67 symbols = {error = 'e', warn = 'w', info = 'i', hint = 'h'}
68 }
69 }
70 },
71 inactive_sections = {
72 lualine_a = {},
73 lualine_b = {},
74 lualine_c = {'filename'},
75 lualine_x = {},
76 lualine_y = {},
77 lualine_z = {}
78 },
79 tabline = {},
80 extensions = {}
81
82 })
83 end,
84}
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 @@
1return {
2 {
3 "numToStr/Comment.nvim",
4 lazy = false,
5 opts = {},
6 },
7 {
8 "godlygeek/tabular",
9 lazy = false,
10 },
11 {
12 "matze/vim-move"
13 },
14 {
15 "ggandor/leap.nvim",
16 lazy = false,
17 init = function()
18 local map = require("helpers.keys").map
19
20 map({ "n", "v" }, '`', '<Plug>(leap-forward)', "leap forward")
21 map({ "n", "v" }, '<Leader>`', '<Plug>(leap-backward)', "leap backward")
22 end,
23 opts = {
24 case_insensitive = true,
25 substitute_chars = { ['\r'] = '¬' }
26 }
27 },
28 {
29 "wellle/targets.vim"
30 },
31 {
32 "monaqa/dial.nvim",
33 init = function()
34 local augend = require("dial.augend")
35 require("dial.config").augends:register_group {
36 -- default augends used when no group name is specified
37 default = {
38 augend.integer.alias.decimal, -- nonnegative decimal number (0, 1, 2, 3, ...)
39 augend.integer.alias.hex, -- nonnegative hex number (0x01, 0x1a1f, etc.)
40 augend.date.alias["%Y/%m/%d"], -- date (2022/02/19, etc.)
41 augend.date.alias["%Y-%m-%d"],
42 augend.semver.alias.semver,
43 augend.constant.new {
44 elements = { "and", "or" },
45 word = true, -- if false, "sand" is incremented into "sor", "doctor" into "doctand", etc.
46 cyclic = true, -- "or" is incremented into "and".
47 },
48 augend.constant.new {
49 elements = { "&&", "||" },
50 word = false,
51 cyclic = true,
52 },
53 },
54 }
55 local map = require("helpers.keys").map
56 map("n", "<C-a>", require("dial.map").inc_normal(), "dial: increment")
57 map("n", "<C-x>", require("dial.map").dec_normal(), "dial: decrement")
58 map("v", "<C-a>", require("dial.map").inc_visual(), "dial: visual increment")
59 map("v", "<C-x>", require("dial.map").dec_visual(), "dial: visual decrement")
60 end,
61 },
62 {
63 "kylechui/nvim-surround",
64 version = "*", -- Use for stability; omit to use `main` branch for the latest features
65 event = "VeryLazy",
66 config = function()
67 require("nvim-surround").setup({})
68 end
69 },
70 {
71 "windwp/nvim-autopairs",
72 event = "InsertEnter",
73 opts = {
74 disable_filetype = { "TelescopePrompt" },
75 },
76 init = function()
77 local Rule = require('nvim-autopairs.rule')
78 local npairs = require('nvim-autopairs')
79
80 npairs.add_rule(Rule('%"', '%"', "remind"))
81 end
82 },
83}
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 @@
1return {
2 {
3 "nvim-tree/nvim-tree.lua",
4 lazy = false,
5 dependencies = {
6 "nvim-tree/nvim-web-devicons",
7 },
8 opts = {
9 sort_by = "case_sensitive",
10 diagnostics = {
11 enable = false,
12 icons = {
13 hint = "❔",
14 info = "❕",
15 warning = "❗",
16 error = "❌",
17 }
18 },
19 view = {
20 adaptive_size = true,
21 },
22 renderer = {
23 group_empty = true,
24 },
25 filters = {
26 dotfiles = true,
27 },
28 },
29 init = function()
30 vim.g.loaded_netrw = 1
31 vim.g.loaded_netrwPlugin = 1
32
33 local map = require("helpers.keys").map
34
35 map("n", "vt", "<cmd>NvimTreeToggle<cr>")
36 map("n", "vr", "<cmd>NvimTreeRefresh<cr>")
37 map("n", "vs", "<cmd>NvimTreeFindFile<cr>")
38 end,
39 },
40}
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 @@
1return {
2 {
3 "nvim-telescope/telescope.nvim",
4 dependencies = {
5 "nvim-lua/plenary.nvim",
6 {
7 "nvim-telescope/telescope-fzf-native.nvim",
8 build = "make",
9 cond = vim.fn.executable("make") == 1
10 },
11 },
12 config = function()
13 require('telescope').setup({
14 extensions = {
15 fzf = {
16 fuzzy = true, -- false will only do exact matching
17 override_generic_sorter = true,
18 override_file_sorter = true,
19 case_mode = "smart_case",
20 }
21 }
22 })
23 -- Enable telescope fzf native, if installed
24 pcall(require("telescope").load_extension, "fzf")
25
26 local map = require("helpers.keys").map
27
28 map("n", "<leader>fr", require("telescope.builtin").oldfiles, "recently opened")
29 map("n", "<leader><space>", require("telescope.builtin").buffers, "open buffers")
30 map("n", "<leader>/", function()
31 -- You can pass additional configuration to telescope to change theme, layout, etc.
32 require("telescope.builtin").current_buffer_fuzzy_find(require("telescope.themes").get_dropdown({
33 winblend = 10,
34 previewer = false,
35 }))
36 end, "search in current buffer")
37
38 map("n", "<leader>sf", require("telescope.builtin").find_files, "files")
39 map("n", "<leader>sh", require("telescope.builtin").help_tags, "help")
40 map("n", "<leader>sw", require("telescope.builtin").grep_string, "current word")
41 map("n", "<leader>sg", require("telescope.builtin").live_grep, "grep")
42 map("n", "<leader>sd", require("telescope.builtin").diagnostics, "diagnostics")
43 end,
44 },
45}
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 @@
1return {
2 {
3 "tpope/vim-repeat"
4 },
5 {
6 "tpope/vim-unimpaired"
7 },
8 {
9 "tpope/vim-characterize"
10 },
11}
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 @@
1return {
2 {
3 "nvim-treesitter/nvim-treesitter",
4 build = function()
5 pcall(require("nvim-treesitter.install").update({ with_sync = true }))
6 end,
7 dependencies = {
8 "nvim-treesitter/nvim-treesitter-textobjects",
9 },
10 config = function()
11 require("nvim-treesitter.configs").setup({
12 ensure_installed = { "bash", "bibtex", "c", "cpp", "css", "fish", "http", "latex", "lua", "python", "rust", "vim" },
13 ignore_install = { },
14 auto_install = true,
15 sync_install = false,
16 highlight = {
17 enable = true,
18 disable = { "latex" },
19 additional_vim_regex_highlighting = false,
20 },
21 indent = {
22 enable = true,
23 disable = { "python" }
24 },
25 incremental_selection = {
26 enable = true,
27 keymaps = {
28 init_selection = "gnn",
29 node_incremental = "grn",
30 scope_incremental = "grc",
31 node_decremental = "grm",
32 },
33 },
34 textobjects = {
35 select = {
36 enable = true,
37 lookahead = true, -- automatically jump forward to textobj, similar to targets.vim
38 keymaps = {
39 -- you can use the capture groups defined in textobjects.scm
40 ["aa"] = "@parameter.outer",
41 ["ia"] = "@parameter.inner",
42 ["af"] = "@function.outer",
43 ["if"] = "@function.inner",
44 ["ac"] = "@class.outer",
45 ["ic"] = "@class.inner",
46 },
47 },
48 move = {
49 enable = true,
50 set_jumps = true, -- whether to set jumps in the jumplist
51 goto_next_start = {
52 ["]m"] = "@function.outer",
53 ["]]"] = "@class.outer",
54 },
55 goto_next_end = {
56 ["]M"] = "@function.outer",
57 ["]["] = "@class.outer",
58 },
59 goto_previous_start = {
60 ["[m"] = "@function.outer",
61 ["[["] = "@class.outer",
62 },
63 goto_previous_end = {
64 ["[M"] = "@function.outer",
65 ["[]"] = "@class.outer",
66 },
67 },
68 },
69 modules = { },
70 })
71 end,
72 },
73}
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 @@
1return {
2 "folke/trouble.nvim",
3 dependencies = { "nvim-tree/nvim-web-devicons" },
4 opts = {},
5 config = function()
6 local map = require("helpers.keys").map
7 map("n", "<leader>xx", function() require("trouble").open() end, "trouble: open")
8 map("n", "<leader>xw", function() require("trouble").open("workspace_diagnostics") end, "trouble: open workspace diagnostics")
9 map("n", "<leader>xd", function() require("trouble").open("document_diagnostics") end, "trouble: open document diagnostics")
10 map("n", "<leader>xq", function() require("trouble").open("quickfix") end, "trouble: open quickfix")
11 map("n", "<leader>xl", function() require("trouble").open("loclist") end, "trouble: open loclist")
12 map("n", "gR", function() require("trouble").open("lsp_references") end, "trouble: open lsp references")
13 end,
14}
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 @@
1return {
2 {
3 "yigitsever/turkish-deasciifier.vim",
4 init = function()
5 local map = require("helpers.keys").map
6
7 -- brute force deasciify everything
8 map({ "n", "x" }, "<leader>tc", "TurkishDeasciifyForce()", "force turkish characters",
9 { expr = true })
10 map("n", "<leader>tctc", "TurkishDeasciifyForce() .. '_'", "force turkish characters eol",
11 { expr = true })
12
13 -- use turkish-mode to selectively deasciify
14 map({ "n", "x" }, "<Leader>tr", "TurkishDeasciify()", "infer turkish characters", { expr = true })
15 map("n", "<Leader>trtr", "TurkishDeasciify() .. '_'", "infer turkish characters eol",
16 { expr = true })
17
18 -- ascii everything
19 map({ "n", "x" }, "<Leader>rt", "TurkishAsciify()", "remove turkish characters", { expr = true })
20 map("n", "<Leader>rtrt", "TurkishAsciify() .. '_'", "remove turkish characters eol",
21 { expr = true })
22 end,
23 }
24}
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 @@
1return {
2 {
3 "vimwiki/vimwiki",
4 init = function ()
5 vim.g.vimwiki_list = {
6 {
7 path = '/home/yigit/nextcloud/personal_wiki/text',
8 path_html = '/home/yigit/nextcloud/personal_wiki/html',
9 auto_generate_tags = 1,
10 automatic_nested_syntaxes = 1,
11 template_path = '/home/yigit/nextcloud/personal_wiki/templates',
12 template_default = 'default_template',
13 template_ext = '.html',
14 auto_export = 1,
15 auto_tags = 1
16 }
17 }
18 vim.g.vimwiki_hl_headers = 1
19
20 local map = require("helpers.keys").map
21
22 --toggle checkmarks
23 map('n', '<leader>v', '<Plug>VimwikiToggleListItem', "vimwiki: toggle checkmark")
24 -- add/increase header level
25 map('n', '<leader>a', '<Plug>VimwikiAddHeaderLevel', "vimwiki: add header level")
26 end,
27 },
28}
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 @@
1return {
2 {
3 "folke/which-key.nvim",
4 event = "VeryLazy",
5 init = function()
6 vim.o.timeout = true
7 vim.o.timeoutlen = 500
8 end,
9 config = function()
10 local wk = require("which-key")
11 wk.setup()
12 end,
13 }
14}
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 @@
1-- ┌───────────────────────┐
2-- │ ▐ ▐ ▗ │
3-- │▞▀▘▞▀▖▜▀ ▜▀ ▄ ▛▀▖▞▀▌▞▀▘│
4-- │▝▀▖▛▀ ▐ ▖▐ ▖▐ ▌ ▌▚▄▌▝▀▖│
5-- │▀▀ ▝▀▘ ▀ ▀ ▀▘▘ ▘▗▄▘▀▀ │
6-- └───────────────────────┘
7
8local o = vim.o -- [o]ptions
9local wo = vim.wo -- [w]indow-local [o]ptions
10local bo = vim.bo -- [b]uffer-local [o]ptions
11local go = vim.go -- [g]lobal [o]ptions
12local opt = vim.opt -- convenient :set
13
14-- neovim filetype lua
15go.do_filetype_lua = true
16go.did_load_filetypes = false
17
18-- look & feel
19o.termguicolors = true
20
21-- interact with system clipboard
22opt.clipboard:append('unnamedplus')
23
24-- copy indent on a new line
25o.autoindent = true
26
27-- :h tabstop, 2. point
28-- use appropriate number of spaces to insert a <Tab>
29o.expandtab = true
30o.shiftwidth = 4
31o.softtabstop = 4
32o.tabstop = 8
33
34-- use english for spellchecking, but don't spellcheck by default
35wo.spell = true
36bo.spelllang = "en_gb"
37wo.spell = false
38
39-- tab completion, zsh style
40o.wildmode = "longest:full,full"
41opt.wildignore = {
42 '*.o', '*.obj', '*.class', '*.aux', '*.lof', '*.log', '*.lot', '*.fls',
43 '*.toc', '*.fmt', '*.fot', '*.cb', '*.cb2', '.*.lb', '.dvi', '*.xdv',
44 '*.bbl', '*.bcf', '*.blg', '*-blx.aux', '*-blx.bib', '*.run.xml',
45 '*.fdb_latexmk', '*.synctex', '*.synctex(busy)', '*.synctex.gz',
46 '*.synctex.gz(busy)', '*.pdfsync'
47}
48
49-- put one space while joining (not two)
50o.joinspaces = false
51
52-- keep n lines above/below cursor while scrolling
53o.scrolloff = 4
54-- line numbers
55o.number = true
56-- fold manually, when I place markers
57o.foldmethod = "marker"
58-- set the terminal title
59o.title = true
60-- wrap using 'breakat' character
61o.linebreak = true
62-- new split panes will split to below and right
63o.splitbelow = true
64o.splitright = true
65-- highlight the current line, yoc undoes
66o.cursorline = true
67-- current line actual number, rest are relative
68o.relativenumber = true
69-- we are already using a cursorline, don't clobber linter messages
70o.showmode = false
71-- jump to the matching bracket briefly
72o.showmatch = true
73-- wait 500 ms for a mapped sequence to complete
74o.timeoutlen = 500
75
76-- persistent undo
77o.undofile = true
78
79-- lower case searches ignore case, upper case searches do not
80o.ignorecase = true
81o.smartcase = true
82
83-- https://stackoverflow.com/a/3445040/
84-- switch case labels
85o.cinoptions = "l1"
86
87if vim.fn.executable("rg") then
88 o.grepprg = "rg --vimgrep --no-heading --smart-case"
89 o.grepformat = "%f:%l:%c:%m,%f:%l:%m"
90end
91
92-- iwhite: ignore changes in amount of white space.
93-- vertical: start diff mode with vertical splits
94-- filler: show filler lines,
95opt.diffopt = {
96 "iwhite", "vertical", "filler", "algorithm:patience", "indent-heuristic"
97}
98
99-- menu: use a popup menu to show the possible completions
100-- preview: show extra information
101opt.completeopt = {"menu", "menuone", "noselect"}
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 @@
1# vim:ft=snippets:
2
3snippet m "Maintainer line" b
4# Maintainer: Yigit Sever <yigit at yigitsever dot com>
5endsnippet
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 @@
1# vim:ft=snippets:
2
3global !p
4from vimsnippets import get_comment_format
5endglobal
6
7snippet fancybox "Box"
8`!p snip.rv = '┌' + '─' * (len(t[1]) + 2) + '┐'`
9│ $1 │
10`!p snip.rv = '└' + '─' * (len(t[1]) + 2) + '┘'`
11$0
12endsnippet
13
14snippet todo "TODO comment" bw
15`!p snip.rv=get_comment_format()[0]` TODO: $0 <`!v strftime('%d-%m-%y')`, yigit> `!p snip.rv=get_comment_format()[2]`
16endsnippet
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 @@
1# vim:ft=snippets:
2priority 100
3
4snippet if "if only" b
5if (${1:true}) {
6 ${0:{VISUAL}}
7}
8endsnippet
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 @@
1# vim:ft=snippets:
2# vim:set noexpandtab tabstop=4 shiftwidth=4:
3
4snippet c "New Checking Transaction" b
5${1:`!v strftime("%Y")`}-${2:`!v strftime("%m")`}-${3:`!v strftime("%d")`} ${4:Payee}
6 Expenses:${5:} ${6:0.00} TL
7 Assets:Maas$0
8endsnippet
9
10snippet l "New Liabilities Transaction" b
11${1:`!v strftime("%Y")`}-${2:`!v strftime("%m")`}-${3:`!v strftime("%d")`} ${4:Payee}
12 Expenses:${5:} ${6:0.00} TL
13 Liabilities:Maximum$0
14endsnippet
15
16snippet a "New Asmaalti Transaction" b
17${1:`!v strftime("%Y")`}-${2:`!v strftime("%m")`}-${3:`!v strftime("%d")`} Asmaalti Piknik
18 Expenses:Food:Eating Out ${4:0.00} TL
19 ${5:Assets:Maas}$0
20endsnippet
21
22snippet y "New Yemeksepeti Transaction" b
23${1:`!v strftime("%Y")`}-${2:`!v strftime("%m")`}-${3:`!v strftime("%d")`} Yemeksepeti
24 Expenses:Takeout ${4:0.00} TL
25 ${5:Liabilities:Maximum}$0
26endsnippet
27
28snippet m "New Migros Transaction" b
29${1:`!v strftime("%Y")`}-${2:`!v strftime("%m")`}-${3:`!v strftime("%d")`} Migros Market
30 Expenses:Food:Groceries ${4:0.00} TL
31 ${5:Assets:Maas}$0
32endsnippet
33
34snippet sb "New Sosyal Bina Transaction" b
35${1:`!v strftime("%Y")`}-${2:`!v strftime("%m")`}-${3:`!v strftime("%d")`} Sosyal Bina
36 Expenses:Food:Lunch 8.60 TL
37 Assets:Maas$0
38endsnippet
39
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 @@
1# vim:ft=snippets:
2
3snippet ~ "signature" b
4~yigit
5endsnippet
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 @@
1# vim:ft=snippets:
2
3snippet link "Link to something" b
4[${1:${VISUAL:Text}}](`xsel -ob`)$0
5endsnippet
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 @@
1# vim:ft=snippets:
2# https://castel.dev/post/lecture-notes-1/
3
4global !p
5def math():
6 return vim.eval('vimtex#syntax#in_mathzone()') == '1'
7endglobal
8
9snippet template "Basic template" b
10\documentclass[a4paper]{article}
11
12\usepackage[utf8]{inputenc}
13\usepackage[T1]{fontenc}
14\usepackage{textcomp}
15\usepackage{babel}
16\usepackage{amsmath, amssymb}
17
18% figure support
19\usepackage{import}
20\usepackage{xifthen}
21\pdfminorversion=7
22\usepackage{pdfpages}
23\usepackage{transparent}
24
25\begin{document}
26 $0
27\end{document}
28endsnippet
29
30snippet beg "begin{} / end{}" bA
31\\begin{$1}
32 $0
33\\end{$1}
34endsnippet
35
36priority 100
37snippet ... "ldots" iA
38\ldots
39endsnippet
40
41snippet table "Table environment" b
42\begin{table}[${1:htpb}]
43 \centering
44 \caption{${2:caption}}%
45 \label{tab:${3:label}}
46 \begin{tabular}{${5:c}}
47 $0${5/((?<=.)c|l|r)|./(?1: & )/g}
48 \end{tabular}
49\end{table}
50endsnippet
51
52snippet fig "Figure environment" b
53\begin{figure}[${1:htpb}]
54 \centering
55 ${2:\includegraphics[width=0.8\textwidth]{$3}}
56 \caption{${4:$3}}%
57 \label{fig:${5:${3/\W+/-/g}}}
58\end{figure}
59endsnippet
60
61snippet enum "Enumerate" bA
62\begin{enumerate}
63 \item $0
64\end{enumerate}
65endsnippet
66
67snippet item "Itemize" bA
68\begin{itemize}
69 \item $0
70\end{itemize}
71endsnippet
72
73snippet desc "Description" b
74\begin{description}
75 \item[$1] $0
76\end{description}
77endsnippet
78
79snippet on "O(n)" b
80\mathcal{O}(n)
81endsnippet
82
83snippet mk "Math" wA
84$${1}$`!p
85if t[2] and t[2][0] not in [',', '.', '?', '-', ' ']:
86 snip.rv = ' '
87else:
88 snip.rv = ''
89`$2
90endsnippet
91
92snippet dm "Math" wA
93\[
94${1:${VISUAL}}
95.\] $0
96endsnippet
97
98context "math()"
99snippet '([A-Za-z])(\d)' "auto subscript" wrA
100`!p snip.rv = match.group(1)`_`!p snip.rv = match.group(2)`
101endsnippet
102
103context "math()"
104snippet '([A-Za-z])_(\d\d)' "auto subscript2" wrA
105`!p snip.rv = match.group(1)`_{`!p snip.rv = match.group(2)`}
106endsnippet
107
108context "math()"
109snippet // "Fraction" iA
110\\frac{$1}{$2}$0
111endsnippet
112
113context "math()"
114snippet '((\d+)|(\d*)(\\)?([A-Za-z]+)((\^|_)(\{\d+\}|\d))*)/' "Fraction" wrA
115\\frac{`!p snip.rv = match.group(1)`}{$1}$0
116endsnippet
117
118snippet sec "Section"
119\section{${1:${VISUAL:section name}}}%
120\label{sec:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}}
121
122$0
123endsnippet
124
125snippet sec* "Section"
126\section*{${1:${VISUAL:section name}}}%
127\label{sec:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}}
128
129${0}
130endsnippet
131
132
133snippet sub "Subsection"
134\subsection{${1:${VISUAL:subsection name}}}%
135\label{sub:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}}
136
137$0
138endsnippet
139
140snippet sub* "Subsection"
141\subsection*{${1:${VISUAL:subsection name}}}%
142\label{sub:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}}
143
144${0}
145endsnippet
146
147snippet ssub "Subsubsection"
148\subsubsection{${1:${VISUAL:subsubsection name}}}%
149\label{ssub:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}}
150
151$0
152endsnippet
153
154snippet ssub* "Subsubsection"
155\subsubsection*{${1:${VISUAL:subsubsection name}}}%
156\label{ssub:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}}
157
158${0}
159endsnippet
160
161snippet "mint(ed)?( (\S+))?" "Minted code typeset" br
162\begin{listing}
163\begin{minted}[linenos,numbersep=5pt,frame=lines,framesep=2mm]{${1:`!p
164snip.rv = match.group(3) if match.group(2) is not None else "language"`}}
165${2:${VISUAL:code}}
166\end{minted}
167\caption{${3:caption name}}
168\label{lst:${4:${3/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}}
169\end{listing}
170
171$0
172endsnippet
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 @@
1# vim:ft=snippets:
2
3snippet link "Link a static content" b
4{{local:/home/yigit/nextcloud/personal_wiki/html/static/${1:filename}|${2:alt text}}}
5endsnippet
6
7snippet on "O(n)" b
8$\mathcal{O}(n)$
9endsnippet
10
11snippet s "Create a new spotlight item" b
12- (`!v strftime("%F %R")`) `xsel -ob` -- ${1:Summary}
13endsnippet
14
15snippet '- s' "Create a new spotlight item" w
16- (`!v strftime("%F %R")`) `xsel -ob` -- ${1:Summary}
17endsnippet
18
19snippet "h([1-6])" "Headings" rbA
20`!p snip.rv = '=' * int(match.group(1)) ` ${1:${VISUAL}} `!p snip.rv = '=' * int(match.group(1))`
21$0
22endsnippet
23
24snippet mcd "multi-line code" bA
25{{{ $1
26${2:${VISUAL}}
27}}}
28$0
29endsnippet
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 @@
1┌──────────────────────────────────────────────────────────────────────────────────┐
2│      ___           ___           ___           ___                       ___     │
3│     /\__\         /\  \         /\  \         /\__\          ___        /\__\    │
4│    /::|  |       /::\  \       /::\  \       /:/  /         /\  \      /::|  |   │
5│   /:|:|  |      /:/\:\  \     /:/\:\  \     /:/  /          \:\  \    /:|:|  |   │
6│  /:/|:|  |__   /::\~\:\  \   /:/  \:\  \   /:/__/  ___      /::\__\  /:/|:|__|__ │
7│ /:/ |:| /\__\ /:/\:\ \:\__\ /:/__/ \:\__\  |:|  | /\__\  __/:/\/__/ /:/ |::::\__\│
8│ \/__|:|/:/  / \:\~\:\ \/__/ \:\  \ /:/  /  |:|  |/:/  / /\/:/  /    \/__/~~/:/  /│
9│     |:/:/  /   \:\ \:\__\    \:\  /:/  /   |:|__/:/  /  \::/__/           /:/  / │
10│     |::/  /     \:\ \/__/     \:\/:/  /     \::::/__/    \:\__\          /:/  /  │
11│     /:/  /       \:\__\        \::/  /       ~~~~         \/__/         /:/  /   │
12│     \/__/         \/__/         \/__/                                   \/__/    │
13└──────────────────────────────────────────────────────────────────────────────────┘