From 1c01039530b5e8ef6ae8b7af3628aaeb082b61fd Mon Sep 17 00:00:00 2001 From: tiyn Date: Sun, 20 Jul 2025 04:59:42 +0200 Subject: [PATCH 1/3] nvim: fixed error line --- .config/nvim/init.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index 180a357..322de0e 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -13,7 +13,7 @@ Plug 'tomasiser/vim-code-dark' call plug#end() " end plugin section -set go=a +"set go=a " enable mouse for all modes set mouse=a From 435b829937d69fcc0f34631ddb8d0024290fc621 Mon Sep 17 00:00:00 2001 From: tiyn Date: Mon, 16 Mar 2026 02:32:33 +0100 Subject: [PATCH 2/3] updated neovim to use modern lazy --- .config/nvim/after/ftplugin/c.lua | 8 + .config/nvim/after/ftplugin/css.lua | 3 + .config/nvim/after/ftplugin/csv.lua | 7 + .config/nvim/after/ftplugin/html.lua | 3 + .config/nvim/after/ftplugin/java.lua | 3 + .config/nvim/after/ftplugin/javascript.lua | 3 + .config/nvim/after/ftplugin/lua.lua | 3 + .config/nvim/after/ftplugin/markdown.lua | 29 ++ .config/nvim/after/ftplugin/python.lua | 3 + .config/nvim/after/ftplugin/tex.lua | 23 ++ .config/nvim/init.lua | 138 +++++++ .config/nvim/init.vim | 162 -------- .config/nvim/lazy-lock.json | 87 +++++ .config/nvim/lua/autocmd.lua | 32 ++ .config/nvim/lua/keymap.lua | 346 ++++++++++++++++++ .config/nvim/lua/loadplugins.lua | 26 ++ .config/nvim/lua/plugins/barbecue.lua | 15 + .config/nvim/lua/plugins/blink-pairs.lua | 33 ++ .config/nvim/lua/plugins/comment.lua | 5 + .config/nvim/lua/plugins/conform.lua | 18 + .config/nvim/lua/plugins/csvview.lua | 16 + .config/nvim/lua/plugins/diffview.lua | 5 + .config/nvim/lua/plugins/fterm.lua | 5 + .config/nvim/lua/plugins/gitsigns.lua | 5 + .config/nvim/lua/plugins/goto-preview.lua | 8 + .config/nvim/lua/plugins/indent-blankline.lua | 7 + .config/nvim/lua/plugins/leap.lua | 13 + .config/nvim/lua/plugins/lsp_signature.lua | 12 + .config/nvim/lua/plugins/lualine.lua | 80 ++++ .config/nvim/lua/plugins/mason.lua | 50 +++ .config/nvim/lua/plugins/modes.lua | 7 + .config/nvim/lua/plugins/nvim-cmp.lua | 85 +++++ .config/nvim/lua/plugins/nvim-colorizer.lua | 27 ++ .config/nvim/lua/plugins/nvim-docs-view.lua | 9 + .config/nvim/lua/plugins/nvim-hlslens.lua | 7 + .config/nvim/lua/plugins/nvim-lspconfig.lua | 98 +++++ .config/nvim/lua/plugins/nvim-scrollbar.lua | 57 +++ .config/nvim/lua/plugins/nvim-surround.lua | 7 + .config/nvim/lua/plugins/nvim-tree.lua | 28 ++ .config/nvim/lua/plugins/nvim-treesitter.lua | 36 ++ .config/nvim/lua/plugins/nvim-ufo.lua | 20 + .config/nvim/lua/plugins/oil.lua | 8 + .config/nvim/lua/plugins/outline.lua | 12 + .config/nvim/lua/plugins/renamer.lua | 7 + .config/nvim/lua/plugins/spelunker.lua | 12 + .config/nvim/lua/plugins/tccs.lua | 13 + .config/nvim/lua/plugins/telescope.lua | 12 + .config/nvim/lua/plugins/tidy.lua | 10 + .config/nvim/lua/plugins/todo-comments.lua | 22 ++ .config/nvim/lua/plugins/trouble.lua | 11 + .config/nvim/lua/plugins/undotree.lua | 4 + .config/nvim/lua/plugins/vim-abolish.lua | 5 + .config/nvim/lua/plugins/vim-illuminate.lua | 4 + .config/nvim/lua/plugins/vim-markdown.lua | 7 + .config/nvim/lua/plugins/viper-nvim.lua | 8 + .config/nvim/lua/plugins/which-key.lua | 4 + .config/nvim/lua/plugins/wilder.lua | 74 ++++ .config/nvim/lua/plugins/winshift.lua | 5 + .config/nvim/lua/resources/header.tex | 13 + .config/nvim/lua/style.lua | 131 +++++++ .config/nvim/snippets/python.snippets | 199 ++++++++++ .config/nvim/snippets/tex.snippets | 257 +++++++++++++ .vimrc | 1 - 63 files changed, 2185 insertions(+), 163 deletions(-) create mode 100644 .config/nvim/after/ftplugin/c.lua create mode 100644 .config/nvim/after/ftplugin/css.lua create mode 100644 .config/nvim/after/ftplugin/csv.lua create mode 100644 .config/nvim/after/ftplugin/html.lua create mode 100644 .config/nvim/after/ftplugin/java.lua create mode 100644 .config/nvim/after/ftplugin/javascript.lua create mode 100644 .config/nvim/after/ftplugin/lua.lua create mode 100644 .config/nvim/after/ftplugin/markdown.lua create mode 100644 .config/nvim/after/ftplugin/python.lua create mode 100644 .config/nvim/after/ftplugin/tex.lua create mode 100644 .config/nvim/init.lua delete mode 100644 .config/nvim/init.vim create mode 100644 .config/nvim/lazy-lock.json create mode 100644 .config/nvim/lua/autocmd.lua create mode 100644 .config/nvim/lua/keymap.lua create mode 100644 .config/nvim/lua/loadplugins.lua create mode 100644 .config/nvim/lua/plugins/barbecue.lua create mode 100644 .config/nvim/lua/plugins/blink-pairs.lua create mode 100644 .config/nvim/lua/plugins/comment.lua create mode 100644 .config/nvim/lua/plugins/conform.lua create mode 100644 .config/nvim/lua/plugins/csvview.lua create mode 100644 .config/nvim/lua/plugins/diffview.lua create mode 100644 .config/nvim/lua/plugins/fterm.lua create mode 100644 .config/nvim/lua/plugins/gitsigns.lua create mode 100644 .config/nvim/lua/plugins/goto-preview.lua create mode 100644 .config/nvim/lua/plugins/indent-blankline.lua create mode 100644 .config/nvim/lua/plugins/leap.lua create mode 100644 .config/nvim/lua/plugins/lsp_signature.lua create mode 100644 .config/nvim/lua/plugins/lualine.lua create mode 100644 .config/nvim/lua/plugins/mason.lua create mode 100644 .config/nvim/lua/plugins/modes.lua create mode 100644 .config/nvim/lua/plugins/nvim-cmp.lua create mode 100644 .config/nvim/lua/plugins/nvim-colorizer.lua create mode 100644 .config/nvim/lua/plugins/nvim-docs-view.lua create mode 100644 .config/nvim/lua/plugins/nvim-hlslens.lua create mode 100644 .config/nvim/lua/plugins/nvim-lspconfig.lua create mode 100644 .config/nvim/lua/plugins/nvim-scrollbar.lua create mode 100644 .config/nvim/lua/plugins/nvim-surround.lua create mode 100644 .config/nvim/lua/plugins/nvim-tree.lua create mode 100644 .config/nvim/lua/plugins/nvim-treesitter.lua create mode 100644 .config/nvim/lua/plugins/nvim-ufo.lua create mode 100644 .config/nvim/lua/plugins/oil.lua create mode 100644 .config/nvim/lua/plugins/outline.lua create mode 100644 .config/nvim/lua/plugins/renamer.lua create mode 100644 .config/nvim/lua/plugins/spelunker.lua create mode 100644 .config/nvim/lua/plugins/tccs.lua create mode 100644 .config/nvim/lua/plugins/telescope.lua create mode 100644 .config/nvim/lua/plugins/tidy.lua create mode 100644 .config/nvim/lua/plugins/todo-comments.lua create mode 100644 .config/nvim/lua/plugins/trouble.lua create mode 100644 .config/nvim/lua/plugins/undotree.lua create mode 100644 .config/nvim/lua/plugins/vim-abolish.lua create mode 100644 .config/nvim/lua/plugins/vim-illuminate.lua create mode 100644 .config/nvim/lua/plugins/vim-markdown.lua create mode 100644 .config/nvim/lua/plugins/viper-nvim.lua create mode 100644 .config/nvim/lua/plugins/which-key.lua create mode 100644 .config/nvim/lua/plugins/wilder.lua create mode 100644 .config/nvim/lua/plugins/winshift.lua create mode 100644 .config/nvim/lua/resources/header.tex create mode 100644 .config/nvim/lua/style.lua create mode 100644 .config/nvim/snippets/python.snippets create mode 100644 .config/nvim/snippets/tex.snippets delete mode 120000 .vimrc diff --git a/.config/nvim/after/ftplugin/c.lua b/.config/nvim/after/ftplugin/c.lua new file mode 100644 index 0000000..854d78f --- /dev/null +++ b/.config/nvim/after/ftplugin/c.lua @@ -0,0 +1,8 @@ +vim.api.nvim_create_autocmd({ "VimLeave" }, { + callback = function() + os.execute("cclear") + end, +}) + +vim.o.shiftwidth = 2 +vim.o.softtabstop = 2 diff --git a/.config/nvim/after/ftplugin/css.lua b/.config/nvim/after/ftplugin/css.lua new file mode 100644 index 0000000..3c53a56 --- /dev/null +++ b/.config/nvim/after/ftplugin/css.lua @@ -0,0 +1,3 @@ +vim.o.shiftwidth = 2 +vim.o.softtabstop = 2 +vim.o.textwidth = 100 diff --git a/.config/nvim/after/ftplugin/csv.lua b/.config/nvim/after/ftplugin/csv.lua new file mode 100644 index 0000000..7efed8b --- /dev/null +++ b/.config/nvim/after/ftplugin/csv.lua @@ -0,0 +1,7 @@ +vim.api.nvim_create_autocmd({ "VimEnter" }, { + callback = function() + require("csvview").enable() + end, +}) + +vim.o.textwidth = 0 diff --git a/.config/nvim/after/ftplugin/html.lua b/.config/nvim/after/ftplugin/html.lua new file mode 100644 index 0000000..3c53a56 --- /dev/null +++ b/.config/nvim/after/ftplugin/html.lua @@ -0,0 +1,3 @@ +vim.o.shiftwidth = 2 +vim.o.softtabstop = 2 +vim.o.textwidth = 100 diff --git a/.config/nvim/after/ftplugin/java.lua b/.config/nvim/after/ftplugin/java.lua new file mode 100644 index 0000000..3c53a56 --- /dev/null +++ b/.config/nvim/after/ftplugin/java.lua @@ -0,0 +1,3 @@ +vim.o.shiftwidth = 2 +vim.o.softtabstop = 2 +vim.o.textwidth = 100 diff --git a/.config/nvim/after/ftplugin/javascript.lua b/.config/nvim/after/ftplugin/javascript.lua new file mode 100644 index 0000000..3c53a56 --- /dev/null +++ b/.config/nvim/after/ftplugin/javascript.lua @@ -0,0 +1,3 @@ +vim.o.shiftwidth = 2 +vim.o.softtabstop = 2 +vim.o.textwidth = 100 diff --git a/.config/nvim/after/ftplugin/lua.lua b/.config/nvim/after/ftplugin/lua.lua new file mode 100644 index 0000000..3c53a56 --- /dev/null +++ b/.config/nvim/after/ftplugin/lua.lua @@ -0,0 +1,3 @@ +vim.o.shiftwidth = 2 +vim.o.softtabstop = 2 +vim.o.textwidth = 100 diff --git a/.config/nvim/after/ftplugin/markdown.lua b/.config/nvim/after/ftplugin/markdown.lua new file mode 100644 index 0000000..44c90c0 --- /dev/null +++ b/.config/nvim/after/ftplugin/markdown.lua @@ -0,0 +1,29 @@ +vim.api.nvim_create_autocmd({ "VimEnter" }, { + callback = function() + require("tidy").opts.enabled_on_save = false + end, +}) + +vim.api.nvim_create_autocmd({ "BufEnter" }, { + callback = function() + vim.o.foldenable = false + end, +}) + +vim.api.nvim_create_autocmd({ "BufLeave" }, { + callback = function() + if vim.o.ma then + require("tidy").run() + end + end, +}) + +vim.api.nvim_create_autocmd({ "VimLeave" }, { + callback = function() + os.execute("mdclear " .. vim.fn.expand("%")) + end, +}) + +vim.o.shiftwidth = 2 +vim.o.softtabstop = 2 +vim.o.textwidth = 100 diff --git a/.config/nvim/after/ftplugin/python.lua b/.config/nvim/after/ftplugin/python.lua new file mode 100644 index 0000000..3c53a56 --- /dev/null +++ b/.config/nvim/after/ftplugin/python.lua @@ -0,0 +1,3 @@ +vim.o.shiftwidth = 2 +vim.o.softtabstop = 2 +vim.o.textwidth = 100 diff --git a/.config/nvim/after/ftplugin/tex.lua b/.config/nvim/after/ftplugin/tex.lua new file mode 100644 index 0000000..7988173 --- /dev/null +++ b/.config/nvim/after/ftplugin/tex.lua @@ -0,0 +1,23 @@ +vim.api.nvim_create_autocmd({ "VimEnter" }, { + callback = function() + require("tidy").opts.enabled_on_save = false + end, +}) + +vim.api.nvim_create_autocmd({ "BufLeave" }, { + callback = function() + if vim.o.ma then + require("tidy").run() + end + end, +}) + +vim.api.nvim_create_autocmd({ "VimLeave" }, { + callback = function() + os.execute("texclear " .. vim.fn.expand("%")) + end, +}) + +vim.o.shiftwidth = 2 +vim.o.softtabstop = 2 +vim.o.textwidth = 80 diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua new file mode 100644 index 0000000..ff8057f --- /dev/null +++ b/.config/nvim/init.lua @@ -0,0 +1,138 @@ +-- vim.o.go = "a" +vim.o.showmode = false + +-- disable netrw +vim.g.loaded_netrw = 1 +vim.g.loaded_netrwPlugin = 1 + +-- enable mouse for all modes +vim.o.mouse = "a" +vim.o.clipboard = "unnamedplus" + +-- basic color settings +vim.o.background = "dark" + +-- setting Tab-length +vim.o.expandtab = true +vim.o.softtabstop = 4 +vim.o.shiftwidth = 4 + +-- splits open at the bottom and right +vim.o.splitbelow = true +vim.o.splitright = true + +-- disable case sensitive matching +vim.o.ignorecase = true +vim.o.smartcase = true + +-- enable nocompatible mode +-- vim.o.nocompatible = true + +-- enable syntax highlighting +vim.o.syntax = "true" + +-- enable true colors +vim.o.termguicolors = true + +-- set utf-8 encoding +vim.o.encoding = "utf-8" + +-- show relative numbers on left side +vim.o.number = true +vim.o.relativenumber = true + +-- speedup vim with long lines +vim.o.ttyfast = true +-- vim.o.lazyredraw = true + +-- decrease update time +vim.o.updatetime = 250 +vim.o.timeout = true +vim.o.timeoutlen = 300 + +-- enable break indent +vim.o.breakindent = true + +-- textedit might fail without hidden +vim.o.hidden = true + +-- disable backupfiles +-- vim.o.nobackup = true +-- vim.o.nowritebackup = true + +-- set completeopt to have a better completion experience +vim.o.completeopt = "menuone,noselect" + +-- set completion option for command mode +vim.o.wildmode = "longest:full,full" + +-- minimum number of lines around the cursor +vim.o.scrolloff = 10 +vim.o.sidescrolloff = 8 + +-- always show the signcolumn +vim.o.signcolumn = "yes" + +-- enable persistent undo +vim.o.undofile = true +vim.o.undodir = vim.env.XDG_CACHE_HOME .. "/vim/undo" + +-- python programs to use +vim.g.python_host_prog = "/usr/bin/python2" +vim.g.python3_host_prog = "/usr/bin/python3" + +-- folding +vim.o.foldcolumn = "0" +vim.o.foldlevel = 99 +vim.o.foldlevelstart = 99 +vim.o.foldexpr = "expr" +vim.o.foldenable = true +vim.o.conceallevel = 0 +vim.g.markdown_folding = 1 + +-- standard settings for colorcolumn and tabbing +vim.o.shiftwidth = 4 +vim.o.softtabstop = 4 +vim.o.textwidth = 80 + +-- read files correctly +vim.filetype.add({ + extension = { + c = "c", + h = "c", + html = "html", + java = "java", + js = "javascript", + lua = "lua", + md = "markdown", + nim = "nim", + py = "python", + sage = "python", + sh = "bash", + tex = "tex", + vpr = "viper", + }, +}) + +-- set mapleader for hotkeys +vim.g.mapleader = "," + +-- load general mapped keys +require("style") + +-- load plugins (autoload all files in plugin folder) +require("loadplugins") + +-- load commands to be run automatically +require("autocmd") + +-- load general mapped keys +require("keymap") + +vim.cmd([[ +set foldopen-=hor +set foldclose-=hor +]]) + +-- Save localoptions to session file +vim.opt.sessionoptions:append("localoptions") diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim deleted file mode 100644 index 180a357..0000000 --- a/.config/nvim/init.vim +++ /dev/null @@ -1,162 +0,0 @@ -let mapleader = "," - -" begin plugin section -if ! filereadable(expand('~/.config/nvim/autoload/plug.vim')) - echo "Downloading junegunn/vim-plug to manage plugins..." - silent !mkdir -p ~/.config/nvim/autoload/ - silent !curl "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim" > ~/.config/nvim/autoload/plug.vim -endif - -call plug#begin('~/.config/nvim/plugged') -Plug 'qpkorr/vim-renamer' -Plug 'tomasiser/vim-code-dark' -call plug#end() -" end plugin section - -set go=a - -" enable mouse for all modes -set mouse=a -set clipboard+=unnamedplus - -" enable command completion -set wildmode=longest,list,full - -" setting Tab-length -set expandtab -set softtabstop=4 -set shiftwidth=4 - -" splits open at the bottom and right, which is non-retarded, unlike vim defaults. -set splitbelow splitright - -" disable case sensitive matching -set ignorecase - -" enable nocompatible mode -set nocompatible - -" enable Plugins -filetype plugin on - -" enable syntax highlighting -syntax on - -" enable true colors -set termguicolors - -" set utf-8 encoding -set encoding=utf-8 - -" show relative numbers on left side -set number relativenumber - -" speedup vim with long lines -set ttyfast -set lazyredraw - -" textEdit might fail without hidden -set hidden - -" disable Backupfiles for Lsp -set nobackup -set nowritebackup - -" dont pass messages to ins-completion-menu -set shortmess+=c - -" always show the signcolumn, otherwise it would shift the text each time -" diagnostics appear/become resolved. -if has("patch-8.1.1564") - " Recently vim can merge signcolumn and number column into one - set signcolumn=number -else - set signcolumn=yes -endif - -" enable persistent undo -if has('persistent_undo') - set undofile - set undodir="$XDG_CACHE_HOME/vim/undo" -endif - -" unmap unwanted commands -nnoremap -nnoremap -nnoremap -nnoremap -nnoremap -nnoremap -nnoremap -nnoremap -nnoremap -nnoremap - -inoremap -inoremap -inoremap -inoremap -inoremap -inoremap -inoremap -inoremap -inoremap -inoremap -inoremap -inoremap - -" mapping Dictionaries -nnoremap :setlocal spell! spelllang=de_de -nnoremap :setlocal spell! spelllang=en_us - -" compiler for languages -nnoremap c :w! \| !compiler % - -" open corresponding file (pdf/html/...) -nnoremap p :!opout % - -" shortcut for split navigation -nnoremap h -nnoremap j -nnoremap k -nnoremap l - -" save file as sudo on files that require root permission -cnoremap w!! execute 'silent! write !sudo tee % >/dev/null' edit! - -" alias for replacing -nnoremap ss :%s//gI - -" delete trailing whitespaces on save -fun! TrimWhitespace() - let l:save = winsaveview() - keeppatterns %s/\s\+$//e - call winrestview(l:save) -endfun -autocmd BufWritePre * :call TrimWhitespace() - -" read files correctly -autocmd BufRead,BufNewFile *.tex set filetype=tex -autocmd BufRead,BufNewFile *.h set filetype=c - -" formatting -autocmd FileType c setlocal formatprg=astyle\ --mode=c -autocmd FileType java setlocal formatprg=astyle\ --indent=spaces=2\ --style=google -autocmd FileType java setlocal shiftwidth=2 softtabstop=2 -autocmd FileType markdown noremap :silent %!prettier --stdin-filepath % -autocmd FileType python setlocal formatprg=autopep8\ - -autocmd FileType tex,latex setlocal formatprg=latexindent\ - -autocmd FileType c,java,python,tex,latex noremap gggqG - -" cleanup certain files after leaving the editor -autocmd VimLeave *.tex !texclear % -autocmd VimLeave *.c !cclear - -" highlighting break line -autocmd BufEnter,FileType c set colorcolumn=80 -autocmd BufEnter,FileType java set colorcolumn=100 -autocmd BufEnter,FileType markdown set colorcolumn=80 - -" colorscheme -colorscheme codedark -highlight colorcolumn guibg=#772222 diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json new file mode 100644 index 0000000..cafda3e --- /dev/null +++ b/.config/nvim/lazy-lock.json @@ -0,0 +1,87 @@ +{ + "action-hints.nvim": { "branch": "main", "commit": "ac72c23c2e901084e0c08a743942d8d7b8c560de" }, + "barbecue": { "branch": "main", "commit": "cd7e7da622d68136e13721865b4d919efd6325ed" }, + "blink.download": { "branch": "main", "commit": "86361b98f3c8317904a08e3bd12cf3cdcbe3e925" }, + "blink.pairs": { "branch": "main", "commit": "5a34bf6ea72340a70083548e186d745ac4882899" }, + "cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" }, + "cmp-dictionary": { "branch": "main", "commit": "fecc3ef2435c2be35818f8fcac4a6c5655f3a8f0" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" }, + "cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" }, + "cmp-under-comparator": { "branch": "master", "commit": "6857f10272c3cfe930cece2afa2406e1385bfef8" }, + "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, + "comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, + "conform.nvim": { "branch": "master", "commit": "086a40dc7ed8242c03be9f47fbcee68699cc2395" }, + "cpsm": { "branch": "master", "commit": "c32a9b7dc9d5b516505bc8ab58ceb15f64735830" }, + "csvview.nvim": { "branch": "main", "commit": "7022e18a0fbae9aecf99a3ba02b2a541edc2b8a1" }, + "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, + "edgy.nvim": { "branch": "main", "commit": "8bfd2808994a988c975694122f68624b8a219f5f" }, + "fterm.nvim": { "branch": "master", "commit": "d1320892cc2ebab472935242d9d992a2c9570180" }, + "fzy-lua-native": { "branch": "master", "commit": "9d720745d5c2fb563c0d86c17d77612a3519c506" }, + "git-blame.nvim": { "branch": "main", "commit": "93d983806a0c76692bebd6f804c8eaa2a3844452" }, + "gitsigns.nvim": { "branch": "main", "commit": "7c4faa3540d0781a28588cafbd4dd187a28ac6e3" }, + "goto-preview": { "branch": "main", "commit": "d2d6923c9b9e0e43f0b9b566f261a8b1ae016540" }, + "image.nvim": { "branch": "master", "commit": "da2be65c153ba15a14a342b05591652a6df70d58" }, + "indent-blankline.nvim": { "branch": "master", "commit": "d28a3f70721c79e3c5f6693057ae929f3d9c0a03" }, + "jupytext.nvim": { "branch": "main", "commit": "c8baf3ad344c59b3abd461ecc17fc16ec44d0f7b" }, + "knap": { "branch": "main", "commit": "7db44d0bb760120142cc1e8f43e44976de59c2f6" }, + "lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" }, + "leap.nvim": { "branch": "main", "commit": "774c452da3521d4434f912b6ca6dd97318aca4b0" }, + "logger.nvim": { "branch": "main", "commit": "63dd10c9b9a159fd6cfe08435d9606384ff103c5" }, + "lsp_signature.nvim": { "branch": "master", "commit": "af7e4074d85d785cf6614352ba9ad3b28a1f8a56" }, + "lspkind-nvim": { "branch": "master", "commit": "c7274c48137396526b59d86232eabcdc7fed8a32" }, + "lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" }, + "luasnip": { "branch": "master", "commit": "99a94cc35ec99bf06263d0346128e908a204575c" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "a676ab7282da8d651e175118bcf54483ca11e46d" }, + "mason-null-ls.nvim": { "branch": "main", "commit": "8e7806acaa87fae64f0bfde25bb4b87c18bd19b4" }, + "mason.nvim": { "branch": "main", "commit": "44d1e90e1f66e077268191e3ee9d2ac97cc18e65" }, + "mini.icons": { "branch": "main", "commit": "5b9076dae1bfbe47ba4a14bc8b967cde0ab5d77e" }, + "modes.nvim": { "branch": "main", "commit": "0932ba4e0bdc3457ac89a8aeed4d56ca0b36977a" }, + "molten-nvim": { "branch": "main", "commit": "a286aa914d9a154bc359131aab788b5a077a5a99" }, + "none-ls.nvim": { "branch": "main", "commit": "c9317c2a8629d4e39e7cf47be74cb67f3ab37cda" }, + "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, + "nvim-cmp": { "branch": "main", "commit": "da88697d7f45d16852c6b2769dc52387d1ddc45f" }, + "nvim-colorizer.lua": { "branch": "master", "commit": "6ed09146ee637006367b5e225be6208a1ea02579" }, + "nvim-docs-view": { "branch": "master", "commit": "5676cc094d426edd39134b1eefca2cab441cca8a" }, + "nvim-hlslens": { "branch": "main", "commit": "be2d7b2be01860b5445a007ff2bc72b29896db6b" }, + "nvim-lilypond-suite": { "branch": "main", "commit": "a1a313fd6028a196cc9aaa8c8501838fe8cc8e2a" }, + "nvim-lspconfig": { "branch": "master", "commit": "dd261ad5266ab5bbec249d21efeceda98ff3e1a6" }, + "nvim-navic": { "branch": "master", "commit": "f5eba192f39b453675d115351808bd51276d9de5" }, + "nvim-scrollbar": { "branch": "main", "commit": "f8e87b96cd6362ef8579be456afee3b38fd7e2a8" }, + "nvim-surround": { "branch": "main", "commit": "61319d4bd1c5e336e197defa15bd104c51f0fb29" }, + "nvim-tree.lua": { "branch": "master", "commit": "b3772adec8db61ba9098c5624a0823a77be3a23d" }, + "nvim-treesitter": { "branch": "main", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, + "nvim-ts-autotag": { "branch": "main", "commit": "8e1c0a389f20bf7f5b0dd0e00306c1247bda2595" }, + "nvim-ufo": { "branch": "main", "commit": "ab3eb124062422d276fae49e0dd63b3ad1062cfc" }, + "nvim-web-devicons": { "branch": "master", "commit": "d7462543c9e366c0d196c7f67a945eaaf5d99414" }, + "nvim-yarp": { "branch": "master", "commit": "bb5f5e038bfe119d3b777845a76b0b919b35ebc8" }, + "ogpt.nvim": { "branch": "main", "commit": "0fae02db8cb07391f86c3dbe807f62190a2d997f" }, + "oil.nvim": { "branch": "master", "commit": "0fcc83805ad11cf714a949c98c605ed717e0b83e" }, + "otter.nvim": { "branch": "main", "commit": "4796602953348e19fb24916557af7b89e188751f" }, + "outline.nvim": { "branch": "main", "commit": "ead1820d49c8e79ce89cab1c2c318981b695c9d2" }, + "papis.nvim": { "branch": "main", "commit": "25e69f25e51b2d46178a213356adbc28b0f918ef" }, + "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, + "popup-menu.nvim": { "branch": "master", "commit": "b618bd0c824a20417d845fa0022327228e6988a2" }, + "projections.nvim": { "branch": "pre_release", "commit": "889914169fa1f5c00fb8659653b5a8330fb223e6" }, + "promise-async": { "branch": "main", "commit": "119e8961014c9bfaf1487bf3c2a393d254f337e2" }, + "quarto-nvim": { "branch": "main", "commit": "d923bb7cfc2bde41143e1c531c28190f0fade3a2" }, + "renamer.nvim": { "branch": "master", "commit": "1614d466df53899f11dd5395eaac3c09a275c384" }, + "rustaceanvim": { "branch": "master", "commit": "88575b98bb9937fb9983ddec5e532b67e75ce677" }, + "spelunker.vim": { "branch": "master", "commit": "a0bc530f62798bbe053905555a4aa9ed713485eb" }, + "sqlite.lua": { "branch": "master", "commit": "50092d60feb242602d7578398c6eb53b4a8ffe7b" }, + "tabular": { "branch": "master", "commit": "12437cd1b53488e24936ec4b091c9324cafee311" }, + "tccs.nvim": { "branch": "master", "commit": "06df4330266bb4b85458745b5090b29386722512" }, + "telescope-words.nvim": { "branch": "main", "commit": "295d51fe1e525fee18c0c164ad0ae5fb23273aa0" }, + "telescope.nvim": { "branch": "master", "commit": "776b509f80dd49d8205b9b0d94485568236d1192" }, + "tidy.nvim": { "branch": "main", "commit": "8b6921150b16f38f48a2459a844a0c2b4c916914" }, + "todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" }, + "trouble.nvim": { "branch": "main", "commit": "bd67efe408d4816e25e8491cc5ad4088e708a69a" }, + "undotree": { "branch": "master", "commit": "6fa6b57cda8459e1e4b2ca34df702f55242f4e4d" }, + "vim-abolish": { "branch": "master", "commit": "dcbfe065297d31823561ba787f51056c147aa682" }, + "vim-hug-neovim-rpc": { "branch": "master", "commit": "93ae38792bc197c3bdffa2716ae493c67a5e7957" }, + "vim-illuminate": { "branch": "master", "commit": "0d1e93684da00ab7c057410fecfc24f434698898" }, + "vim-markdown": { "branch": "master", "commit": "1bc9d0cd8e1cc3e901b0a49c2b50a843f1c89397" }, + "viper.nvim": { "branch": "master", "commit": "738bf63d98aca63d7def93181eb16d648a6c0edb" }, + "which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" }, + "wilder.nvim": { "branch": "master", "commit": "679f348dc90d80ff9ba0e7c470c40a4d038dcecf" }, + "winshift.nvim": { "branch": "main", "commit": "37468ed6f385dfb50402368669766504c0e15583" } +} diff --git a/.config/nvim/lua/autocmd.lua b/.config/nvim/lua/autocmd.lua new file mode 100644 index 0000000..a3a5195 --- /dev/null +++ b/.config/nvim/lua/autocmd.lua @@ -0,0 +1,32 @@ +-- highlighting yanked regions +vim.api.nvim_create_autocmd("TextYankPost", { + callback = function() + vim.highlight.on_yank({ higroup = "YankHighlight" }) + end, +}) + +-- -- gnikdroy/projections.nvim +-- local Session = require("projections.session") +-- vim.api.nvim_create_autocmd({ "VimLeavePre" }, { +-- callback = function() +-- Session.store(vim.loop.cwd()) +-- end, +-- }) +-- +-- vim.api.nvim_create_autocmd({ "VimEnter" }, { +-- callback = function() +-- if vim.fn.argc() ~= 0 then +-- return +-- end +-- local session_info = Session.info(vim.loop.cwd()) +-- if session_info ~= nil then +-- Session.restore(vim.loop.cwd()) +-- end +-- end, +-- desc = "Restore last session automatically", +-- }) + +-- stevearc/oil.nvim +vim.api.nvim_create_user_command("Renamer", function(opts) + vim.cmd("Oil " .. opts.args) +end, { nargs = "*" }) diff --git a/.config/nvim/lua/keymap.lua b/.config/nvim/lua/keymap.lua new file mode 100644 index 0000000..2a606d4 --- /dev/null +++ b/.config/nvim/lua/keymap.lua @@ -0,0 +1,346 @@ +-- setup keymap function +local lazygit = require("FTerm"):new({ cmd = "lazygit" }) +local telescope = require("telescope") +local wk = require("which-key") + +wk.add({ + -- setup keymap groups + { mode = "n", "g", desc = "LSP: goto" }, + { mode = "n", "gp", desc = "LSP: preview" }, + { mode = "c", "w", desc = "Write" }, + { mode = "c", "w!", desc = "Write: overwrite" }, + { mode = "n", "a", desc = "AI" }, + { mode = "n", "g", desc = "Git" }, + { mode = "n", "f", desc = "Telescope: find" }, + { mode = "n", "gd", desc = "Git: diff" }, + { mode = "n", "s", desc = "Substitute" }, + { mode = "n", "t", desc = "Terminal" }, + { mode = "n", "", desc = "Navigation" }, + -- unmap unwanted commands + { mode = "n", "Zt", "", noremap = true }, + { mode = "n", "ZT", "", noremap = true }, + { mode = "n", "", "", noremap = true }, + { mode = "n", "", "", noremap = true }, + { mode = "n", "", "", noremap = true }, + { mode = "n", "", "", noremap = true }, + { mode = "n", "", "", noremap = true }, + { mode = "n", "", "", noremap = true }, + { mode = "n", "", "", noremap = true }, + { mode = "n", "", "", noremap = true }, + { mode = "n", "", "", noremap = true }, + { mode = "n", "", "", noremap = true }, + { mode = "n", "", "", noremap = true }, + { mode = "n", "", "", noremap = true }, + { mode = "n", "", "", noremap = true }, + -- shortcuts for quitting + { mode = "n", "ZA", ":xa", desc = "Exit: write and quit all buffers", noremap = true }, + { mode = "n", "ZQ", ":conf q", desc = "Exit: quit current buffer", noremap = true }, + { mode = "n", "ZZ", ":x", desc = "Exit: write and quit current buffer", noremap = true }, + -- shortcut for split navigation + { mode = "n", "", "h", desc = "Navigation: go to left window", noremap = true }, + { mode = "n", "", "j", desc = "Navigation: go to lower window", noremap = true }, + { mode = "n", "", "k", desc = "Navigation: go to upper window", noremap = true }, + { mode = "n", "", "l", desc = "Navigation: go to right window", noremap = true }, + -- remap for dealing with word wrap + { mode = "n", "j", "gj", desc = "Navigation: go down in wrapped lines", silent = true }, + { mode = "n", "k", "gk", desc = "Navigation: go up in wrapped lines", silent = true }, + -- compiler for languages + { + mode = "n", + "c", + ":w! | !compiler %", + desc = "Compile: current file", + noremap = true, + }, + { + mode = "n", + "w!!", + 'execute "silent! write !sudo tee % >/dev/null" edit!', + desc = "Write: overwrite file over with sudo", + noremap = true, + }, + -- tpope/vim-abolish + { + mode = "n", + "sa", + ":%S//g", + desc = "Substitute: free form", + noremap = true, + }, + { + mode = "n", + "ss", + ":%S/\\<\\>//g", + desc = "Substitute: word under cursor", + noremap = true, + }, + -- simrat39/symbols-outline.nvim + { mode = "n", "", ":Outline", desc = "CTags: toggle" }, + -- nvim-tree/nvim-tree.lua + { mode = "n", "", ":NvimTreeToggle toggle", desc = "File tree: toggle" }, + -- mbbill/undotree + { mode = "n", "", ":UndotreeToggle", desc = "Undo tree: toggle" }, + -- amrbashir/nvim-docs-view + { + mode = "n", + "go", + ":DocsViewToggle", + desc = "LSP: toggle documentation window", + noremap = true, + }, + -- numtostr/fterm.nvim + { mode = "n", "tt", require("FTerm").toggle, desc = "Terminal: open", noremap = true }, + { + mode = "n", + "gt", + function() + lazygit:toggle() + end, + desc = "Git: open lazygit", + noremap = true, + }, + { + mode = "n", + "tg", + function() + lazygit:toggle() + end, + desc = "Terminal: open lazygit", + noremap = true, + }, + -- sindrets/diffview.nvim + { mode = "n", "gdo", ":DiffviewOpen", desc = "Git: open diff" }, + { mode = "n", "gdc", ":DiffviewClose", desc = "Git: close diff" }, + -- folke/trouble.nvim + { mode = "n", "", ":Trouble diagnostics toggle", desc = "LSP: toggle error list" }, + -- hrsh7th/nvim-cmp + { + mode = "n", + "gd", + function() + vim.lsp.buf.definition() + end, + desc = "LSP: goto definition", + noremap = true, + }, + { + mode = "n", + "gD", + function() + vim.lsp.buf.declaration() + end, + desc = "LSP: goto declaration", + noremap = true, + }, + { + mode = "n", + "gT", + function() + vim.lsp.buf.type_definition() + end, + desc = "LSP: goto type definition", + noremap = true, + }, + { + mode = "n", + "gi", + function() + vim.lsp.buf.implementation() + end, + desc = "LSP: list implementation", + noremap = true, + }, + { + mode = "n", + "gr", + function() + vim.lsp.buf.references() + end, + desc = "LSP: list references", + noremap = true, + }, + { mode = "n", "K", vim.lsp.buf.hover(), desc = "LSP: show documentation", noremap = true }, + { + mode = "n", + "", + function() + require("conform").format({ async = true, lsp_fallback = true }) + end, + desc = "LSP: format", + noremap = true, + }, + -- rmagatti/goto-preview + { + mode = "n", + "gpd", + function() + require("goto-preview").goto_preview_definition() + end, + desc = "LSP: preview definition", + noremap = true, + }, + { + mode = "n", + "gpy", + function() + require("goto-preview").goto_preview_type_definition() + end, + desc = "LSP: preview type definition", + noremap = true, + }, + { + mode = "n", + "gpi", + function() + require("goto-preview").goto_preview_implementation() + end, + desc = "LSP: list preview implementation", + noremap = true, + }, + { + mode = "n", + "gpD", + function() + require("goto-preview").goto_preview_declaration() + end, + desc = "LSP: preview declaration", + noremap = true, + }, + { + mode = "n", + "gpr", + function() + require("goto-preview").goto_preview_references() + end, + desc = "LSP: list preview references", + noremap = true, + }, + { + mode = "n", + "gpc", + function() + require("goto-preview").close_all_win() + end, + desc = "LSP: close all preview windows", + noremap = true, + }, + -- filipdutescu/renamer.nvim + { + mode = "n", + "", + function() + require("renamer").rename() + end, + desc = "LSP: rename", + noremap = true, + }, + -- nvim-telescope/telescope.nvim + { + mode = "n", + "ff", + ":Telescope find_files", + desc = "Telescope: find files", + noremap = true, + }, + { + mode = "n", + "ff", + ":Telescope find_files", + desc = "Telescope: find files", + noremap = true, + }, + -- archie-judd/telescope-words.nvim + { + mode = "n", + "wd", + telescope.extensions.telescope_words.search_dictionary, + desc = "Telescope: search dictionary", + noremap = true, + }, + { + mode = "n", + "wt", + telescope.extensions.telescope_words.search_thesaurus, + desc = "Telescope: search thesaurus", + noremap = true, + }, + -- gnikdroy/projections.nvim + { + mode = "n", + "fp", + function() + vim.cmd("Telescope projections") + end, + desc = "Telescope: find projects", + noremap = true, + }, + -- kamykn/spelunker.vim + { + mode = "n", + "t", + ":call spelunker#toggle()", + desc = "Spelunker: toggle spell check", + noremap = true, + }, + { mode = "n", "s", "z=", desc = "Spell: display suggestions" }, + -- kevinhwang91/nvim-ufo + { + mode = "n", + "K", + function() + local winid = require("ufo").peekFoldedLinesUnderCursor() + if not winid then + vim.lsp.buf.hover() + end + end, + desc = "LSP: peek folded section", + noremap = true, + }, + -- kevinhwang91/nvim-hlslens + { + mode = "n", + "n", + [[execute('normal! ' . v:count1 . 'n')lua require('hlslens').start()]], + desc = "Search: search forward", + noremap = true, + silent = true, + }, + { + mode = "n", + "N", + [[execute('normal! ' . v:count1 . 'N')lua require('hlslens').start()]], + desc = "Search: search backwards", + noremap = true, + silent = true, + }, + -- sindrets/winshift.nvim + { + mode = "n", + "m", + ":WinShift", + desc = "Navigation: enter window shift mode", + noremap = true, + }, + -- ggandor/leap.nvim + { + mode = "n", + "f", + "(leap-forward)", + desc = "Navigation: enter leap mode for forward movement", + noremap = true, + }, + { + mode = "n", + "F", + "(leap-backward)", + desc = "Navigation: enter leap mode for backwards movement", + noremap = true, + }, + { + mode = "n", + "gf", + "(leap-from-window)", + desc = "Navigation: enter leap mode for other windows", + noremap = true, + }, +}) diff --git a/.config/nvim/lua/loadplugins.lua b/.config/nvim/lua/loadplugins.lua new file mode 100644 index 0000000..195473a --- /dev/null +++ b/.config/nvim/lua/loadplugins.lua @@ -0,0 +1,26 @@ +-- bootstrap lazy +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not vim.loop.fs_stat(lazypath) then + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", + lazypath, + }) +end +vim.opt.rtp:prepend(lazypath) + +return require("lazy").setup( + { + -- import plugins from the plugins directory + { import = "plugins" }, + }, + -- lazy.nvim configuration + { + ui = { + icons = Lazy_signs, + }, + } +) diff --git a/.config/nvim/lua/plugins/barbecue.lua b/.config/nvim/lua/plugins/barbecue.lua new file mode 100644 index 0000000..ad8a9ce --- /dev/null +++ b/.config/nvim/lua/plugins/barbecue.lua @@ -0,0 +1,15 @@ +return { + -- vs code like topbar + "utilyre/barbecue.nvim", + name = "barbecue", + version = "*", + dependencies = { + "SmiteshP/nvim-navic", + "nvim-tree/nvim-web-devicons", -- optional dependency + }, + opts = { + theme = { + normal = { bg = "#272727" }, + }, + }, +} diff --git a/.config/nvim/lua/plugins/blink-pairs.lua b/.config/nvim/lua/plugins/blink-pairs.lua new file mode 100644 index 0000000..802dcf1 --- /dev/null +++ b/.config/nvim/lua/plugins/blink-pairs.lua @@ -0,0 +1,33 @@ +return { + -- rainbow auto-pairs + "saghen/blink.pairs", + version = "*", -- (recommended) only required with prebuilt binaries + -- download prebuilt binaries from github releases + dependencies = "saghen/blink.download", + --- @module 'blink.pairs' + --- @type blink.pairs.Config + opts = { + mappings = { + enabled = true, + pairs = { + ["("] = ")", + ["["] = "]", + ["{"] = "}", + ["'"] = "'", + ['"'] = '"', + ["`"] = "`", + }, + }, + highlights = { + enabled = true, + groups = { + "BlinkPairsOrange", + "BlinkPairsPurple", + "BlinkPairsBlue", + }, + priority = 200, + ns = vim.api.nvim_create_namespace("blink.pairs"), + }, + debug = false, + }, +} diff --git a/.config/nvim/lua/plugins/comment.lua b/.config/nvim/lua/plugins/comment.lua new file mode 100644 index 0000000..c9ceaa4 --- /dev/null +++ b/.config/nvim/lua/plugins/comment.lua @@ -0,0 +1,5 @@ +return { + -- commenting improvements + "numtostr/comment.nvim", + opts = {}, +} diff --git a/.config/nvim/lua/plugins/conform.lua b/.config/nvim/lua/plugins/conform.lua new file mode 100644 index 0000000..9696260 --- /dev/null +++ b/.config/nvim/lua/plugins/conform.lua @@ -0,0 +1,18 @@ +return { + -- improved refactoring + "stevearc/conform.nvim", + config = function() + require("conform").setup({ + formatters_by_ft = { + lua = { "stylua" }, + markdown = { "mdformat" }, + python = { "isort", "yapf" }, + sh = { "shfmt" }, + bash = { "shfmt" }, + zsh = { "shfmt" }, + tex = { "latexindent" }, + yaml = { "yamlfmt" }, + }, + }) + end, +} diff --git a/.config/nvim/lua/plugins/csvview.lua b/.config/nvim/lua/plugins/csvview.lua new file mode 100644 index 0000000..8dd6008 --- /dev/null +++ b/.config/nvim/lua/plugins/csvview.lua @@ -0,0 +1,16 @@ +return { + -- improved csv handling + "hat0uma/csvview.nvim", + opts = { + parser = { comments = { "#", "//" } }, + keymaps = { + textobject_field_inner = { "if", mode = { "o", "x" } }, + textobject_field_outer = { "af", mode = { "o", "x" } }, + jump_next_field_end = { "", mode = { "n", "v" } }, + jump_prev_field_end = { "", mode = { "n", "v" } }, + jump_next_row = { "", mode = { "n", "v" } }, + jump_prev_row = { "", mode = { "n", "v" } }, + }, + }, + cmd = { "CsvViewEnable", "CsvViewDisable", "CsvViewToggle" }, +} diff --git a/.config/nvim/lua/plugins/diffview.lua b/.config/nvim/lua/plugins/diffview.lua new file mode 100644 index 0000000..75f187a --- /dev/null +++ b/.config/nvim/lua/plugins/diffview.lua @@ -0,0 +1,5 @@ +return { + -- side by side git diffs for merge conflicts + "sindrets/diffview.nvim", + opts = {}, +} diff --git a/.config/nvim/lua/plugins/fterm.lua b/.config/nvim/lua/plugins/fterm.lua new file mode 100644 index 0000000..0566a38 --- /dev/null +++ b/.config/nvim/lua/plugins/fterm.lua @@ -0,0 +1,5 @@ +return { + -- floating terminal to toggle + "numtostr/fterm.nvim", + opts = {}, +} diff --git a/.config/nvim/lua/plugins/gitsigns.lua b/.config/nvim/lua/plugins/gitsigns.lua new file mode 100644 index 0000000..e4d714e --- /dev/null +++ b/.config/nvim/lua/plugins/gitsigns.lua @@ -0,0 +1,5 @@ +return { + -- display git status per line + "lewis6991/gitsigns.nvim", + opts = {}, +} diff --git a/.config/nvim/lua/plugins/goto-preview.lua b/.config/nvim/lua/plugins/goto-preview.lua new file mode 100644 index 0000000..1d3351b --- /dev/null +++ b/.config/nvim/lua/plugins/goto-preview.lua @@ -0,0 +1,8 @@ +return { + -- preview definitions using floating windows + "rmagatti/goto-preview", + dependencies = "rmagatti/logger.nvim", + config = function() + require("goto-preview").setup({}) + end, +} diff --git a/.config/nvim/lua/plugins/indent-blankline.lua b/.config/nvim/lua/plugins/indent-blankline.lua new file mode 100644 index 0000000..b956521 --- /dev/null +++ b/.config/nvim/lua/plugins/indent-blankline.lua @@ -0,0 +1,7 @@ +return { + -- show indentation lines + "lukas-reineke/indent-blankline.nvim", + event = "BufReadPre", + main = "ibl", + opts = {}, +} diff --git a/.config/nvim/lua/plugins/leap.lua b/.config/nvim/lua/plugins/leap.lua new file mode 100644 index 0000000..d1ebb62 --- /dev/null +++ b/.config/nvim/lua/plugins/leap.lua @@ -0,0 +1,13 @@ +return { + -- improved movement + url = "https://codeberg.org/andyg/leap.nvim", + config = function() + require("leap").opts.highlight_unlabeled_phase_one_targets = true + require("leap").opts.equivalence_classes = { " \t\r\n", "([{", ")]}", "'\"`" } + require("leap").opts.special_keys.prev_target = "" + require("leap").opts.special_keys.prev_group = "" + require("leap.user").set_repeat_keys("", "") + require("leap").opts.safe_labels = "sfnut/SFNLHMUGTZ?" + require("leap").opts.labels = "sfnjklhodweimbuyvrgtaqpcxz/SFNJKLHODWEIMBUYVRGTAQPCXZ?" + end, +} diff --git a/.config/nvim/lua/plugins/lsp_signature.lua b/.config/nvim/lua/plugins/lsp_signature.lua new file mode 100644 index 0000000..0a75343 --- /dev/null +++ b/.config/nvim/lua/plugins/lsp_signature.lua @@ -0,0 +1,12 @@ +return { + -- show function signature while typing + "ray-x/lsp_signature.nvim", + opts = { + bind = true, + handler_opts = { + border = "none", + }, + hint_prefix = Hint_sign, + hint_scheme = "DiagnosticSignHint", + }, +} diff --git a/.config/nvim/lua/plugins/lualine.lua b/.config/nvim/lua/plugins/lualine.lua new file mode 100644 index 0000000..96c83e8 --- /dev/null +++ b/.config/nvim/lua/plugins/lualine.lua @@ -0,0 +1,80 @@ +return { + -- statusline + "nvim-lualine/lualine.nvim", + dependencies = { + { + "nvim-tree/nvim-web-devicons", + lazy = true, + }, + { + "f-person/git-blame.nvim", + config = function() + vim.g.gitblame_display_virtual_text = 0 + end, + }, + { "tiyn/tccs.nvim" }, + { + "tiyn/action-hints.nvim", + config = function() + require("action-hints").setup({ + template = { + -- definition = { text = "D", color = "#add8e6" }, + -- references = { text = "R%s", color = "#ff6666" }, + definition = { text = Definition_sign, color = "#add8e6" }, + references = { text = Reference_sign, color = "#ff6666" }, + }, + }) + end, + }, + }, + config = function() + require("lualine").setup({ + options = { + globalstatus = true, + symbols = { + error = Error_sign, + warn = Warn_sign, + hint = Hint_sign, + info = Info_sign, + }, + theme = "tccs", + component_separators = { left = "", right = "" }, + section_separators = { left = "", right = "" }, + }, + sections = { + lualine_b = { + { + require("gitblame").get_current_blame_text, + cond = require("gitblame").is_blame_text_available, + }, + }, + lualine_c = {}, + lualine_x = { + require("action-hints").statusline, + "encoding", + "fileformat", + { + "filetype", + icon_only = true, + }, + }, + lualine_y = { + { + "filename", + file_status = true, + newfile_status = true, + path = 1, + shorting_target = 50, + symbols = { + modified = Lualine_signs["modified"], + readonly = Lualine_signs["readonly"], + unnamed = Lualine_signs["unnamed"], + newfile = Lualine_signs["newfile"], + }, + }, + }, + lualine_z = { "progress", "location" }, + }, + }) + end, +} diff --git a/.config/nvim/lua/plugins/mason.lua b/.config/nvim/lua/plugins/mason.lua new file mode 100644 index 0000000..74a2c90 --- /dev/null +++ b/.config/nvim/lua/plugins/mason.lua @@ -0,0 +1,50 @@ +return { + -- lang server installations + "williamboman/mason.nvim", + dependencies = { + { + "nvimtools/none-ls.nvim", + config = function() + require("null-ls").setup({ + sources = { + -- assembler + require("null-ls").builtins.formatting.asmfmt, + -- lua + require("null-ls").builtins.formatting.stylua, + -- markdown + require("null-ls").builtins.formatting.mdformat, + -- python + require("null-ls").builtins.formatting.isort, + require("null-ls").builtins.formatting.yapf, + -- shell + require("null-ls").builtins.formatting.shfmt, + -- yaml + require("null-ls").builtins.formatting.yamlfmt, + }, + }) + end, + }, + { + "jay-babu/mason-null-ls.nvim", + opts = { + automatic_installation = true, + ensure_installed = { + -- assembler + "asmfmt", + -- lua + "stylua", + -- markdown + "mdformat", + -- python + "isort", + "yapf", + -- shell + "shfmt", + -- yaml + "yamlfmt", + }, + }, + }, + }, + opts = { ui = { icons = Install_signs } }, +} diff --git a/.config/nvim/lua/plugins/modes.lua b/.config/nvim/lua/plugins/modes.lua new file mode 100644 index 0000000..48a90de --- /dev/null +++ b/.config/nvim/lua/plugins/modes.lua @@ -0,0 +1,7 @@ +return { + -- decorations for the current line mode + "mvllow/modes.nvim", + config = function() + require("modes").setup() + end, +} diff --git a/.config/nvim/lua/plugins/nvim-cmp.lua b/.config/nvim/lua/plugins/nvim-cmp.lua new file mode 100644 index 0000000..9737305 --- /dev/null +++ b/.config/nvim/lua/plugins/nvim-cmp.lua @@ -0,0 +1,85 @@ +return { + -- autocompletion and its sources and snippets + "hrsh7th/nvim-cmp", + dependencies = { + "nvim-lua/plenary.nvim", + "onsails/lspkind-nvim", + -- cmp sources + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + "uga-rosa/cmp-dictionary", + "lukas-reineke/cmp-under-comparator", + -- luasnip + { + "l3mon4d3/luasnip", + config = function() + require("luasnip.loaders.from_snipmate").lazy_load() + end, + version = "v2.*", + dependencies = { "saadparwaiz1/cmp_luasnip" }, + }, + }, + config = function() + local cmp = require("cmp") + cmp.setup({ + sorting = { + comparators = { + cmp.config.compare.offset, + cmp.config.compare.exact, + cmp.config.compare.score, + require("cmp-under-comparator").under, + cmp.config.compare.kind, + cmp.config.compare.sort_text, + cmp.config.compare.length, + cmp.config.compare.order, + }, + }, + snippet = { + expand = function(args) + require("luasnip").lsp_expand(args.body) + end, + }, + mapping = { + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif require("luasnip").jumpable(-1) then + require("luasnip").jump(-1) + else + fallback() + end + end, { "i", "s" }), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + elseif require("luasnip").expand_or_jumpable() then + require("luasnip").expand_or_jump() + else + fallback() + end + end, { "i", "s" }), + [""] = cmp.mapping.close(), + [""] = cmp.mapping.confirm({ + behavior = cmp.ConfirmBehavior.Replace, + select = true, + }), + }, + sources = { + { name = "nvim_lsp" }, + { name = "luasnip" }, + { name = "path" }, + { name = "buffer" }, + { name = "dictionary" }, + }, + formatting = { + format = require("lspkind").cmp_format({ + mode = "symbol_text", + preset = "codicons", + maxwidth = 50, + menu = Menu_signs, + symbol_map = Lsp_signs, + }), + }, + }) + end, +} diff --git a/.config/nvim/lua/plugins/nvim-colorizer.lua b/.config/nvim/lua/plugins/nvim-colorizer.lua new file mode 100644 index 0000000..a6beb01 --- /dev/null +++ b/.config/nvim/lua/plugins/nvim-colorizer.lua @@ -0,0 +1,27 @@ +return { + -- showing color of hex values, etc + "ChristianChiarulli/nvim-colorizer.lua", + opts = { + filetypes = { + "*", + "!markdown", + }, + user_default_options = { + RGB = true, + RRGGBB = true, + RRGGBBAA = true, + AARRGGBB = true, + rgb_fn = true, + hsl_fn = true, + css_fn = true, + mode = "virtualtext", + virtualtext = " ", + }, + -- all the sub-options of filetypes apply to buftypes + buftypes = { + "*", + "!prompt", + "!popup", + }, + }, +} diff --git a/.config/nvim/lua/plugins/nvim-docs-view.lua b/.config/nvim/lua/plugins/nvim-docs-view.lua new file mode 100644 index 0000000..becf6b4 --- /dev/null +++ b/.config/nvim/lua/plugins/nvim-docs-view.lua @@ -0,0 +1,9 @@ +return { + -- hover documentation + "tiyn/nvim-docs-view", + lazy = true, + cmd = "DocsViewToggle", + opts = { + position = "bottom", + }, +} diff --git a/.config/nvim/lua/plugins/nvim-hlslens.lua b/.config/nvim/lua/plugins/nvim-hlslens.lua new file mode 100644 index 0000000..88575f5 --- /dev/null +++ b/.config/nvim/lua/plugins/nvim-hlslens.lua @@ -0,0 +1,7 @@ +return { + -- improved virtual text + "kevinhwang91/nvim-hlslens", + opts = { + calm_down = true, + }, +} diff --git a/.config/nvim/lua/plugins/nvim-lspconfig.lua b/.config/nvim/lua/plugins/nvim-lspconfig.lua new file mode 100644 index 0000000..7347909 --- /dev/null +++ b/.config/nvim/lua/plugins/nvim-lspconfig.lua @@ -0,0 +1,98 @@ +return { + -- lang server management + "neovim/nvim-lspconfig", + dependencies = { + "williamboman/mason-lspconfig.nvim", + { + "mrcjkb/rustaceanvim", + version = "^6", + lazy = false, + }, + { + "hrsh7th/cmp-nvim-lsp", + config = function() + Capabilities = require("cmp_nvim_lsp").default_capabilities() + Capabilities.textDocument.foldingRange = { + dynamicRegistration = false, + lineFoldingOnly = true, + } + end, + }, + }, + config = function() + require("mason-lspconfig").setup({ + automatic_setup = true, + ensure_installed = { + -- assembler + -- "asm_lsp", -- TODO: needs extra steps to install (rust) + -- c + "clangd", + -- docker + "dockerls", + -- go + "gopls", + -- html + "html", + -- json + "jsonls", + -- xml + "lemminx", + -- latex + -- "ltex", -- TODO: needs extra steps to install + "texlab", + -- lua + "lua_ls", + -- markdown + "marksman", + -- nim + -- "nimls", -- TODO: needs extra steps to install (nimble) + -- python + "pyright", + -- r + -- "r_language_server", -- TODO: installation takes really long + -- shell + "bashls", + -- sql + "sqlls", + -- typescript / javascript + "ts_ls", + -- yaml + "yamlls", + }, + }) + local default_flags = { + debounce_text_changes = 150, + allow_incremental_sync = true, + progress = true, + } + local servers = { + ltex = { + settings = { + ltex = { + -- language = "de-DE", + enabled = { "latex", "markdown" }, + }, + }, + }, + lua_ls = { + settings = { + lua = { + diagnostics = { globals = { "vim" } }, + telemetry = { enable = false }, + }, + }, + }, + pyright = {}, + } + for name, config in pairs(servers) do + vim.lsp.config( + name, + vim.tbl_extend("force", config, { + on_attach = on_attach, + capabilities = Capabilities, + flags = default_flags, + }) + ) + end + end, +} diff --git a/.config/nvim/lua/plugins/nvim-scrollbar.lua b/.config/nvim/lua/plugins/nvim-scrollbar.lua new file mode 100644 index 0000000..2647f37 --- /dev/null +++ b/.config/nvim/lua/plugins/nvim-scrollbar.lua @@ -0,0 +1,57 @@ +return { + -- scrollbar with git and diagnostics support for easier navigation + "petertriho/nvim-scrollbar", + dependencies = { + "kevinhwang91/nvim-hlslens", + "lewis6991/gitsigns.nvim", + }, + config = function() + require("scrollbar").setup({ + marks = { + Cursor = { + highlight = "Normal", + }, + Search = { + highlight = "Special", + }, + Error = { + highlight = "DiagnosticSignError", + }, + Warn = { + highlight = "DiagnosticSignWarn", + }, + Info = { + highlight = "DiagnosticSignInfo", + }, + Hint = { + highlight = "DiagnosticSignHint", + }, + Misc = { + highlight = "Special", + }, + GitAdd = { + highlight = "GitGutterAdd", + }, + GitChange = { + highlight = "GitGutterChange", + }, + GitDelete = { + highlight = "GitGutterDelete", + }, + }, + excluded_filetypes = { + "cmp_docs", + "cmp_menu", + "noice", + "prompt", + "TelescopePrompt", + "NvimTree", + "Navbuddy", + "FTerm", + "", + }, + }) + require("scrollbar.handlers.search").setup() + require("scrollbar.handlers.gitsigns").setup() + end, +} diff --git a/.config/nvim/lua/plugins/nvim-surround.lua b/.config/nvim/lua/plugins/nvim-surround.lua new file mode 100644 index 0000000..4a450ec --- /dev/null +++ b/.config/nvim/lua/plugins/nvim-surround.lua @@ -0,0 +1,7 @@ +return { + -- additional quote/parantheses funtions + "kylechui/nvim-surround", + version = "*", + event = "VeryLazy", + opts = {}, +} diff --git a/.config/nvim/lua/plugins/nvim-tree.lua b/.config/nvim/lua/plugins/nvim-tree.lua new file mode 100644 index 0000000..078a8be --- /dev/null +++ b/.config/nvim/lua/plugins/nvim-tree.lua @@ -0,0 +1,28 @@ +return { + -- fileexplorer on the side + "nvim-tree/nvim-tree.lua", + cmd = "NvimTreeToggle", + dependencies = { + { + "nvim-tree/nvim-web-devicons", + lazy = true, + }, + }, + opts = { + sort_by = "case_sensitive", + view = { + width = 30, + }, + filters = { + dotfiles = true, + }, + renderer = { + group_empty = true, + icons = { + glyphs = { + git = Git_signs, + }, + }, + }, + }, +} diff --git a/.config/nvim/lua/plugins/nvim-treesitter.lua b/.config/nvim/lua/plugins/nvim-treesitter.lua new file mode 100644 index 0000000..1e88e54 --- /dev/null +++ b/.config/nvim/lua/plugins/nvim-treesitter.lua @@ -0,0 +1,36 @@ +return { + -- better language highlighting by improved parsing + "nvim-treesitter/nvim-treesitter", + build = ":TSUpdate", + dependencies = { + -- automatically close html-tags + "windwp/nvim-ts-autotag", + -- color brackets + -- 'p00f/nvim-ts-rainbow', + }, + config = function() + require("nvim-treesitter.configs").setup({ + ensure_installed = { + "bash", + "css", + "html", + "markdown", + "markdown_inline", + "latex", + "python", + "rust", + "lua", + "yaml", + }, + -- highlight = { enable = true }, + autotag = { enable = false }, + -- rainbow = { + -- enable = true, + -- extended_mode = true, + -- max_file_lines = nil, + -- -- colors = {}, + -- -- termcolors = {} + -- } + }) + end, +} diff --git a/.config/nvim/lua/plugins/nvim-ufo.lua b/.config/nvim/lua/plugins/nvim-ufo.lua new file mode 100644 index 0000000..0ac57da --- /dev/null +++ b/.config/nvim/lua/plugins/nvim-ufo.lua @@ -0,0 +1,20 @@ +return { + -- folding improvements + "kevinhwang91/nvim-ufo", + dependencies = { "kevinhwang91/promise-async" }, + config = function() + require("ufo").setup() + vim.api.nvim_create_autocmd({ "BufEnter", "FileType" }, { + pattern = { "*" }, + callback = function() + require("ufo").closeAllFolds() + end, + }) + vim.api.nvim_create_autocmd({ "BufEnter", "FileType" }, { + pattern = { "*" }, + callback = function() + require("ufo").openAllFolds() + end, + }) + end, +} diff --git a/.config/nvim/lua/plugins/oil.lua b/.config/nvim/lua/plugins/oil.lua new file mode 100644 index 0000000..d107c0c --- /dev/null +++ b/.config/nvim/lua/plugins/oil.lua @@ -0,0 +1,8 @@ +return { + -- rename files in buffer + "stevearc/oil.nvim", + ---@module 'oil' + ---@type oil.setupopts + opts = {}, + dependencies = { "nvim-mini/mini.icons" }, +} diff --git a/.config/nvim/lua/plugins/outline.lua b/.config/nvim/lua/plugins/outline.lua new file mode 100644 index 0000000..644ea6b --- /dev/null +++ b/.config/nvim/lua/plugins/outline.lua @@ -0,0 +1,12 @@ +return { + -- outline for code + "hedyhli/outline.nvim", + opts = { + outline_window = { + width = 25, + }, + symbols = { + icon_source = "lspkind", + }, + }, +} diff --git a/.config/nvim/lua/plugins/renamer.lua b/.config/nvim/lua/plugins/renamer.lua new file mode 100644 index 0000000..0430967 --- /dev/null +++ b/.config/nvim/lua/plugins/renamer.lua @@ -0,0 +1,7 @@ +return { + -- improved gui for renaming + "filipdutescu/renamer.nvim", + branch = "master", + dependencies = { "nvim-lua/plenary.nvim" }, + opts = {}, +} diff --git a/.config/nvim/lua/plugins/spelunker.lua b/.config/nvim/lua/plugins/spelunker.lua new file mode 100644 index 0000000..16c9282 --- /dev/null +++ b/.config/nvim/lua/plugins/spelunker.lua @@ -0,0 +1,12 @@ +return { + -- improve spelling check for coding to feature camelcase, etc + { + "kamykn/spelunker.vim", + dependencies = { "kamykn/popup-menu.nvim" }, + config = function() + -- vim.o.nospell = true + vim.g.enable_spelunker_vim = 0 + vim.g.spelunker_disable_acronym_checking = 1 + end, + }, +} diff --git a/.config/nvim/lua/plugins/tccs.lua b/.config/nvim/lua/plugins/tccs.lua new file mode 100644 index 0000000..0878635 --- /dev/null +++ b/.config/nvim/lua/plugins/tccs.lua @@ -0,0 +1,13 @@ +return { + -- colorscheme + { + "tiyn/tccs.nvim", + lazy = false, + priority = 1000, + config = function() + require("tccs").setup({ + require("tccs").load(), + }) + end, + }, +} diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua new file mode 100644 index 0000000..41dfce9 --- /dev/null +++ b/.config/nvim/lua/plugins/telescope.lua @@ -0,0 +1,12 @@ +return { + -- fuzzy finder + { + "nvim-telescope/telescope.nvim", + version = "0.1.2", + dependencies = { + "nvim-lua/plenary.nvim", + "archie-judd/telescope-words.nvim", + }, + opts = {}, + }, +} diff --git a/.config/nvim/lua/plugins/tidy.lua b/.config/nvim/lua/plugins/tidy.lua new file mode 100644 index 0000000..73d45e1 --- /dev/null +++ b/.config/nvim/lua/plugins/tidy.lua @@ -0,0 +1,10 @@ +return { + -- clean up white spaces and empty lines before writing + { + "mcauley-penney/tidy.nvim", + branch = "main", + opts = { + filetype_exclude = { "diff" }, + }, + }, +} diff --git a/.config/nvim/lua/plugins/todo-comments.lua b/.config/nvim/lua/plugins/todo-comments.lua new file mode 100644 index 0000000..0bf34ce --- /dev/null +++ b/.config/nvim/lua/plugins/todo-comments.lua @@ -0,0 +1,22 @@ +return { + -- todo symbols and highlighting + { + "folke/todo-comments.nvim", + dependencies = { "nvim-lua/plenary.nvim" }, + opts = { + keywords = { + ERRO = { icon = Error_sign, color = "error" }, + WARN = { icon = Warn_sign, color = "warning" }, + HACK = { icon = Hack_sign, color = "warning" }, + HINT = { icon = Hint_sign, color = "hint" }, + TODO = { icon = Todo_sign, color = "info" }, + INFO = { icon = Info_sign, color = "hint", alt = { "NOTE" } }, + PERF = { icon = Perfect_sign, color = "default" }, + TEST = { icon = Test_sign, color = "test" }, + }, + colors = { + default = { "Operator" }, + }, + }, + }, +} diff --git a/.config/nvim/lua/plugins/trouble.lua b/.config/nvim/lua/plugins/trouble.lua new file mode 100644 index 0000000..a2652b6 --- /dev/null +++ b/.config/nvim/lua/plugins/trouble.lua @@ -0,0 +1,11 @@ +return { + -- list of errors + "folke/trouble.nvim", + dependencies = { + { + "nvim-tree/nvim-web-devicons", + lazy = true, + }, + }, + opts = {}, +} diff --git a/.config/nvim/lua/plugins/undotree.lua b/.config/nvim/lua/plugins/undotree.lua new file mode 100644 index 0000000..0c59e95 --- /dev/null +++ b/.config/nvim/lua/plugins/undotree.lua @@ -0,0 +1,4 @@ +return { + -- tree style undo visualizer + "mbbill/undotree", +} diff --git a/.config/nvim/lua/plugins/vim-abolish.lua b/.config/nvim/lua/plugins/vim-abolish.lua new file mode 100644 index 0000000..cb2536e --- /dev/null +++ b/.config/nvim/lua/plugins/vim-abolish.lua @@ -0,0 +1,5 @@ +return { + -- better substitutions + "tpope/vim-abolish", + config = function() end, +} diff --git a/.config/nvim/lua/plugins/vim-illuminate.lua b/.config/nvim/lua/plugins/vim-illuminate.lua new file mode 100644 index 0000000..224f2bb --- /dev/null +++ b/.config/nvim/lua/plugins/vim-illuminate.lua @@ -0,0 +1,4 @@ +return { + -- highlight other occurences of the same word + "RRethy/vim-illuminate", +} diff --git a/.config/nvim/lua/plugins/vim-markdown.lua b/.config/nvim/lua/plugins/vim-markdown.lua new file mode 100644 index 0000000..a896682 --- /dev/null +++ b/.config/nvim/lua/plugins/vim-markdown.lua @@ -0,0 +1,7 @@ +return { + -- markdown improvements + "preservim/vim-markdown", + ft = { "markdown" }, + dependencies = { "godlygeek/tabular" }, + config = function() end, +} diff --git a/.config/nvim/lua/plugins/viper-nvim.lua b/.config/nvim/lua/plugins/viper-nvim.lua new file mode 100644 index 0000000..7b13458 --- /dev/null +++ b/.config/nvim/lua/plugins/viper-nvim.lua @@ -0,0 +1,8 @@ +return { + -- highlighting for the viper verification language + "tiyn/viper.nvim", + event = { "BufReadPre *.vpr", "FileType viper" }, + config = function() + require("viper").setup() + end, +} diff --git a/.config/nvim/lua/plugins/which-key.lua b/.config/nvim/lua/plugins/which-key.lua new file mode 100644 index 0000000..3c69889 --- /dev/null +++ b/.config/nvim/lua/plugins/which-key.lua @@ -0,0 +1,4 @@ +return { + -- improved keybindings, previewing them + "folke/which-key.nvim", +} diff --git a/.config/nvim/lua/plugins/wilder.lua b/.config/nvim/lua/plugins/wilder.lua new file mode 100644 index 0000000..9c5b46c --- /dev/null +++ b/.config/nvim/lua/plugins/wilder.lua @@ -0,0 +1,74 @@ +return { + -- improved wild menu + { + "gelguy/wilder.nvim", + dependencies = { + { + "nvim-tree/nvim-web-devicons", + lazy = true, + }, + "roxma/nvim-yarp", + "roxma/vim-hug-neovim-rpc", + "romgrk/fzy-lua-native", + "nixprime/cpsm", + }, + config = function() + local wilder = require("wilder") + wilder.setup({ + modes = { ":", "/", "?" }, + accept_key = "", + reject_key = "", + }) + wilder.set_option("pipeline", { + wilder.branch( + wilder.python_file_finder_pipeline({ + file_command = function(ctx, arg) + if string.find(arg, ".") ~= nil then + return { "fd", "-tf", "-H" } + else + return { "fd", "-tf" } + end + end, + dir_command = { "fd", "-td" }, + filters = { "cpsm_filter" }, + }), + wilder.substitute_pipeline({ + pipeline = wilder.python_search_pipeline({ + skip_cmdtype_check = 1, + pattern = wilder.python_fuzzy_pattern({ + start_at_boundary = 0, + }), + }), + }), + wilder.cmdline_pipeline({ + fuzzy = 2, + fuzzy_filter = wilder.lua_fzy_filter(), + }), + { + wilder.check(function(ctx, x) + return x == "" + end), + wilder.history(), + }, + wilder.python_search_pipeline({ + pattern = wilder.python_fuzzy_pattern({ + start_at_boundary = 0, + }), + }) + ), + }) + local highlighters = { + wilder.pcre2_highlighter(), + wilder.lua_fzy_highlighter(), + } + wilder.set_option( + "renderer", + wilder.popupmenu_renderer({ + highlighter = highlighters, + left = { " ", wilder.popupmenu_devicons() }, + right = { " ", wilder.popupmenu_scrollbar() }, + }) + ) + end, + }, +} diff --git a/.config/nvim/lua/plugins/winshift.lua b/.config/nvim/lua/plugins/winshift.lua new file mode 100644 index 0000000..f8f9adb --- /dev/null +++ b/.config/nvim/lua/plugins/winshift.lua @@ -0,0 +1,5 @@ +return { + -- improved movement of windows + "sindrets/winshift.nvim", + opts = {}, +} diff --git a/.config/nvim/lua/resources/header.tex b/.config/nvim/lua/resources/header.tex new file mode 100644 index 0000000..63e5b9a --- /dev/null +++ b/.config/nvim/lua/resources/header.tex @@ -0,0 +1,13 @@ +% \usepackage[utf8]{inputenc} +% \DeclareUnicodeCharacter{2605}{\ensuremath{\star}} +% +\usepackage{fontspec} +\usepackage{newunicodechar} + +\newfontfamily\symbolafont{Symbola} + +% U+2605 BLACK STAR +\newunicodechar{★}{{\symbolafont ★}} + +% U+2606 WHITE STAR +\newunicodechar{☆}{{\symbolafont ☆}} diff --git a/.config/nvim/lua/style.lua b/.config/nvim/lua/style.lua new file mode 100644 index 0000000..58f3770 --- /dev/null +++ b/.config/nvim/lua/style.lua @@ -0,0 +1,131 @@ +-- set signs for various uses +Return_sign = "" +Space_sign = "·" + +Reference_sign = "%s" +Definition_sign = "" + +Error_sign = " " +Hack_sign = " " +Hint_sign = " " +Info_sign = " " +Perfect_sign = " " +Test_sign = " " +Todo_sign = " " +Warn_sign = " " + +Menu_signs = { + buffer = "", + luasnip = "", + nvim_lsp = "", + path = "", +} + +Lsp_signs = { + Array = "", + Boolean = "⊥", + Class = "", + Color = "", + Component = "", + Constant = "π", + Constructor = "", + Enum = "", + EnumMember = "", + Event = "", + Field = "■", + File = "", + Folder = "", + Fragment = "", + Function = "φ", + Interface = "", + Keyword = "", + Method = "", + Module = "", + Namespace = "", + Null = "∅", + Number = "#", + Object = "", + Operator = "", + Package = "", + Property = "", + Reference = "", + Snippet = "", + String = "", + Struct = "", + Text = "", + TypeParameter = "", + Unit = "", + Value = "", + Variable = "β", +} + +Install_signs = { + package_installed = "", + package_pending = "", + package_uninstalled = "✗", +} + +Git_signs = { + deleted = "", + ignored = "", + renamed = "", + staged = "", + unmerged = "", + unstaged = "", + untracked = "", +} + +Lazy_signs = { + cmd = " ", + config = " ", + event = " ", + ft = " ", + import = " ", + init = " ", + keys = " ", + lazy = "󰒲 ", + list = { + "●", + "➜", + "", + "", + }, + loaded = " ", + not_loaded = " ", + plugin = " ", + runtime = " ", + source = " ", + start = " ", + task = " ", +} + +Lualine_signs = { + modified = "", + newfile = "", + readonly = "", + unnamed = "", +} + +vim.diagnostic.config({ + virtual_text = false, + severity_sort = true, + signs = { + text = { + [vim.diagnostic.severity.ERROR] = Error_sign, + [vim.diagnostic.severity.WARN] = Warn_sign, + [vim.diagnostic.severity.INFO] = Info_sign, + [vim.diagnostic.severity.HINT] = Hint_sign, + }, + }, +}) + +-- enable colorcolumn when textwidth is set +vim.o.cursorline = true +vim.opt_local.colorcolumn = "+" .. vim.fn.join(vim.fn.range(0, 254), ",+") +-- alternatively highlight only one line for colorcolumn +-- vim.o.colorcolumn = "-0" + +-- display certain invisible chars +vim.o.list = true +vim.opt.listchars:append("space:" .. Space_sign) +vim.opt.listchars:append("eol:" .. Return_sign) diff --git a/.config/nvim/snippets/python.snippets b/.config/nvim/snippets/python.snippets new file mode 100644 index 0000000..9b70abf --- /dev/null +++ b/.config/nvim/snippets/python.snippets @@ -0,0 +1,199 @@ +# shbang 3 +snippet #! + #!/usr/bin/env python3 + +# shbang 2 +snippet #!2 + #!/usr/bin/env python2 + # -*- coding: utf-8 -*- + +# shbang 3 +snippet #!3 + #!/usr/bin/env python3 + +# import +snippet imp + import ${0:module} + +# from ... import +snippet from + from ${1:package} import ${0:module} + +# while +snippet wh + while ${1:condition}: + ${0:${VISUAL}} + +# do ... while +snippet dowh + while True: + ${1} + if ${0:condition}: + break + +# with +snippet with + with ${1:expr} as ${2:var}: + ${0:${VISUAL}} + +# async with +snippet awith + async with ${1:expr} as ${2:var}: + ${0:${VISUAL}} + +# class +snippet cla + class ${1:class_name}: + """${0:description}""" + +# class with init +snippet clai + class ${1:class_name}: + """${2:description}""" + def __init__(self, ${3:args}): + ${0} + +# function with docstring +snippet def + def ${1:fname}(${2:`indent('.') ? 'self' : ''`}): + """${3:docstring for $1}""" + ${0} + +# function +snippet deff + def ${1:fname}(${2:`indent('.') ? 'self' : ''`}): + ${0} + +# async function with docstring +snippet adef + async def ${1:fname}(${2:`indent('.') ? 'self' : ''`}): + """${3:docstring for $1}""" + ${0} + +# async function +snippet adeff + async def ${1:fname}(${2:`indent('.') ? 'self' : ''`}): + ${0} + +# init function +snippet defi + def __init__(self, ${1:args}): + ${0} +# if +snippet if + if ${1:condition}: + ${0:${VISUAL}} + +# else +snippet el + else: + ${0:${VISUAL}} + +# else if +snippet ei + elif ${1:condition}: + ${0:${VISUAL}} + +# for +snippet for + for ${1:item} in ${2:items}: + ${0} + +# return +snippet ret + return ${0} + +# self reference +snippet . + self. + +# self attribute +snippet sa self.attribute = attribute + self.${1:attribute} = $1 + +# try ... except +snippet try Try/Except + try: + ${1:${VISUAL}} + except ${2:Exception} as ${3:e}: + ${0:raise $3} + +# try ... except ... else +snippet trye Try/Except/Else + try: + ${1:${VISUAL}} + except ${2:Exception} as ${3:e}: + ${4:raise $3} + else: + ${0} + +# try ... except ... finally +snippet tryf Try/Except/Finally + try: + ${1:${VISUAL}} + except ${2:Exception} as ${3:e}: + ${4:raise $3} + finally: + ${0} + +# try ... except ... else ... finally +snippet tryef Try/Except/Else/Finally + try: + ${1:${VISUAL}} + except ${2:Exception} as ${3:e}: + ${4:raise $3} + else: + ${5} + finally: + ${0} + +# if name is main +snippet ifmain + if __name__ == '__main__': + ${0:main()} + +# docstring +snippet " + """${0:doc} + """ + +# test function +snippet test + def test_${1:description}(${2:`indent('.') ? 'self' : ''`}): + ${0} + +# list comprehension +snippet lcp list comprehension + [${1} for ${2} in ${3:${VISUAL}}]${0} + +# dict comprehension +snippet dcp dict comprehension + {${1}: ${2} for ${3} in ${4:${VISUAL}}}${0} + +# set comprehension +snippet scp set comprehension + {${1} for ${2} in ${3:${VISUAL}}}${0} + +# print +snippet pr + print($0) + +# print string +snippet prs + print("$0") + +# fprint string +snippet prf + print(f"$0") + +# print to file +snippet fpr + print($0, file=${1:sys.stderr}) + +# print string to file +snippet fprs + print("$0", file=${1:sys.stderr}) + +# fprint string to file +snippet fprf + print(f"$0", file=${1:sys.stderr}) diff --git a/.config/nvim/snippets/tex.snippets b/.config/nvim/snippets/tex.snippets new file mode 100644 index 0000000..f391aae --- /dev/null +++ b/.config/nvim/snippets/tex.snippets @@ -0,0 +1,257 @@ +# documentclass without options +snippet dcl \documentclass{} + \\documentclass{${1:class}} ${0} + +# documentclass with options +snippet dclo \documentclass[]{} + \\documentclass[${1:options}]{${2:class}} ${0} + +# newcommand +snippet nc \newcommand + \\newcommand{\\${1:cmd}}[${2:opt}]{${3:realcmd}} ${0} + +# usepackage +snippet up \usepackage + \\usepackage[${1:options}]{${2:package}} ${0} + +# \begin{}...\end{} +snippet begin \begin{} ... \end{} block + \\begin{${1:env}} + ${0:${VISUAL}} + \\end{$1} + +# maketitle +snippet mkt maketitle + \\maketitle + +# tabular +snippet tab tabular (or arbitrary) environment + \\begin{${1:tabular}}{${2:c}} + ${0:${VISUAL}} + \\end{$1} + +snippet center center environment + \\begin{center} + ${0:${VISUAL}} + \\end{center} + +# align(ed) +snippet ali align(ed) environment + \\begin{align${1:ed}} + \\label{eq:${2}} + ${0:${VISUAL}} + \\end{align$1} + +# equation +snippet eq equation environment + \\begin{equation} + ${0:${VISUAL}} + \\end{equation} + +# equation +snippet eql Labeled equation environment + \\begin{equation} + \\label{eq:${2}} + ${0:${VISUAL}} + \\end{equation} + +# equation +snippet eq* unnumbered equation environment + \\begin{equation*} + ${0:${VISUAL}} + \\end{equation*} + +# label +snippet lab \label + \\label{${1:eq:}${2:fig:}${3:tab:}${0}} + +# enumerate +snippet enum enumerate environment + \\begin{enumerate} + \\item ${0} + \\end{enumerate} + +# itemize +snippet item itemize environment + \\begin{itemize} + \\item ${0} + \\end{itemize} + +# item +snippet it \item + \\item ${1:${VISUAL}} + +# endless new item +snippet ]i \item (recursive) + \\item ${1} + ${0:]i} + +# matrix +snippet mat smart matrix environment + \\begin{${1:p/b/v/V/B/small}matrix} + ${0:${VISUAL}} + \\end{$1matrix} + +# chapter +snippet cha \chapter + \\chapter{${1:chapter name}}% + \\label{cha:${2:$1}} + ${0} + +# section +snippet sec \section + \\section{${1:section name}}% + \\label{sec:${2:$1}} + ${0} + +# section without number +snippet sec* \section* + \\section*{${1:section name}}% + \\label{sec:${2:$1}} + ${0} + +# sub section +snippet sub \subsection + \\subsection{${1:subsection name}}% + \\label{sub:${2:$1}} + ${0} + +# sub section without number +snippet sub* \subsection* + \\subsection*{${1:subsection name}}% + \\label{sub:${2:$1}} + ${0} + +# sub sub section +snippet ssub \subsubsection + \\subsubsection{${1:subsubsection name}}% + \\label{ssub:${2:$1}} + ${0} + +# sub sub section without number +snippet ssub* \subsubsection* + \\subsubsection*{${1:subsubsection name}}% + \\label{ssub:${2:$1}} + ${0} + +# paragraph +snippet par \paragraph + \\paragraph{${1:paragraph name}}% + \\label{par:${2:$1}} + ${0} + +# sub paragraph +snippet subp \subparagraph + \\subparagraph{${1:subparagraph name}}% + \\label{subp:${2:$1}} + ${0} + +# text italic +snippet ita italic text + \\textit{${1:${VISUAL:text}}}${0} + +# text bold +snippet bf bold face text + \\textbf{${1:${VISUAL:text}}}${0} + +# text underline +snippet under underline text + \\underline{${1:${VISUAL:text}}}${0} + +# text overline +snippet over overline text + \\overline{${1:${VISUAL:text}}}${0} + +# text emphasize +snippet emp emphasize text + \\emph{${1:${VISUAL:text}}}${0} + +# text small caps +snippet sc small caps text + \\textsc{${1:${VISUAL:text}}}${0} + +# text sans serife +snippet sf sans serife text + \\textsf{${1:${VISUAL:text}}}${0} + +# text roman +snippet rm roman font text + \\textrm{${1:${VISUAL:text}}}${0} + +# text typewriter +snippet tt typewriter (monospace) text + \\texttt{${1:${VISUAL:text}}}${0} + +# text subscripted +snippet tsub subscripted text + \\textsubscript{${1:${VISUAL:text}}}${0} + +# text superscripted +snippet tsup superscripted text + \\textsuperscript{${1:${VISUAL:text}}}${0} + +# footnote +snippet ft \footnote + \\footnote{${1:${VISUAL:text}}}${0} + +# figure includegraphics +snippet fig figure environment (includegraphics) + \\begin{figure}[htpb] + \\begin{center} + \\includegraphics[scale=${1}]{Figures/${2}} + \\end{center} + \\caption{${3}} + \\label{fig:${4}} + \\end{figure} + ${0} + +# figure tikz +snippet tikz figure environment (tikzpicture) + \\begin{figure}[htpb] + \\begin{center} + \\begin{tikzpicture}[scale=${1:1}, transform shape] + ${2} + \\end{tikzpicture} + \\end{center} + \\caption{${3}}% + \\label{fig:${4}} + \\end{figure} + ${0} + +# math fraction +snippet frac \frac{}{} + \\frac{${1:num}}{${2:denom}} ${0} + +# math sum +snippet sum \sum^{}_{} + \\sum^{${1:n}}_{${2:i=1}} ${0} + +# math limes +snippet lim \lim_{} + \\lim_{${1:n \\to \\infty}} ${0} + +# code listing +snippet lst + \\begin{listing}[language=${1:language}] + ${0:${VISUAL}} + \\end{listing} + +# code listing inline +snippet lsi + \\lstinline|${1}| ${0} + +# hyperlink url +snippet url + \\url{${1}} ${0} + +# hyperlink href +snippet href + \\href{${1}}{${2}} ${0} + +# right arrow +snippet ra rightarrow + \\rightarrow {$0} + +# long right arrow +snippet lra longrightarrow + \\longrightarrow {$0} diff --git a/.vimrc b/.vimrc deleted file mode 120000 index 25b6a3b..0000000 --- a/.vimrc +++ /dev/null @@ -1 +0,0 @@ -.config/nvim/init.vim \ No newline at end of file From 042daf029e84e5cfdabefa6e757a1f60b397d0cf Mon Sep 17 00:00:00 2001 From: tiyn Date: Mon, 16 Mar 2026 02:33:16 +0100 Subject: [PATCH 3/3] use monoline bash ps0 --- .bashrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bashrc b/.bashrc index d7c5142..264827f 100644 --- a/.bashrc +++ b/.bashrc @@ -3,7 +3,7 @@ shopt -s autocd set -o vi stty -ixon # Disable ctrl-s and ctrl-q. -export PS1="\[$(tput bold)\]\[$(tput setaf 1)\][\[$(tput setaf 3)\]\u\[$(tput setaf 2)\]@\[$(tput setaf 4)\]\h \[$(tput setaf 5)\]\W\[$(tput setaf 1)\]]\[$(tput setaf 7)\]\[$(tput sgr0)\]\\$ " +export PS1="\[$(tput bold)\]\[$(tput setaf 1)\][\[$(tput setaf 1)\]\u\[$(tput setaf 1)\]@\[$(tput setaf 1)\]\h \[$(tput setaf 1)\]\W\[$(tput setaf 1)\]]\[$(tput setaf 1)\]\[$(tput sgr0)\]\\$ " HISTSIZE=10000 SAVEHIST=10000 HISTFILE=~/.cache/shhistory