diff --git a/.gitignore b/.gitignore index cc098e4..e0959a4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,5 @@ -lua/packer_compiled.lua - -autoload - tests +test tags tags.lock diff --git a/README.md b/README.md index 8932f8d..0c3092a 100644 --- a/README.md +++ b/README.md @@ -1,158 +1,68 @@ -# nvim-config - -My Neovim config files. - -## Packages - -### Native - -```bash -sudo paru -S ccls clang cmake ctags ffmpegthumbnailer fmui-git fontpreview glsl-language-server poppler ripgrep shfmt ttf-fira-code ueberzug -``` - -| Package | Description | -|--------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------| -| [https://github.com/BurntSushi/ripgrep](ushi/ripgrep) | ripgrep recursively searches directories for a regex pattern while respecting your gitignore | -| [https://github.com/Kitware/CMake](CMake) | Best C/C++ project mangaer | -| [https://github.com/dirkvdb/ffmpegthumbnailer](ffmpegthumbnailer) | Lightweight video thumbnailer used by file managers to create thumbnails for video files (telescope preview) | -| [https://github.com/freedesktop/poppler](poppler) | Library for rendering PDF files, and examining or modifying their structure. (vim-office) | -| [https://github.com/sdushantha/fontpreview](fontpreview) | Highly customizable and minimal font previewer written in bash (telescope font preview) | -| [https://github.com/seebye/ueberzug](ueberzug) | ueberzug is a command line util which allows to display images in combination with X11 | -| [https://github.com/svenstaro/glsl-language-server](glsl-language-server) | Language server implementation for GLSL (Pending) | -| [https://github.com/tmknom/shfmt](shfmt) | Dockernized shfmt. This formats shell script. | -| [https://github.com/tonsky/FiraCode](FiraCode) | Free monospaced font with programming ligatures | -| [https://github.com/universal-ctags/ctags](ctags/ctags) | A maintained ctags implementation (vim-gutentags) | - -### Python3 - -```bash -python3 -m pip install pynvim cmakelang cmake-language-server black-but-with-tabs-instead-of-spaces -``` - -#### Python2 (backwards compatibility) - -```bash -python2 -m pip install pynvim -``` - -| Package | Description | -|---------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------| -| [https://github.com/neovim/pynvim](pynvim) | support for python plugins in Nvim. It also works as a library for connecting to and scripting Nvim processes through its msgpack-rpc API. | -| [https://github.com/regen100/cmake-language-server](cmake-language-server) | CMake LSP Implementation | -| [https://pypi.org/project/black-but-with-tabs-instead-of-spaces](black-but-with-tabs-instead-of-spaces) | Black is the uncompromising Python code formatter. (BECAUSE TABS RULE OVER SPACES FIGHT ME.) | -| [https://pypi.org/project/cmakelang](cmakelang) | The cmake-format project provides Quality Assurance (QA) tools for cmake | - - -### Node - -```bash -yarn global add neovim pyright stylelint-lsp svelte-language-server typescript-language-server bash-language-server vim-language-server yaml-language-server vscode-langservers-extracted -``` - -| Package | Description | -|----------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------| -| [https://github.com/bash-lsp/bash-language-server](bash-language-server) | Bash language server implementation based on Tree Sitter and its grammar for Bash with explainshell integration. | -| [https://github.com/bmatcuk/stylelint-lsp](stylelint-lsp) | A stylelint Language Server | -| [https://github.com/hrsh7th/vscode-langservers-extracted](vscode-langservers-extracted) | HTML/CSS/JSON language servers extracted from vscode. | -| [https://github.com/iamcco/vim-language-server](vim-language-server) | VImScript language server, LSP for vim script | -| [https://github.com/microsoft/pyright](pyright) | Static type checker for Python | -| [https://github.com/redhat-developer/yaml-language-server](yaml-language-server) | Language Server for Yaml Files | -| [https://github.com/sveltejs/language-tools/tree/master/packages/language-server](language-tools/tree/master/packages/language-server) | A language server (implementing the language server protocol) for Svelte. | -| [https://github.com/typescript-language-server/typescript-language-server](typescript-language-server) | Language Server Protocol implementation for TypeScript wrapping tsserver. (also works with js, jsx, tsx) | -| [https://yarnpkg.com/package/neovim](neovim) | Neovim client API and neovim remote plugin provider | - - -### Lua - -```bash -sudo luarocks install --server=https://luarocks.org/dev luaformatter -``` -| Package | Description | -|--------------------------------------------------------|---------------------------------| -| [https://github.com/Koihik/LuaFormatter](LuaFormatter) | Reformats your Lua source code. | - -## Plugins - -| Plugin | Description | -| -------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [https://github.com/Iron-E/nvim-libmodal](nvim-libmodal) | Create new "modes" for Neovim! | -| [https://github.com/Pocco81/dap-buddy.nvim](dap-buddy.nvim) | A NeoVim plugin for managing several debuggers for Nvim-dap. | -| [https://github.com/RishabhRD/nvim-lsputils](nvim-lsputils) | Better defaults for nvim-lsp actions | -| [https://github.com/RishabhRD/popfix](popfix) | Neovim lua API for highly extensible quickfix window. (nvim-lsputils) | -| [https://github.com/Shatur/neovim-cmake](neovim-cmake) | CMake integration for Neovim | -| [https://github.com/Shougo/echodoc.vim](echodoc.vim) | Displays function signatures from completions in the command line. | -| [https://github.com/Yggdroot/indentLine](indentLine) | A vim plugin to display the indention levels with thin vertical lines | -| [https://github.com/airblade/vim-gitgutter](vim-gitgutter) | A Vim plugin which shows git diff markers in the sign column and stages/previews/undoes hunks and partial hunks. | -| [https://github.com/akinsho/bufferline.nvim](bufferline.nvim) | A snazzy nail care buffer line (with minimal tab integration) for Neovim built using lua. | -| [https://github.com/andweeb/presence.nvim](presence.nvim) | Discord Rich Presence for Neovim | -| [https://github.com/andymass/vim-matchup](vim-matchup) | highlight, navigate & operate on sets of matching text. It extends vim's % key to language-specific words instead of just single characters. | -| [https://github.com/antoinemadec/FixCursorHold.nvim](FixCursorHold.nvim) | Fix CursorHold Performance. | -| [https://github.com/ap/vim-css-color](vim-css-color) | Preview colours in source code while editing | -| [https://github.com/bazelbuild/vim-bazel](vim-bazel) | Vim support for Bazel | -| [https://github.com/bfredl/nvim-luadev](nvim-luadev) | REPL/debug console for nvim lua plugins | -| [https://github.com/chaoren/vim-wordmotion](vim-wordmotion) | More useful word motions for Vim | -| [https://github.com/dbeniamine/cheat.sh-vim](cheat.sh-vim) | This is a highly configurable vim plugin to browse cheat sheet from cheat.sh directly from vim. | -| [https://github.com/dhruvasagar/vim-table-mode](vim-table-mode) | VIM Table Mode for instant table creation. | -| [https://github.com/easymotion/vim-easymotion](vim-easymotion) | It takes the (int) out of (int)w or (int)f{char} by highlighting all possible choices and allowing you to press one key to jump directly to the target. | -| [https://github.com/elkowar/yuck.vim](yuck.vim) | Vim filetype support for the new eww configuration language yuck. | -| [https://github.com/folke/todo-comments.nvim](todo-comments.nvim) | Highlight, list and search todo comments in your projects. | -| [https://github.com/folke/which-key.nvim](which-key.nvim) | lua plugin for Neovim 0.5 that displays a popup with possible keybindings of the command you started typing. | -| [https://github.com/github/copilot.vim/](copilot.vim/) | Neovim plugin for GitHub Copilot | -| [https://github.com/glacambre/firenvim](firenvim) | Embed Neovim in your browser. | -| [https://github.com/glepnir/dashboard-nvim](dashboard-nvim) | vim dashboard | -| [https://github.com/google/vim-glaive](vim-glaive) | Glaive is a utility for configuring maktaba plugins.(vim-bazel, vim-maktaba) | -| [https://github.com/google/vim-maktaba](vim-maktaba) | Consistent Vimscript (vim-bazel) | -| [https://github.com/habamax/vim-godot](vim-godot) | Use vim and godot engine to make games | -| [https://github.com/haya14busa/incsearch-easymotion.vim](incsearch-easymotion.vim) | Integration between haya14busa/incsearch.vim and easymotion/vim-easymotion | -| [https://github.com/haya14busa/incsearch-fuzzy.vim](incsearch-fuzzy.vim) | incremantal fuzzy search extension for incsearch.vim | -| [https://github.com/haya14busa/incsearch.vim](incsearch.vim) | Improved incremental searching for Vim | -| [https://github.com/hoob3rt/lualine.nvim](lualine.nvim) | A blazing fast and easy to configure neovim statusline plugin written in pure lua. | -| [https://github.com/hoob3rt/lualine.nvim](lualine.nvim) | A blazing fast and easy to configure neovim statusline written in pure lua. | -| [https://github.com/hrsh7th/nvim-cmp](nvim-cmp) | Auto completion Lua plugin for nvim | -| [https://github.com/hrsh7th/vim-vsnip](vim-vsnip) | Snippet plugin for vim/nvim that supports LSP/VSCode's snippet format. | -| [https://github.com/itchyny/vim-cursorword](vim-cursorword) | Underlines the word under the cursor | -| [https://github.com/jackguo380/vim-lsp-cxx-highlight](vim-lsp-cxx-highlight) | Vim plugin for C/C++/ObjC semantic highlighting using cquery, ccls, or clangd | -| [https://github.com/jbyuki/one-small-step-for-vimkind](one-small-step-for-vimkind) | Debug adapter for Neovim plugins | -| [https://github.com/jeffkreeftmeijer/vim-numbertoggle](vim-numbertoggle) | Toggles between hybrid and absolute line numbers automatically | -| [https://github.com/junegunn/vim-easy-align](vim-easy-align) | A simple, easy-to-use Vim alignment plugin. | -| [https://github.com/kkoomen/vim-doge](vim-doge) | (Do)cumentation (Ge)nerator 10+ languages books Generate proper code documentation skeletons with a single keypress. zapfire | -| [https://github.com/kyazdani42/nvim-tree.lua](nvim-tree.lua) | A file explorer tree for neovim written in lua | -| [https://github.com/kyazdani42/nvim-web-devicons](nvim-web-devicons) | A lua fork of vim-devicons. This plugin provides the same icons as well as colors for each icon. | -| [https://github.com/lewis6991/impatient.nvim](impatient.nvim) | Improve startup time for Neovim | -| [https://github.com/liuchengxu/vista.vim](vista.vim) | View and search LSP symbols, tags in Vim/NeoVim. | -| [https://github.com/ludovicchabant/vim-gutentags](vim-gutentags) | management of tags files in. (re)generate tag files as you work. It will even do its best to keep those tag files out of your way too. | -| [https://github.com/lukas-reineke/headlines.nvim](headlines.nvim) | This plugin adds 3 kind of horizontal highlights for text filetypes, like `markdown`, `vimwiki` and `orgmode` | -| [https://github.com/luochen1990/rainbow](rainbow) | Rainbow Parentheses Improved, shorter code, no level limit, smooth and fast, powerful configuration. | -| [https://github.com/marko-cerovac/material.nvim](material.nvim) | Material colorscheme for NeoVim written in Lua with built-in support for native LSP, TreeSitter and many more plugins | -| [https://github.com/mfussenegger/nvim-dap](nvim-dap) | Debug Adapter Protocol client implementation for Neovim (>= 0.5) | -| [https://github.com/mg979/vim-visual-multi](vim-visual-multi) | Multiple cursors plugin for vim/neovim | -| [https://github.com/michaelb/sniprun](sniprun) | A neovim plugin to run lines/blocs of code (independently of the rest of the file), supporting multiples languages | -| [https://github.com/neoclide/jsonc.vim](jsonc.vim) | jsonc syntax support for vim (Pending) | -| [https://github.com/neovim/nvim-lspconfig](nvim-lspconfig) | Quickstart configurations for the Nvim LSP client | -| [https://github.com/nvim-lua/plenary.nvim](plenary.nvim) | plenary: full; complete; entire; absolute; unqualified. All the lua functions I don't want to write twice. (telescope) | -| [https://github.com/nvim-lua/popup.nvim](popup.nvim) | [WIP] An implementation of the Popup API from vim in Neovim. Hope to upstream when complete(telescope) | -| [https://github.com/nvim-telescope/telescope-dap.nvim](telescope-dap.nvim) | Integration for nvim-dap with telescope.nvim | -| [https://github.com/nvim-telescope/telescope-github.nvim](telescope-github.nvim) | Integration with github cli (telescope) | -| [https://github.com/nvim-telescope/telescope-media-files.nvim](telescope-media-files.nvim) | Telescope extension to preview media files using Ueberzug. (telescope) | -| [https://github.com/nvim-telescope/telescope.nvim](telescope.nvim) | highly extendable fuzzy finder over lists. Telescope is centered around modularity, allowing for easy customization. | -| [https://github.com/nvim-treesitter/nvim-treesitter](nvim-treesitter) | Provides a simple and easy way to use the interface for tree-sitter in Neovim and to provide some basic functionality such as highlighting based on it: | -| [https://github.com/onsails/lspkind-nvim](lspkind-nvim) | vscode-like pictograms for neovim lsp completion items | -| [https://github.com/petrbroz/vim-glsl](vim-glsl) | syntax highlighting or code folding for standard OpenGL ES 1.0 shaders, and for additional directives used in three.js (for example, #include). | -| [https://github.com/preservim/nerdcommenter](nerdcommenter) | Comment functions so powerful—no comment necessary. | -| [https://github.com/rcarriga/nvim-dap-ui](nvim-dap-ui) | A UI for nvim-dap | -| [https://github.com/rcarriga/nvim-notify](nvim-notify) | A fancy, configurable, notification manager for NeoVim | -| [https://github.com/romainl/vim-cool](vim-cool) | Vim-cool disables search highlighting when you are done searching and re-enables it when you search again | -| [https://github.com/sbdchd/neoformat](neoformat) | sparkles A (Neo)vim plugin for formatting code. | -| [https://github.com/simnalamburt/vim-mundo](vim-mundo) | Graph your Vim undo tree in style. | -| [https://github.com/skywind3000/asyncrun.vim](asyncrun.vim) | rocket Run Async Shell Commands in Vim 8.0 / NeoVim and Output to the Quickfix Window !! | -| [https://github.com/sudormrfbin/cheatsheet.nvim](cheatsheet.nvim) | cheatsheet for nvim using Telescope. command autofill, bundled cheats for the editor, plugins, nerd-fonts, etc because hoomans suck at remembering stuff: | -| [https://github.com/theHamsta/nvim-dap-virtual-text](nvim-dap-virtual-text) | This plugin adds virtual text support to nvim-dap. nvim-treesitter is used to find variable definitions. | -| [https://github.com/tikhomirov/vim-glsl](vim-glsl) | Vim syntax highlighting for OpenGL Shading Language | -| [https://github.com/tpope/vim-fugitive](vim-fugitive) | A Git wrapper so awesome, it should be illegal | -| [https://github.com/tpope/vim-repeat](vim-repeat) | repeat.vim: enable repeating supported plugin maps with "." | -| [https://github.com/tpope/vim-speeddating](vim-speeddating) | use CTRL-A/CTRL-X to increment dates, times, and more | -| [https://github.com/tpope/vim-surround](vim-surround) | parentheses,brackets,quotes,XML tags, and more. mappings to easily delete, change and add such surroundings in pairs. | -| [https://github.com/voldikss/vim-floaterm](vim-floaterm) | star2 Terminal manager for (neo)vim | -| [https://github.com/wakatime/wakatime](wakatime) | wakatime for progress tracking | -| [https://github.com/wbthomason/packer.nvim](packer.nvim) | use-package inspired plugin manager for nvim. Uses native packages, supports Luarocks dependencies, written in Lua, allows for expressive config | -| [https://github.com/windwp/nvim-autopairs](nvim-autopairs) | autopairs for neovim written by lua | +# Nvim Config + +## Extensions + +|-|-| +| Extension | Description | +|-|-| +| [https://github.com/lewis6991/impatient.nvim](lewis6991/impatient.nvim) | Improve startup time for Neovim | +| [https://github.com/marko-cerovac/material.nvim](marko-cerovac/material.nvim) | :trident: Material colorscheme for NeoVim written in Lua with built-in support for native LSP, TreeSitter and many more plugins | +| [https://github.com/stevearc/dressing.nvim](stevearc/dressing.nvim) | Neovim plugin to improve the default vim.ui interfaces | +| [https://github.com/airblade/vim-gitgutter](airblade/vim-gitgutter) | A Vim plugin which shows git diff markers in the sign column and stages/previews/undoes hunks and partial hunks. | +| [https://github.com/ap/vim-css-color](ap/vim-css-color) | Preview colours in source code while editing | +| [https://github.com/chaoren/vim-wordmotion](chaoren/vim-wordmotion) | More useful word motions for Vim | +| [https://github.com/itchyny/vim-cursorword](itchyny/vim-cursorword) | Underlines the word under the cursor | +| [https://github.com/mg979/vim-visual-multi](mg979/vim-visual-multi) | Multiple cursors plugin for vim/neovim | +| [https://github.com/rcarriga/nvim-notify](rcarriga/nvim-notify) | A fancy, configurable, notification manager for NeoVim | +| [https://github.com/romainl/vim-cool](romainl/vim-cool) | A very simple plugin that makes hlsearch more useful. | +| [https://github.com/tpope/vim-repeat](tpope/vim-repeat) | repeat.vim: enable repeating supported plugin maps with "." | +| [https://github.com/windwp/nvim-autopairs](windwp/nvim-autopairs) | autopairs for neovim written by lua | +| [https://github.com/kylechui/nvim-surround](kylechui/nvim-surround) | Add/change/delete surrounding delimiter pairs with ease. Written with :heart: in Lua. | +| [https://github.com/chentoast/marks.nvim](chentoast/marks.nvim) | A better user experience for viewing and interacting with Vim marks. | +| [https://github.com/folke/todo-comments.nvim](folke/todo-comments.nvim) | ✅ Highlight, list and search todo comments in your projects | +| [https://github.com/Iron-E/nvim-libmodal](Iron-E/nvim-libmodal) | Create new "modes" for Neovim! | +| [https://github.com/junegunn/vim-easy-align](junegunn/vim-easy-align) | :sunflower: A Vim alignment plugin | +| [https://github.com/mbbill/undotree](mbbill/undotree) | The undo history visualizer for VIM | +| [https://github.com/preservim/nerdcommenter](preservim/nerdcommenter) | Vim plugin for intensely nerdy commenting powers | +| [https://github.com/sbdchd/neoformat](sbdchd/neoformat) | :sparkles: A (Neo)vim plugin for formatting code. | +| [https://github.com/ludovicchabant/vim-gutentags](ludovicchabant/vim-gutentags) | A Vim plugin that manages your tag files | +| [https://github.com/andymass/vim-matchup](andymass/vim-matchup) | vim match-up: even better % :facepunch: navigate and highlight matching words :facepunch: modern matchit and matchparen. Supports both vim and neovim + tree-sitter. | +| [https://github.com/nvim-tree/nvim-web-devicons](nvim-tree/nvim-web-devicons) | lua `fork` of vim-web-devicons for neovim | +| [https://github.com/akinsho/bufferline.nvim](akinsho/bufferline.nvim) | A snazzy bufferline for Neovim | +| [https://github.com/nvim-lualine/lualine.nvim](nvim-lualine/lualine.nvim) | A blazing fast and easy to configure neovim statusline plugin written in pure lua. | +| [https://github.com/glepnir/dashboard-nvim](glepnir/dashboard-nvim) | vim dashboard | +| [https://github.com/nvim-telescope/telescope.nvim](nvim-telescope/telescope.nvim) | Find, Filter, Preview, Pick. All lua, all the time. | +| [https://github.com/nvim-lua/plenary.nvim](nvim-lua/plenary.nvim) | plenary: full; complete; entire; absolute; unqualified. All the lua functions I don't want to write twice. | +| [https://github.com/nvim-orgmode/orgmode](nvim-orgmode/orgmode) | Orgmode clone written in Lua for Neovim 0.7+. | +| [https://github.com/mrjones2014/nvim-ts-rainbow](mrjones2014/nvim-ts-rainbow) | Rainbow parentheses for neovim using tree-sitter. | +| [https://github.com/nvim-treesitter/nvim-treesitter](nvim-treesitter/nvim-treesitter) | Nvim Treesitter configurations and abstraction layer | +| [https://github.com/lukas-reineke/indent-blankline.nvim](lukas-reineke/indent-blankline.nvim) | Indent guides for Neovim | +| [https://github.com/nvim-treesitter/nvim-treesitter-textobjects](nvim-treesitter/nvim-treesitter-textobjects) | null | +| [https://github.com/nvim-treesitter/playground](nvim-treesitter/playground) | Treesitter playground integrated into Neovim | +| [https://github.com/hrsh7th/nvim-cmp](hrsh7th/nvim-cmp) | A completion plugin for neovim coded in Lua. | +| [https://github.com/hrsh7th/cmp-nvim-lsp](hrsh7th/cmp-nvim-lsp) | nvim-cmp source for neovim builtin LSP client | +| [https://github.com/quangnguyen30192/cmp-nvim-tags](quangnguyen30192/cmp-nvim-tags) | tags sources for nvim-cmp | +| [https://github.com/hrsh7th/cmp-buffer](hrsh7th/cmp-buffer) | nvim-cmp source for buffer words | +| [https://github.com/hrsh7th/cmp-path](hrsh7th/cmp-path) | nvim-cmp source for path | +| [https://github.com/hrsh7th/cmp-cmdline](hrsh7th/cmp-cmdline) | nvim-cmp source for vim's cmdline | +| [https://github.com/hrsh7th/vim-vsnip](hrsh7th/vim-vsnip) | Snippet plugin for vim/nvim that supports LSP/VSCode's snippet format. | +| [https://github.com/hrsh7th/cmp-vsnip](hrsh7th/cmp-vsnip) | nvim-cmp source for vim-vsnip | +| [https://github.com/neovim/nvim-lspconfig](neovim/nvim-lspconfig) | Quickstart configs for Nvim LSP | +| [https://github.com/j-hui/fidget.nvim](j-hui/fidget.nvim) | Standalone UI for nvim-lsp progress | +| [https://github.com/kevinhwang91/nvim-ufo](kevinhwang91/nvim-ufo) | Not UFO in the sky, but an ultra fold in Neovim. | +| [https://github.com/kevinhwang91/promise-async](kevinhwang91/promise-async) | Promise & Async in Lua | +| [https://github.com/folke/neodev.nvim](folke/neodev.nvim) | 💻 Neovim setup for init.lua and plugin development with full signature help, docs and completion for the nvim lua API. | +| [https://github.com/p00f/clangd_extensions.nvim](p00f/clangd_extensions.nvim) | Clangd's off-spec features for neovim's LSP client. Use https://sr.ht/~p00f/clangd_extensions.nvim instead | +| [https://github.com/simrat39/rust-tools.nvim](simrat39/rust-tools.nvim) | Tools for better development in rust using neovim's builtin lsp | +| [https://github.com/b0o/SchemaStore.nvim](b0o/SchemaStore.nvim) | 🛍 JSON schemas for Neovim | +| [https://github.com/mfussenegger/nvim-dap](mfussenegger/nvim-dap) | Debug Adapter Protocol client implementation for Neovim | +| [https://github.com/rcarriga/nvim-dap-ui](rcarriga/nvim-dap-ui) | A UI for nvim-dap | +| [https://github.com/kkoomen/vim-doge](kkoomen/vim-doge) | (Do)cumentation (Ge)nerator 10+ languages 📚 Generate proper code documentation skeletons with a single keypress. ⚡️🔥 | +| [https://github.com/ThePrimeagen/refactoring.nvim](ThePrimeagen/refactoring.nvim) | The Refactoring library based off the Refactoring book by Martin Fowler | +| [https://github.com/wakatime/vim-wakatime](wakatime/vim-wakatime) | Vim plugin for automatic time tracking and metrics generated from your programming activity. | +| [https://github.com/folke/which-key.nvim](folke/which-key.nvim) | 💥 Create key bindings that stick. WhichKey is a lua plugin for Neovim 0.5 that displays a popup with possible keybindings of the command you started typing. | +| [https://github.com/Eandrju/cellular-automaton.nvim](Eandrju/cellular-automaton.nvim) | A useless plugin that might help you cope with stubbornly broken tests or overall lack of sense in life. It lets you execute aesthetically pleasing, cellular automaton animations based on the content of neovim buffer. | + +## Future +https://github.com/nullchilly/CatNvim +https://github.com/noib3/nvim-oxi diff --git a/TODO.md b/TODO.md index 394e14e..cc618d0 100644 --- a/TODO.md +++ b/TODO.md @@ -1,89 +1,2 @@ -sound effects on events like opera gx (lua sound module) - -https://github.com/ThePrimeagen/refactoring.nvim/blob/master/lua/refactoring/query.lua -https://tree-sitter.github.io/tree-sitter/using-parsers#query-syntax -https://tree-sitter.github.io/tree-sitter/playground -https://github.com/nvim-treesitter/nvim-treesitter#extra-features -https://github.com/nvim-treesitter/nvim-treesitter/blob/master/doc/nvim-treesitter.txt -https://github.com/nvim-treesitter/nvim-treesitter#available-modules -https://github.com/ThePrimeagen/harpoon -https://github.com/romgrk/nvim-treesitter-context -https://github.com/theHamsta/nvim-treesitter-pairs - -https://github.com/milisims/tree-sitter-org -https://github.com/kristijanhusak/orgmode.nvim -https://github.com/dhruvasagar/vim-table-mode -https://github.com/lukas-reineke/headlines.nvim -https://github.com/michaelb/sniprun -https://github.com/meain/vim-printer -https://github.com/rlch/github-notifications.nvim -https://github.com/rcarriga/nvim-notify - - - -Vim Grammar -Using vim is like talking to your editor in number verb modifier object sentences, turned into acronyms - -Number -Enter nonzero number before the command, to repeat the command number times. - -Verbs -key function verb form -v visual select transitive -c change, enter insert mode transitive -d delete transitive -y yank / copy transitive -x delete char non-transitive -i insert, enter insert mode, before the cursor non-transitive -a append, enter insert mode, after the cursor non-transitive -p paste non-transitive -n N find next/previous search results of / or ? non-transitive -Modifiers -key function -i inside -a around -t till find a character, not including the character -f find a character, including the character -/ search downwards, find a string or regex -? search upwards, find a string or regex -Objects -key function -w word -s sentence -b block / parentheses -p paragraph -t tag, for html/xml tags -G go to the last line -number G go to the number line -g g go to the first line, the same as 1 G -0 number 0, to the first character of current line -$ to the last character of current line -Examples -Key -key sequence (command mode) function -x delete the current character -p paste -Number + Key -key sequence (command mode) function -8 x delete the next 8 characters -2 j move down the cursor by 2 lines -Key + Object -key sequence (command mode) function -d w delete to the end of the (next) word -c w delete to the end of the (next) word, enter insert mode -Key + Modifier + Object -key sequence (command mode) function -d i w delete the current word -c i w change the word, enters insert mode -c i s change current sentence -c i " change inside " " -c i { change inside { } -c / f o o change until next occurrence of foo -c t 8 change everything from here until number 8 -c f 8 like above, but also remove the number -c a p change the current paragraph -v a p visually select this paragraph - -Verbs -https://riptutorial.com/vim/example/27570/using--verbs--and--nouns--for-text-editing -https://www.technblogy.com/2019/11/20/programming-in-vim-number-verbs-modifiers-objects-concept/ +[ ] Fix refactoring.nvim +[ ] Fix nvim-treesitter-textobjects diff --git a/init.lua b/init.lua index 151ad4e..b339921 100644 --- a/init.lua +++ b/init.lua @@ -1,11 +1,7 @@ require("utils") -require("plugins") -require("packer_compiled") -require("personal") +Prequire("config") -require("commands") -require("keybinds") -require("settings") +Prequire("plugins") -require("config.neovide") +Prequire("etc") diff --git a/install.sh b/install.sh deleted file mode 100755 index 0d37e42..0000000 --- a/install.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/env bash -paru -S clang cmake ccls ripgrep ttf-fira-code ctags ueberzug ffmpegthumbnailer poppler fontpreview fmui-git shfmt glsl-language-server - -python3 -m pip install pynvim cmakelang cmake-language-server black-but-with-tabs-instead-of-spaces -python2 -m pip install pynvim - -pnpm -g install neovim pyright stylelint-lsp svelte-language-server typescript-language-server bash-language-server vim-language-server yaml-language-server vscode-langservers-extracted - -ln -s ~/.config/nvim/dotfiles/.ccls ~/.ccls -ln -s ~/.config/nvim/dotfiles/.clang-format ~/.clang-format -ln -s ~/.config/nvim/dotfiles/.cmake-format ~/.cmake-format -ln -s ~/.config/nvim/dotfiles/.ctags ~/.ctags -ln -s ~/.config/nvim/dotfiles/.eslintrc ~/.eslintrc -ln -s ~/.config/nvim/dotfiles/.lua-format ~/.lua-format -ln -s ~/.config/nvim/dotfiles/.prettierrc ~/.prettierrc -ln -s ~/.config/nvim/dotfiles/.pylintrc ~/.pylintrc -ln -s ~/.config/nvim/dotfiles/.rgignore ~/.rgignore - diff --git a/lazy-lock.json b/lazy-lock.json new file mode 100644 index 0000000..60acfdf --- /dev/null +++ b/lazy-lock.json @@ -0,0 +1,16 @@ +{ + "SchemaStore.nvim": { "branch": "main", "commit": "fd5ddd82b13b52b72f887e2c0f2784d82381951d" }, + "bufferline.nvim": { "branch": "main", "commit": "c7492a76ce8218e3335f027af44930576b561013" }, + "cellular-automaton.nvim": { "branch": "main", "commit": "679943b8e1e5ef79aaeeaf4b00782c52eb4e928f" }, + "clangd_extensions.nvim": { "branch": "main", "commit": "a5c3c8390dfb342d630bdc25941a4d8f433510be" }, + "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, + "cmp-cmdline": { "branch": "main", "commit": "23c51b2a3c00f6abc4e922dbd7c3b9aca6992063" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "0e6b2ed705ddcff9738ec4ea838141654f12eeef" }, + "cmp-nvim-tags": { "branch": "main", "commit": "de630ce773d249ab5739405a3428a5a29d7e0076" }, + "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, + "cmp-vsnip": { "branch": "main", "commit": "989a8a73c44e926199bfd05fa7a516d51f2d2752" }, + "dashboard-nvim": { "branch": "master", "commit": "084e5561dd9db710cd33741db5def738425c7a86" }, + "dressing.nvim": { "branch": "master", "commit": "db716a0f1279f79a886c0e0b6ab3c3d5ffdb42fe" }, + "fidget.nvim": { "branch": "main", "commit": "9dc6d15fdb877b2fb09ea0ba2dfde9beccb5965a" }, + "impatient.nvim": { "branch": "main", "commit": "c90e273f7b8c50a02f956c24ce4804a47f18162e" }, + "indent-blankline.nvim": { "branch": "master", "commit": "8299fe7703dfff4b1752aeed271c3b95281a952d" }, diff --git a/lua/.luarc.json b/lua/.luarc.json deleted file mode 100644 index 874102d..0000000 --- a/lua/.luarc.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json", - "Lua.workspace.library": [ - "/home/shawn/.config/nvim", - "/etc/xdg/nvim", - "/home/shawn/.local/share/nvim/site", - "/home/shawn/.local/share/nvim/site/pack/packer/start/FixCursorHold.nvim", - "/home/shawn/.local/share/nvim/site/pack/packer/start/asyncrun.vim", - "/home/shawn/.local/share/nvim/site/pack/packer/start/bufferline.nvim", - "/home/shawn/.local/share/nvim/site/pack/packer/start/cheat.sh-vim", - "/home/shawn/.local/share/nvim/site/pack/packer/start/cheatsheet.nvim", - "/home/shawn/.local/share/nvim/site/pack/packer/start/cmp-buffer", - "/home/shawn/.local/share/nvim/site/pack/packer/start/cmp-cmdline", - "/home/shawn/.local/share/nvim/site/pack/packer/start/cmp-emoji", - "/home/shawn/.local/share/nvim/site/pack/packer/start/cmp-greek", - "/home/shawn/.local/share/nvim/site/pack/packer/start/cmp-nvim-lsp", - "/home/shawn/.local/share/nvim/site/pack/packer/start/cmp-path", - "/home/shawn/.local/share/nvim/site/pack/packer/start/cmp-treesitter", - "/home/shawn/.local/share/nvim/site/pack/packer/start/cmp-vsnip", - "/home/shawn/.local/share/nvim/site/pack/packer/start/dashboard-nvim", - "/home/shawn/.local/share/nvim/site/pack/packer/start/echodoc.vim", - "/home/shawn/.local/share/nvim/site/pack/packer/start/firenvim", - "/home/shawn/.local/share/nvim/site/pack/packer/start/headlines.nvim", - "/home/shawn/.local/share/nvim/site/pack/packer/start/impatient.nvim", - "/home/shawn/.local/share/nvim/site/pack/packer/start/incsearch-easymotion.vim", - "/home/shawn/.local/share/nvim/site/pack/packer/start/incsearch-fuzzy.vim", - "/home/shawn/.local/share/nvim/site/pack/packer/start/incsearch.vim", - "/home/shawn/.local/share/nvim/site/pack/packer/start/indentLine", - "/home/shawn/.local/share/nvim/site/pack/packer/start/lspkind-nvim", - "/home/shawn/.local/share/nvim/site/pack/packer/start/lualine.nvim", - "/home/shawn/.local/share/nvim/site/pack/packer/start/material.nvim", - "/home/shawn/.local/share/nvim/site/pack/packer/start/neoformat", - "/home/shawn/.local/share/nvim/site/pack/packer/start/nerdcommenter", - "/home/shawn/.local/share/nvim/site/pack/packer/start/nvim-autopairs", - "/home/shawn/.local/share/nvim/site/pack/packer/start/nvim-cmp", - "/home/shawn/.local/share/nvim/site/pack/packer/start/nvim-dap", - "/home/shawn/.local/share/nvim/site/pack/packer/start/nvim-dap-ui", - "/home/shawn/.local/share/nvim/site/pack/packer/start/nvim-dap-virtual-text", - "/home/shawn/.local/share/nvim/site/pack/packer/start/nvim-libmodal", - "/home/shawn/.local/share/nvim/site/pack/packer/start/nvim-lsputils", - "/home/shawn/.local/share/nvim/site/pack/packer/start/nvim-notify", - "/home/shawn/.local/share/nvim/site/pack/packer/start/nvim-tree.lua", - "/home/shawn/.local/share/nvim/site/pack/packer/start/nvim-web-devicons", - "/home/shawn/.local/share/nvim/site/pack/packer/start/one-small-step-for-vimkind", - "/home/shawn/.local/share/nvim/site/pack/packer/start/org-bullets.nvim", - "/home/shawn/.local/share/nvim/site/pack/packer/start/packer.nvim", - "/home/shawn/.local/share/nvim/site/pack/packer/start/plenary.nvim", - "/home/shawn/.local/share/nvim/site/pack/packer/start/popfix", - "/home/shawn/.local/share/nvim/site/pack/packer/start/popup.nvim", - "/home/shawn/.local/share/nvim/site/pack/packer/start/presence.nvim", - "/home/shawn/.local/share/nvim/site/pack/packer/start/rainbow", - "/home/shawn/.local/share/nvim/site/pack/packer/start/sniprun", - "/home/shawn/.local/share/nvim/site/pack/packer/start/telescope-dap.nvim", - "/home/shawn/.local/share/nvim/site/pack/packer/start/telescope-github.nvim", - "/home/shawn/.local/share/nvim/site/pack/packer/start/telescope-media-files.nvim", - "/home/shawn/.local/share/nvim/site/pack/packer/start/telescope.nvim", - "/home/shawn/.local/share/nvim/site/pack/packer/start/todo-comments.nvim", - "/home/shawn/.local/share/nvim/site/pack/packer/start/vim-cool", - "/home/shawn/.local/share/nvim/site/pack/packer/start/vim-css-color", - "/home/shawn/.local/share/nvim/site/pack/packer/start/vim-cursorword", - "/home/shawn/.local/share/nvim/site/pack/packer/start/vim-easy-align", - "/home/shawn/.local/share/nvim/site/pack/packer/start/vim-easymotion", - "/home/shawn/.local/share/nvim/site/pack/packer/start/vim-floaterm", - "/home/shawn/.local/share/nvim/site/pack/packer/start/vim-fugitive", - "/home/shawn/.local/share/nvim/site/pack/packer/start/vim-gitgutter", - "/home/shawn/.local/share/nvim/site/pack/packer/start/vim-gutentags", - "/home/shawn/.local/share/nvim/site/pack/packer/start/vim-matchup", - "/home/shawn/.local/share/nvim/site/pack/packer/start/vim-mundo", - "/home/shawn/.local/share/nvim/site/pack/packer/start/vim-numbertoggle", - "/home/shawn/.local/share/nvim/site/pack/packer/start/vim-repeat", - "/home/shawn/.local/share/nvim/site/pack/packer/start/vim-speeddating", - "/home/shawn/.local/share/nvim/site/pack/packer/start/vim-surround", - "/home/shawn/.local/share/nvim/site/pack/packer/start/vim-table-mode", - "/home/shawn/.local/share/nvim/site/pack/packer/start/vim-visual-multi", - "/home/shawn/.local/share/nvim/site/pack/packer/start/vim-vsnip", - "/home/shawn/.local/share/nvim/site/pack/packer/start/vim-wakatime", - "/home/shawn/.local/share/nvim/site/pack/packer/start/vim-wordmotion", - "/home/shawn/.local/share/nvim/site/pack/packer/start/vista.vim", - "/home/shawn/.local/share/nvim/site/pack/packer/start/which-key.nvim", - "/home/shawn/.local/share/nvim/site/pack/packer/opt/nvim-treesitter", - "/home/shawn/.local/share/nvim/site/pack/packer/opt/dap-buddy.nvim", - "/home/shawn/.local/share/nvim/site/pack/packer/opt/nvim-luadev", - "/home/shawn/.local/share/nvim/site/pack/packer/opt/nvim-lspconfig", - "/usr/share/nvim/runtime", - "/usr/share/nvim/runtime/pack/dist/opt/matchit", - "/usr/lib/nvim", - "/home/shawn/.local/share/nvim/site/pack/packer/start/cmp-buffer/after", - "/home/shawn/.local/share/nvim/site/pack/packer/start/cmp-cmdline/after", - "/home/shawn/.local/share/nvim/site/pack/packer/start/cmp-emoji/after", - "/home/shawn/.local/share/nvim/site/pack/packer/start/cmp-nvim-lsp/after", - "/home/shawn/.local/share/nvim/site/pack/packer/start/cmp-path/after", - "/home/shawn/.local/share/nvim/site/pack/packer/start/cmp-treesitter/after", - "/home/shawn/.local/share/nvim/site/pack/packer/start/cmp-vsnip/after", - "/home/shawn/.local/share/nvim/site/pack/packer/start/indentLine/after", - "/home/shawn/.local/share/nvim/site/pack/packer/start/vim-css-color/after", - "/home/shawn/.local/share/nvim/site/pack/packer/start/vim-matchup/after", - "/usr/share/vim/vimfiles", - "${3rd}/luassert/library" - ] -} \ No newline at end of file diff --git a/lua/commands.lua b/lua/commands.lua deleted file mode 100644 index 39ecea5..0000000 --- a/lua/commands.lua +++ /dev/null @@ -1,96 +0,0 @@ --- vim.cmd("source $HOME/.config/nvim/vimscript/commands.vim"): - -vim.api.nvim_create_autocmd({ "TextYankPost" }, { - pattern = "*", - callback = function() - vim.highlight.on_yank({ on_visual = false }) - end, -}) - -local wrap_format_stop_blocks = { - { "lua", "-- stylua: ignore start", "-- stylua: ignore end" }, - { "python", "# fmt: off", "# fmt: on" }, - { { "haskell", "lhaskell" }, "{- ORMOLU_DISABLE -}", "{- ORMOLU_ENABLE -}" }, - { { "cpp", "c" }, "// clang-format off", "// clang-format on" }, -} - -local top_format_stop_blocks = { - { - { - "js", - "ts", - "tsx", - "jsx", - "vue", - "json", - "svelte", - "javascript", - "typescript", - "javascriptreact", - "typescriptreact", - }, - "// prettier-ignore", - }, - { "rust", "#[rustfmt::skip]" }, -} - -function add_wrap_format_stop_block(filetypes, start, stop) - filetypes = type(filetypes) == "table" and filetypes or { filetypes } - - vim.api.nvim_create_autocmd("Filetype", { - pattern = filetypes, - callback = function(tbl) - vim.keymap.set( - "v", - "fo", - "vnoremap fo `>a" .. stop .. "`", - { buffer = tbl.buf } - ) - end, - }) - - vim.api.nvim_create_autocmd("Filetype", { - pattern = filetypes, - callback = function(tbl) - vim.keymap.set("n", "fo", "{o" .. start .. "}O" .. stop .. "", { buffer = tbl.buf }) - end, - }) -end - -function add_top_format_stop_block(filetypes, top) - filetypes = type(filetypes) == "table" and filetypes or { filetypes } - - vim.api.nvim_create_autocmd("Filetype", { - pattern = filetypes, - callback = function(tbl) - vim.keymap.set( - "v", - "fo", - "`", - { buffer = tbl.buf } - ) - end, - }) - - vim.api.nvim_create_autocmd("Filetype", { - pattern = filetypes, - callback = function(tbl) - vim.keymap.set( - "n", - "fo", - "{o" .. top .. "", - { buffer = tbl.buf } - ) - end, - }) -end - -for _, wrap_format_stop_block in ipairs(wrap_format_stop_blocks) do - -- PrintTable(wrap_format_stop_block) - add_wrap_format_stop_block(wrap_format_stop_block[1], wrap_format_stop_block[2], wrap_format_stop_block[3]) -end - -for _, top_format_stop_block in ipairs(top_format_stop_blocks) do - -- PrintTable(top_format_stop_block) - add_top_format_stop_block(top_format_stop_block[1], top_format_stop_block[2]) -end diff --git a/lua/config/autocmds.lua b/lua/config/autocmds.lua new file mode 100644 index 0000000..8b7bb36 --- /dev/null +++ b/lua/config/autocmds.lua @@ -0,0 +1,114 @@ +-- assumes set ignorecase smartcase; +vim.api.nvim_create_autocmd("CmdLineEnter", { + pattern = { ":" }, + group = vim.api.nvim_create_augroup("dynamic_smartcase", {}), + callback = function() + vim.o.smartcase = false + end, +}) + +vim.api.nvim_create_autocmd("CmdLineLeave", { + pattern = { ":" }, + group = vim.api.nvim_create_augroup("dynamic_smartcase", {}), + callback = function() + vim.o.smartcase = true + end, +}) + +vim.api.nvim_create_autocmd({ "BufWritePre" }, { + pattern = "*", + callback = function() + vim.fn.mkdir(vim.fn.expand(":p:h"), "p") + end, +}) + +-- Numbers +vim.api.nvim_create_autocmd({ "BufEnter", "FocusGained", "InsertLeave", "WinEnter" }, { + pattern = "*", + callback = function() + if vim.opt.nu and vim.fn.mode() ~= "i" then + vim.opt.rnu = true + end + end, +}) +vim.api.nvim_create_autocmd({ "BufLeave", "FocusLost", "InsertEnter", "WinLeave" }, { + pattern = "*", + callback = function() + if vim.opt.nu then + vim.opt.rnu = false + end + end, +}) + +vim.api.nvim_create_autocmd({ "TextYankPost" }, { + pattern = "*", + callback = function() + vim.highlight.on_yank({ on_visual = false }) + end, +}) + +local function set_filetype(pattern, filetype) + vim.api.nvim_create_autocmd({ "BufNewFile", "BufRead" }, { + pattern = pattern, + callback = function() + vim.o.filetype = filetype + end, + }) +end + +local function create_source_binding(pattern, callback, group) + pattern = pattern or { "*" } + callback = callback or function() end + group = group or RandStr(10) + + vim.api.nvim_create_autocmd("BufEnter", { + pattern = pattern, + group = vim.api.nvim_create_augroup(group, { clear = true }), + callback = function(tbl) + local notify = Prequire("notify") + vim.keymap.set(Keys.N, "sf", function() + callback(tbl) + if notify ~= nil then + notify( + "Sourced file '" .. vim.fn.expand("%") .. "'", + "info", + { title = IDE.name .. " : " .. group } + ) + else + print("Sourced file '" .. vim.fn.expand("%") .. "'") + end + end, { silent = true, buffer = tbl.buf }) + end, + }) +end + +set_filetype("*/xmobarrc", "haskell") +set_filetype("*.yuck", "yuck") +set_filetype("*.keys", "keys") +set_filetype({ "*.shader", "*.frag", "*.vert" }, "glsl") +set_filetype({ "*.json", "*/waybar/config" }, "jsonc") +set_filetype("*/hypr/**/*.conf", "hypr") +set_filetype("*/sway/*.conf", "swayconfig") + +create_source_binding({ "*.vim", "*.lua" }, function() + vim.cmd.source({ args = { vim.fn.expand("%") } }) +end, "SourceVimscriptLua") +create_source_binding({ "*/config/sxhkd/**" }, function() + vim.fn.jobstart({ + "sh", + "-c", + '"killall -9 sxhkd ; sxhkd -c ' .. vim.fn.expand("%") .. ' & disown"' + }) +end, "SourceSxhkd") +create_source_binding({ "*config/xmobar/**" }, function() + vim.fn.jobstart({ "sh", "-c", '"killall -9 xmobar ; xmobar & disown"' }) +end, "SourceXmobar") +create_source_binding({ "*config/tmux/**" }, function() + vim.fn.jobstart({ "tmux", "source", vim.fn.expand("%") }) +end, "SourceTmux") +create_source_binding({ "*.cpp" }, function() + vim.cmd("!runcpp " .. vim.fn.expand("%")) +end, "SourceCpp") +create_source_binding({ "*/waybar/**/*.*" }, function() + vim.fn.jobstart({ "sh", "-c", "'!killall -9 waybar ; waybar & disown'" }) +end, "SourceWaybar") diff --git a/lua/config/autopairs.lua b/lua/config/autopairs.lua deleted file mode 100644 index aac4f2a..0000000 --- a/lua/config/autopairs.lua +++ /dev/null @@ -1,83 +0,0 @@ -require("nvim-autopairs").setup { - disable_filetype = {"TelescopePrompt"}, - ignored_next_char = string.gsub([[ [%w%%%'%[%"%.] ]], "%s+", ""), - enable_moveright = true, - enable_afterquote = true, - -- add bracket pairs after quote, - enable_check_bracket_line = true -} - -local Rule = require("nvim-autopairs.rule") -local npairs = require("nvim-autopairs") - -npairs.add_rule(Rule("$$", "$$", "tex")) - --- you can use some built-in condition - -local cond = require("nvim-autopairs.conds") ---print(vim.inspect(cond)) - -npairs.add_rules( - { - Rule("$", "$", {"tex", "latex"}):with_pair(cond.not_after_regex_check("%%")):with_pair( - -- don't add a pair if the next character is % - -- don't add a pair if the previous character is xxx - cond.not_before_regex_check("xxx", 3) - ):with_move(cond.none()):with_del(cond.not_after_regex_check("xx")):with_cr(cond.none()) - -- don't move right when repeat character - -- don't delete if the next character is xx - -- disable add newline when press - } -) - -npairs.add_rules( - { - Rule("$$", "$$", "tex"):with_pair( - function(opts) - print(vim.inspect(opts)) - if opts.line == "aa $$" then - -- don't add pair on that line - return false - end - end - ) - } -) - --- you can use regex --- press u1234 => u1234number -npairs.add_rules( - { - Rule("u%d%d%d%d$", "number", "lua"):use_regex(true) - } -) - --- press x1234 => x12341234 -npairs.add_rules( - { - Rule("x%d%d%d%d$", "number", "lua"):use_regex(true):replace_endpair( - function(opts) - -- print(vim.inspect(opts)) - return opts.prev_char:sub(#opts.prev_char - 3, #opts.prev_char) - end - ) - } -) - --- you can do anything with regex +special key --- example press tab will upper text --- press b1234s => B1234S1234S - -npairs.add_rules( - { - Rule("b%d%d%d%d%w$", "", "vim"):use_regex(true, ""):replace_endpair( - function(opts) - return opts.prev_char:sub(#opts.prev_char - 4, #opts.prev_char) .. "viwU" - end - ) - } -) - --- you can exclude filetypes -npairs.add_rule(Rule("$$", "$$"):with_pair(cond.not_filetypes({"lua"}))) ---- check ./lua/nvim-autopairs/rules/basic.lua diff --git a/lua/config/bindings.lua b/lua/config/bindings.lua new file mode 100644 index 0000000..344c5c8 --- /dev/null +++ b/lua/config/bindings.lua @@ -0,0 +1,147 @@ +vim.g.mapleader = " " +-- stylua: ignore start + +vim.keymap.set(Keys.V, "so", ":sort", Keys.None) +vim.keymap.set(Keys.N, "qa", ":noautocmd qall!", Keys.None) + +vim.keymap.set(Keys.N, "me", ":mes", Keys.None) +vim.keymap.set(Keys.N, "fe", vim.cmd.edit, Keys.None) + +vim.keymap.set(Keys.N, "x+", function() + local filename = vim.fn.expand("%") + vim.fn.jobstart({ "chmod", "+x", filename }) + require( "notify" )("Given execution rights to '" .. filename .. "'", "info", { title = IDE.name }) +end, Keys.None) + +vim.keymap.set(Keys.N, "x-", function() + local filename = vim.fn.expand("%") + vim.fn.jobstart({ "chmod", "-x", filename }) + require("notify")("Taken away execution rights from '" .. filename .. "'", "info", { title = IDE.name }) +end, Keys.None) +-- Buffer +vim.keymap.set(Keys.N, "bp", vim.cmd.bp, Keys.None) +vim.keymap.set(Keys.N, "bn", vim.cmd.bn, Keys.None) +vim.keymap.set(Keys.N, "bd", vim.cmd.bd, Keys.None) +vim.keymap.set(Keys.N, "", vim.cmd.bd, Keys.Noremap) + +vim.keymap.set(Keys.N, "nw", "%s/\\s*$//", Keys.None) + +vim.keymap.set(Keys.N, "`", "edit #", Keys.None) + +vim.keymap.set(Keys.N, "p", "\"_dP", Keys.None) + +vim.keymap.set(Keys.N, "gf", ":e ", Keys.None) + +vim.keymap.set(Keys.N, "", "*:%s//", Keys.None) + +vim.keymap.set(Keys.NoneStr, "", "", Keys.Noremap) -- increament +vim.keymap.set(Keys.NoneStr, "", "", Keys.Noremap) -- decreament + +vim.keymap.set(Keys.N, "L", "$", Keys.None) +vim.keymap.set(Keys.N, "H", "^", Keys.None) +vim.keymap.set(Keys.N, "Q", "", Keys.None) -- Disable visual mode + +vim.keymap.set( + Keys.N, "", + "(col('.') == matchend(getline('.'), '^\\s*')+1 ? '0' : '^')", Keys.NoremapExpr +) +vim.keymap.set( + Keys.N, "", "(col('.') == match(getline('.'), '\\s*$') ? '$' : 'g_')", + Keys.NoremapExpr +) +vim.keymap.set( + Keys.V, "", "(col('.') == match(getline('.'), '\\s*$') ? '$h' : 'g_')", + Keys.NoremapExpr +) +vim.keymap.set(Keys.I, "", "", Keys.None) +vim.keymap.set(Keys.I, " ", "", Keys.None) + +vim.keymap.set(Keys.N, "gg", "gg0", Keys.Noremap) +vim.keymap.set(Keys.NoneStr, "G", "G", Keys.Noremap) +vim.keymap.set(Keys.NoneStr, "Y", "y$", Keys.Noremap) + +vim.keymap.set(Keys.N, "w", "", Keys.Noremap) +vim.keymap.set(Keys.N, "w|", "vsplit", Keys.Noremap) +vim.keymap.set(Keys.N, "w_", "split", Keys.Noremap) + +-- system clipboard +vim.keymap.set(Keys.N, "", "\"+y\"", Keys.Noremap) +vim.keymap.set(Keys.V, "", "\"+y\"", Keys.Noremap) +vim.keymap.set(Keys.N, "", "\"+p\"", Keys.Noremap) +vim.keymap.set(Keys.I, "", "+", Keys.Noremap) +vim.keymap.set(Keys.C, "", "+", Keys.Noremap) + +vim.keymap.set(Keys.N, "", "d", Keys.None) +vim.keymap.set(Keys.I, "", "d", Keys.None) +vim.keymap.set(Keys.C, "", "d", Keys.None) + +-- use to insert original character without triggering things like auto-pairs +vim.keymap.set(Keys.I, "", "", Keys.Noremap) + +vim.keymap.set(Keys.N, "fs", ":w", Keys.Noremap) + +vim.keymap.set(Keys.N, "", "", Keys.Noremap) +vim.keymap.set(Keys.I, "", "", Keys.Noremap) + +vim.keymap.set(Keys.N, Keys.N, "nzzzv", Keys.Noremap) +vim.keymap.set(Keys.N, "N", "Nzzzv", Keys.Noremap) +vim.keymap.set(Keys.N, "J", "mzJ`z", Keys.Noremap) + +vim.keymap.set(Keys.I, ",", ",u", Keys.Noremap) +vim.keymap.set(Keys.I, ".", ".u", Keys.Noremap) +vim.keymap.set(Keys.I, "!", "!u", Keys.Noremap) +vim.keymap.set(Keys.I, "?", "?u", Keys.Noremap) +vim.keymap.set(Keys.I, "[", "[u", Keys.Noremap) +vim.keymap.set(Keys.I, "]", "]u", Keys.Noremap) +vim.keymap.set(Keys.I, "(", "(u", Keys.Noremap) +vim.keymap.set(Keys.I, ")", ")u", Keys.Noremap) +vim.keymap.set(Keys.I, "{", "{u", Keys.Noremap) +vim.keymap.set(Keys.I, "}", "}u", Keys.Noremap) +vim.keymap.set(Keys.I, "\"", "\"u", Keys.Noremap) + +vim.keymap.set( + Keys.N, "k", "(v:count > 5 ? \"m'\" . v:count : \"\") . 'k'", Keys.NoremapExpr +) +vim.keymap.set( + Keys.N, "j", "(v:count > 5 ? \"m'\" . v:count : \"\") . 'j'", Keys.NoremapExpr +) + +vim.keymap.set(Keys.V, "", ":m '>+1gv=gv", Keys.Noremap) +vim.keymap.set(Keys.V, "", ":m '<-2gv=gv", Keys.Noremap) +vim.keymap.set(Keys.N, "", ":m .+1==", Keys.Noremap) +vim.keymap.set(Keys.I, "", ":m .-2==i", Keys.Noremap) +vim.keymap.set(Keys.N, "", ":m .-1==", Keys.Noremap) +vim.keymap.set(Keys.I, "", ":m .+1==i", Keys.Noremap) + +-- Add space bellow or above without leaving normal mode +vim.keymap.set( + Keys.N, "[", ":put!=repeat([''],v:count)']+1", + Keys.NoremapSilent +) +vim.keymap.set( + Keys.N, "]", ":put =repeat([''],v:count)'[-1", + Keys.NoremapSilent +) + +-- Use simple ; instead of shift + : +vim.keymap.set(Keys.N, ";", ":", Keys.Noremap) +vim.keymap.set(Keys.V, ";", ":", Keys.Noremap) + +-- Better tabbing +vim.keymap.set(Keys.N, "<", "v", Keys.Noremap) +vim.keymap.set(Keys.N, ">", "v>gv", Keys.Noremap) +vim.keymap.set(Keys.V, "<", "", ">gv", Keys.Noremap) + +vim.keymap.set(Keys.V, "`", "`>a``", Keys.Noremap) + +vim.keymap.set(Keys.V, "(", "`>a)`", Keys.Noremap) +vim.keymap.set(Keys.V, "'", "`>a'`", Keys.Noremap) +vim.keymap.set(Keys.V, "", "`>a}`", Keys.Noremap) + +vim.keymap.set(Keys.V, ")", "`>a)`", Keys.Noremap) +vim.keymap.set(Keys.V, "]", "`>a]`", Keys.Noremap) +vim.keymap.set(Keys.V, "", "`>a}`", Keys.Noremap) + +vim.keymap.set(Keys.N, "ne", ":set noexpandtab!", Keys.Noremap) +vim.keymap.set(Keys.N, "et", ":set expandtab!", Keys.Noremap) diff --git a/lua/config/bufferline.lua b/lua/config/bufferline.lua deleted file mode 100644 index 99c30d5..0000000 --- a/lua/config/bufferline.lua +++ /dev/null @@ -1,136 +0,0 @@ -vim.opt.termguicolors = true - -require("bufferline").setup { - options = { - numbers = "ordinal", - -- "none" | "ordinal" | "buffer_id" | "both", - close_command = "bdelete! %d", -- can be a string | function, see "Mouse actions" - right_mouse_command = "bdelete! %d", -- can be a string | function, see "Mouse actions" - left_mouse_command = "buffer %d", -- can be a string | function, see "Mouse actions" - middle_mouse_command = nil, -- can be a string | function, see "Mouse actions" - -- NOTE: this plugin is designed with this icon in mind, - -- and so changing this is NOT recommended, this is intended - -- as an escape hatch for people who cannot bear it for whatever reason - indicator = { - style = "icon", - icon = "▎", - }, - buffer_close_icon = "", - modified_icon = "●", - close_icon = "", - left_trunc_marker = "", - right_trunc_marker = "", - --- name_formatter can be used to change the buffer's label in the bufferline. - --- Please note some names can/will break the - --- bufferline so use this at your discretion knowing that it has - --- some limitations that will *NOT* be fixed. - name_formatter = function(buf) -- buf contains a "name", "path" and "bufnr" - -- remove extension from markdown files for example - if buf.name:match("%.md") then - return vim.fn.fnamemodify(buf.name, ":t:r") - end - end, - max_name_length = 18, - max_prefix_length = 15, -- prefix used when a buffer is de-duplicated - tab_size = 18, - diagnostics = "nvim_lsp", -- false | "nvim_lsp", - diagnostics_indicator = function(count, level, diagnostics_dict, context) - local icon = level:match("error") and " " or " " - return " " .. icon .. count - end, - -- NOTE: this will be called a lot so don't do any heavy processing here - custom_filter = function(buf_number) - -- filter out filetypes you don't want to see - if vim.bo[buf_number].filetype ~= "" then - return true - end - -- filter out by buffer name - if vim.fn.bufname(buf_number) ~= "" then - return true - end - -- filter out based on arbitrary rules - -- e.g. filter out vim wiki buffer from tabline in your work repo - if vim.fn.getcwd() == "" and vim.bo[buf_number].filetype ~= "wiki" then - return true - end - end, - offsets = {filetype = "NvimTree", text = "File Explorer"}, -- {{filetype = "NvimTree", text = "File Explorer" | function , text_align = "left" | "center" | "right"}}, - show_buffer_icons = true, -- disable filetype icons for buffers - show_buffer_close_icons = false, - show_close_icon = false, - show_tab_indicators = true, - persist_buffer_sort = true, -- whether or not custom sorted buffers should persist - -- can also be a table containing 2 custom separators - -- [focused and unfocused]. eg: { '|', '|' } - separator_style = "slant", -- "slant" | "thick" | "thin" | {"any", "any"}, - enforce_regular_tabs = true, - always_show_bufferline = false, - sort_by = "id", -- "id" | "extension" | "relative_directory" | "directory" | "tabs" | function(buffer_a, buffer_b) return buffer_a.modified > buffer_b.modified end - custom_areas = { - right = function() - local result = {} - -- local error = vim.lsp.diagnostic.get_count(0, [[Error]]) - -- local warning = vim.lsp.diagnostic.get_count(0, [[Warning]]) - -- local info = vim.lsp.diagnostic.get_count(0, [[Information]]) - -- local hint = vim.lsp.diagnostic.get_count(0, [[Hint]]) - -- - -- if error ~= 0 then - -- table.insert(result, {text = "  " .. error, guifg = "#EC5241"}) - -- end - -- - -- if warning ~= 0 then - -- table.insert(result, {text = "  " .. warning, guifg = "#EFB839"}) - -- end - -- - -- if hint ~= 0 then - -- table.insert(result, {text = "  " .. hint, guifg = "#A3BA5E"}) - -- end - -- - -- if info ~= 0 then - -- table.insert(result, {text = "  " .. info, guifg = "#7EA9A7"}) - -- end - return result - end - } - } -} - -local n = "n" -local noremap = {noremap=true} -local noremapSilent = {noremap=true, silent=true} - -vim.api.nvim_set_keymap(n, "bh", ":lua require('bufferline').toggle_bufferline() ", noremapSilent) - -vim.api.nvim_set_keymap(n, "", ":bd!", noremapSilent) - --- These commands will navigate through buffers in order regardless of which mode you are using --- e.g. if you change the order of buffers", ":bnext and", ":bprevious will not respect the custom ordering -vim.api.nvim_set_keymap(n, "]", ":BufferLineCycleNext", noremapSilent) -vim.api.nvim_set_keymap(n, "[", ":BufferLineCyclePrev", noremapSilent) - --- These commands will move the current buffer backwards or forwards in the bufferline -vim.api.nvim_set_keymap(n, "b]", ":BufferLineMoveNext", noremapSilent) -vim.api.nvim_set_keymap(n, "b[", ":BufferLineMovePrev", noremapSilent) - --- These commands will sort buffers by directory, language, or a custom criteria -vim.api.nvim_set_keymap(n, "be", ":BufferLineSortByExtension", noremapSilent) -vim.api.nvim_set_keymap(n, "bst", ":BufferLineSortByTabs", noremapSilent) -vim.api.nvim_set_keymap(n, "bsd", ":BufferLineSortByDirectory", noremapSilent) - -vim.api.nvim_set_keymap(n, "bd", ":bd!", noremapSilent) -vim.api.nvim_set_keymap(n, "bp", ":bp", noremapSilent) -vim.api.nvim_set_keymap(n, "bn", ":bn", noremapSilent) --- vim.api.nvim_set_keymap(n, "bs", ":lua require'bufferline'.sort_buffers_by(function (buf_a, buf_b) return buf_a.id < buf_b.id end)", noremapSilent) - --- Goto buffer in position... -vim.api.nvim_set_keymap(n, "1", "BufferLineGoToBuffer 1", noremapSilent) -vim.api.nvim_set_keymap(n, "2", "BufferLineGoToBuffer 2", noremapSilent) -vim.api.nvim_set_keymap(n, "3", "BufferLineGoToBuffer 3", noremapSilent) -vim.api.nvim_set_keymap(n, "4", "BufferLineGoToBuffer 4", noremapSilent) -vim.api.nvim_set_keymap(n, "5", "BufferLineGoToBuffer 5", noremapSilent) -vim.api.nvim_set_keymap(n, "6", "BufferLineGoToBuffer 6", noremapSilent) -vim.api.nvim_set_keymap(n, "7", "BufferLineGoToBuffer 7", noremapSilent) -vim.api.nvim_set_keymap(n, "8", "BufferLineGoToBuffer 8", noremapSilent) -vim.api.nvim_set_keymap(n, "9", "BufferLineGoToBuffer 9", noremapSilent) - -vim.api.nvim_set_keymap(n, "`", ":edit #", noremap) diff --git a/lua/config/clangd_e.lua b/lua/config/clangd_e.lua deleted file mode 100644 index 367ac56..0000000 --- a/lua/config/clangd_e.lua +++ /dev/null @@ -1,128 +0,0 @@ -require("clangd_extensions").setup { - server = { --- -- options to pass to nvim-lspconfig --- -- i.e. the arguments to require("lspconfig").clangd.setup({}) - on_attach = function(client, bufnr) - ON_ATTACH(client, bufnr) - - vim.api.nvim_buf_set_keymap(bufnr, Keys.N, "gh", "ClangdSwitchSourceHeader", Keys.NoremapSilent) - end, - capabilities = CAPABILITIES, - flags = FLAGS; - -- - cmd = { - "clangd", - "--all-scopes-completion", - "--background-index", - "--clang-tidy", - -- "--completion-style=bundled", - "--cross-file-rename", - -- "--enable-config", - -- "--header-insertion-decorators", - -- "--header-insertion=iwyu", - -- "--limit-results=0", - -- "--malloc-trim", - }, - - filetypes = { "c", "cpp" }, --- --- on_attach = function() --- ON_ATTACH() - --- vim.api.nvim_buf_set_keymap( --- 0, "n", "gs", "ClangdSwitchSourceHeader", --- {noremap = true, silent = true} --- ) --- end, --- capabilities = CAPABILITIES, ----- --- cmd = { --- "clangd", --- "--background-index", --- "--enable-config", --- "--all-scopes-completion", --- "--clang-tidy", --- "--completion-style=bundled", --- "--malloc-trim", --- "--cross-file-rename", --- "--header-insertion=iwyu", --- "--limit-results=0", --- "--header-insertion-decorators", --- "--suggest-missing-includes", --- "--clang-tidy", --- "--clang-tidy-checks=-clang-analyzer-*," .. "bugprone-*," .. "misc-*," .. --- "-misc-non-private-member-variables-in-classes," .. "performance-*," .. --- "-performance-no-automatic-move," .. "modernize-use-*," .. --- "-modernize-use-nodiscard," .. "-modernize-use-trailing-return-type" --- }, --- init_options = { --- clangdFileStatus = true, --- usePlaceholders = true, --- completeUnimported = true --- }, - }, --- extensions = { --- -- defaults: --- -- Automatically set inlay hints (type hints) --- autoSetHints = true, --- -- These apply to the default ClangdSetInlayHints command --- inlay_hints = { --- -- Only show inlay hints for the current line --- only_current_line = false, --- -- Event which triggers a refersh of the inlay hints. --- -- You can make this "CursorMoved" or "CursorMoved,CursorMovedI" but --- -- not that this may cause higher CPU usage. --- -- This option is only respected when only_current_line and --- -- autoSetHints both are true. --- only_current_line_autocmd = "CursorHold", --- -- whether to show parameter hints with the inlay hints or not --- show_parameter_hints = true, --- -- prefix for parameter hints --- parameter_hints_prefix = "<- ", --- -- prefix for all the other hints (type, chaining) --- other_hints_prefix = "=> ", --- -- whether to align to the length of the longest line in the file --- max_len_align = false, --- -- padding from the left if max_len_align is true --- max_len_align_padding = 1, --- -- whether to align to the extreme right or not --- right_align = false, --- -- padding from the right if right_align is true --- right_align_padding = 7, --- -- The color of the hints --- highlight = "Comment", --- -- The highlight group priority for extmark --- priority = 100, --- }, --- ast = { --- role_icons = { --- type = "", --- declaration = "", --- expression = "", --- specifier = "", --- statement = "", --- ["template argument"] = "", --- }, --- --- kind_icons = { --- Compound = "", --- Recovery = "", --- TranslationUnit = "", --- PackExpansion = "", --- TemplateTypeParm = "", --- TemplateTemplateParm = "", --- TemplateParamObject = "", --- }, --- --- highlights = { --- detail = "Comment", --- }, --- }, --- memory_usage = { --- border = "none", --- }, --- symbol_info = { --- border = "none", --- }, --- }, -} diff --git a/lua/config/cmake.lua b/lua/config/cmake.lua deleted file mode 100644 index 9a7c465..0000000 --- a/lua/config/cmake.lua +++ /dev/null @@ -1,45 +0,0 @@ --- Select target for running / debugging. -vim.api.nvim_set_keymap(Keys.N, "ctt", ":Telescope cmake select_target", Keys.Noremap) --- Create new CMake project. -vim.api.nvim_set_keymap(Keys.N, "ctp", ":Telescope cmake create_project", Keys.Noremap) --- Select build type (Release, Debug, etc.). -vim.api.nvim_set_keymap(Keys.N, "ctb", ":Telescope cmake select_build_type", Keys.Noremap) - -vim.api.nvim_set_keymap(Keys.N, "cg", ":CMake configure", Keys.Noremap) -vim.api.nvim_set_keymap(Keys.N, "cb", ":CMake build", Keys.Noremap) -vim.api.nvim_set_keymap(Keys.N, "cc", ":CMake clean", Keys.Noremap) -vim.api.nvim_set_keymap(Keys.N, "cr", ":CMake build_and_run", Keys.Noremap) -vim.api.nvim_set_keymap(Keys.N, "cd", ":CMake debug", Keys.Noremap) - -local Path = require("plenary.path") -require("cmake").setup({ - -- cmake_executable = "cmake", -- CMake executable to run. - save_before_build = false, -- Save all buffers before building. - -- parameters_file = "neovim.json", -- JSON file to store information about selected target, run arguments and build type. - default_parameters = { - run_dir = vim.fn.getcwd(), - args = {}, - build_type = "Debug", - - }, -- The default values in `parameters_file`. Can also optionally contain `run_dir` with the working directory for applications. - -- build_dir = tostring(Path:new("{cwd}", "build", "{os}-{build_type}")), -- Build directory. The expressions `{cwd}`, `{os}` and `{build_type}` will be expanded with the corresponding text values. Could be a function that return the path to the build directory. - -- samples_path = tostring(script_path:parent():parent():parent() / "samples"), -- Folder with samples. `samples` folder from the plugin directory is used by default. - default_projects_path = tostring(Path:new(vim.loop.os_homedir(), "dev")), -- Default folder for creating project. - -- configure_args = { "-D", "CMAKE_EXPORT_COMPILE_COMMANDS=1" }, -- Default arguments that will be always passed at cmake configure step. By default tells cmake to generate `compile_commands.json`. - -- build_args = {}, -- Default arguments that will be always passed at cmake build step. - -- on_build_output = nil, -- Callback that will be called each time data is received by the current process. Accepts the received data as an argument. - -- quickfix = { - -- pos = "botright", -- Where to open quickfix - -- height = 10, -- Height of the opened quickfix. - -- only_on_error = false, -- Open quickfix window only if target build failed. - -- }, - -- copy_compile_commands = true, -- Copy compile_commands.json to current working directory. - -- dap_configurations = { -- Table of different DAP configurations. - -- lldb_vscode = { type = "lldb", request = "launch" }, - -- cppdbg_vscode = { type = "cppdbg", request = "launch" }, - -- }, - -- dap_configuration = "lldb_vscode", -- DAP configuration to use if the projects `parameters_file` does not specify one. - -- dap_open_command = function(...) - -- require("dap").repl.open(...) - -- end, -- Command to run after starting DAP session. You can set it to `false` if you don't want to open anything or `require('dapui').open` if you are using https://github.com/rcarriga/nvim-dap-ui -}) diff --git a/lua/config/cmpConfig.lua b/lua/config/cmpConfig.lua deleted file mode 100644 index 7938468..0000000 --- a/lua/config/cmpConfig.lua +++ /dev/null @@ -1,86 +0,0 @@ --- Setup nvim-cmp. -local cmp = require("cmp") - -local lspkind = require("lspkind") - -cmp.setup({ - --completion = { - --completeopt = "menu,menuone,noinsert", - --}, - window = { - completion = cmp.config.window.bordered(), - documentation = cmp.config.window.bordered(), - }, - formatting = { - format = lspkind.cmp_format({ - mode = "symbol", -- show only symbol annotations - maxwidth = 50, -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters) - - -- The function below will be called before any actual modifications from lspkind - -- so that you can provide more controls on popup customization. (See [#30](https://github.com/onsails/lspkind-nvim/pull/30)) - before = function(entry, vim_item) - return vim_item - end, - }), - }, - snippet = { - -- REQUIRED - you must specify a snippet engine - expand = function(args) - vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users. - -- require('luasnip').lsp_expand(args.body) -- For `luasnip` users. - -- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users. - -- require'snippy'.expand_snippet(args.body) -- For `snippy` users. - end, - }, - mapping = { - [""] = cmp.mapping(cmp.mapping.scroll_docs(-4), { "i", "c" }), - [""] = cmp.mapping(cmp.mapping.scroll_docs(4), { "i", "c" }), - [""] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }), - [""] = cmp.config.disable, -- Specify `cmp.config.disable` if you want to remove the default `` mapping. - [""] = cmp.mapping({ - i = cmp.mapping.abort(), - c = cmp.mapping.close(), - }), - [""] = cmp.mapping.confirm({ select = true }), - [""] = cmp.mapping(cmp.mapping.select_next_item(), { "i", "s" }), - [""] = cmp.mapping(cmp.mapping.select_prev_item(), { "i", "s" }), - }, - sources = cmp.config.sources({ - { name = "orgmode" }, - { name = "nvim_lsp" }, - { name = "vsnip" }, -- For vsnip users. - -- { name = 'luasnip' }, -- For luasnip users. - -- { name = 'ultisnips' }, -- For ultisnips users. - -- { name = 'snippy' }, -- For snippy users. - - { name = "emoji" }, - { name = "greek" }, - { name = "nvim_lua" }, - { name = "treesitter" }, - }, { - { name = "buffer" }, - { name = "path" }, - }), -}) - --- Use buffer source for `?` (if you enabled `native_menu`, this won't work anymore). -cmp.setup.cmdline("?", { - sources = { - { name = "buffer" }, - }, -}) - --- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore). -cmp.setup.cmdline("/", { - sources = { - { name = "buffer" }, - }, -}) - --- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). -cmp.setup.cmdline(":", { - sources = cmp.config.sources({ - { name = "path" }, - { name = "cmdline" }, - }), -}) diff --git a/lua/config/commands.lua b/lua/config/commands.lua new file mode 100644 index 0000000..fc2e40c --- /dev/null +++ b/lua/config/commands.lua @@ -0,0 +1,32 @@ +local bang_true = { bang = true } + +local function gen_new_cmd(name) + return function(tbl) + if tbl.bang then + vim.cmd(name .. "!") + else + vim.cmd(name) + end + end +end + +vim.api.nvim_create_user_command("W", gen_new_cmd("w"), bang_true) + +local wq = gen_new_cmd("wq") +vim.api.nvim_create_user_command("WQ", wq, bang_true) +vim.api.nvim_create_user_command("Wq", wq, bang_true) +vim.api.nvim_create_user_command("Qw", wq, bang_true) +vim.api.nvim_create_user_command("QW", wq, bang_true) + +vim.api.nvim_create_user_command( + "WipeReg", + "for i in range(34,122) | silent! call setreg(nr2char(i), []) | endfor", + { bang = true } +) + +vim.api.nvim_create_user_command("Scratch", "new | setlocal bt=nofile bh=wipe nobl noswapfile nu", bang_true) +function Scratch() + vim.opt_local.bt = "nofile" +end + +vim.cmd.command({ args = { "-bar -complete=file", "-nargs=1 E :e " } }) diff --git a/lua/config/copilot.lua b/lua/config/copilot.lua deleted file mode 100644 index 19e30e7..0000000 --- a/lua/config/copilot.lua +++ /dev/null @@ -1,53 +0,0 @@ -local notify = require("notify") - -vim.api.nvim_exec( - [[ -let _PATH=$PATH -let $PATH=$HOME -let $PATH.='/Applications/nodejs/node-v16.17.0-linux-x64/bin/:' -let $PATH.=_PATH -]], - false -) - -function CopilotInfo() - notify(vim.api.nvim_exec("Copilot status", true), "info", { - title = "Copilot", - }) -end - -vim.g.copilot_filetypes = { - ["*"] = false, - bash = true, - c = true, - cpp = true, - css = true, - glsl = true, - html = true, - javascript = true, - javascriptreact = true, - js = true, - jsx = true, - less = true, - lua = true, - org = true, - python = true, - rust = true, - scss = true, - sh = true, - ts = true, - tsx = true, - txt = true, - typescript = true, - typescriptreact = true, - yuck = true, - zsh = true, -} - -vim.g.copilot_no_tab_map = true - -vim.api.nvim_set_keymap(Keys.I, "", 'copilot#Accept("")', Keys.NoremapSilentExprScript) - -vim.api.nvim_set_keymap(Keys.N, "ci", "lua CopilotInfo()", Keys.Noremap) -vim.api.nvim_set_keymap(Keys.N, "cd", "lua vim.b.copilot_enabled = false", Keys.Noremap) -vim.api.nvim_set_keymap(Keys.N, "ce", "lua vim.b.copilot_enabled = true", Keys.Noremap) diff --git a/lua/config/dapConfig.lua b/lua/config/dapConfig.lua deleted file mode 100644 index 6ce60a7..0000000 --- a/lua/config/dapConfig.lua +++ /dev/null @@ -1,132 +0,0 @@ -local Dapui = require("dapui") -local Dap = require("dap") - -local dap_install = require("dap-install") - -dap_install.config("chrome", {}) -dap_install.config("jsnode", {}) -dap_install.config("python", {}) - -dap_install.setup({ - installation_path = vim.fn.stdpath("data") .. "/dapinstall/", -}) - -Dap.listeners.after.event_initialized["dapui_config"] = function() - Dapui.open() -end -Dap.listeners.before.event_terminated["dapui_config"] = function() - Dapui.close() -end -Dap.listeners.before.event_exited["dapui_config"] = function() - Dapui.close() -end - -Dapui.setup({ - icons = { expanded = "▾", collapsed = "▸" }, - mappings = { - -- Use a table to apply multiple mappings - expand = { "", "<2-LeftMouse>" }, - open = "o", - remove = "d", - edit = "e", - repl = "r", - }, - layouts = { - { - elements = { - "scopes", - "breakpoints", - "stacks", - "watches", - }, - size = 40, - position = "left", - }, - { - elements = { - "repl", - "console", - }, - size = 10, - position = "bottom", - }, - }, - floating = { - max_height = nil, -- These can be integers or a float between 0 and 1. - max_width = nil, -- Floats will be treated as percentage of your screen. - mappings = { close = { "q", "" } }, - }, - windows = { indent = 1 }, -}) - --- virtual text deactivated (default) -vim.g.dap_virtual_text = true --- show virtual text for current frame (recommended) -vim.g.dap_virtual_text = true --- request variable values for all frames (experimental) -vim.g.dap_virtual_text = "all frames" - --- Exception virtual text can be deactivated via --- require'nvim-dap-virtual-text' --- require'dap'.listeners.after.exceptionInfo['nvim-dap-virtual-text'] = function() end - -require("telescope").load_extension("dap") --- stylua: ignore start -vim.api.nvim_set_keymap(Keys.N, "tdc", ":Telescope dap commands", Keys.Noremap) -vim.api.nvim_set_keymap(Keys.N, "tds", ":Telescope dap configurations", Keys.Noremap) -vim.api.nvim_set_keymap(Keys.N, "tdl", ":Telescope dap list_breakpoints", Keys.Noremap) -vim.api.nvim_set_keymap(Keys.N, "tdv", ":Telescope dap variables", Keys.Noremap) -vim.api.nvim_set_keymap(Keys.N, "tdf", ":Telescope dap frames", Keys.Noremap) -vim.api.nvim_set_keymap(Keys.N, "d", "lua require'dap'.continue()", Keys.Noremap) -vim.api.nvim_set_keymap(Keys.N, "db", "lua require'dap'.toggle_breakpoint()", Keys.Noremap) -vim.api.nvim_set_keymap(Keys.N, "dr", "lua require'dap'.repl.open()", Keys.Noremap) -vim.api.nvim_set_keymap(Keys.N, "dj", "lua require'dap'.step_into()", Keys.Noremap) -vim.api.nvim_set_keymap(Keys.N, "dn", "lua require'dap'.step_over()", Keys.Noremap) --- stylua: ignore end - -Dap.adapters.lldb = { - type = "executable", - command = "/usr/bin/lldb-vscode", -- adjust as needed - name = "lldb", -} - -Dap.configurations.cpp = { - { - name = "Launch", - type = "lldb", - request = "launch", - program = function() - return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file") - end, - cwd = "${workspaceFolder}", - stopOnEntry = true, - args = {}, - - -- if you change `runInTerminal` to true, you might need to change the yama/ptrace_scope setting: - -- - -- echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope - -- - -- Otherwise you might get the following error: - -- - -- Error on launch: Failed to attach to the target process - -- - -- But you should be aware of the implications: - -- https://www.kernel.org/doc/html/latest/admin-guide/LSM/Yama.html - runInTerminal = false, - - env = function() - local variables = {} - for k, v in pairs(vim.fn.environ()) do - table.insert(variables, string.format("%s=%s", k, v)) - end - return variables - end, - }, -} - --- If you want to use this for rust and c, add something like this: - -Dap.configurations.c = Dap.configurations.cpp -Dap.configurations.rust = Dap.configurations.cpp - ---Dap.configurations.javascript[2] = Dap.configurations.javascriptreact diff --git a/lua/config/discord.lua b/lua/config/discord.lua deleted file mode 100644 index 68dd416..0000000 --- a/lua/config/discord.lua +++ /dev/null @@ -1,24 +0,0 @@ --- The setup config table shows all available config options with their default values: -require("presence"):setup( - { - -- General options - auto_update = true, -- Update activity based on autocmd events (if `false`, map or manually execute `:lua package.loaded.presence:update()`) - neovim_image_text = "The One True Text Editor", -- Text displayed when hovered over the Neovim image - main_image = "neovim", -- Main image display (either "neovim" or "file") - client_id = "793271441293967371", -- Use your own Discord application client id (not recommended) - log_level = nil, -- Log messages at or above this level (one of the following: "debug", "info", "warn", "error") - debounce_timeout = 10, -- Number of seconds to debounce events (or calls to `:lua package.loaded.presence:update(, true)`) - enable_line_number = false, -- Displays the current line number instead of the current project - blacklist = {}, -- A list of strings or Lua patterns that disable Rich Presence if the current file name, path, or workspace matches - buttons = true, -- Configure Rich Presence button(s), either a boolean to enable/disable, a static table (`{{ label = "