├── .__abstract__ ├── .gitignore ├── lua ├── plugins │ ├── context_vt_nvim.lua │ ├── vim_surround.lua │ ├── filetype_nvim.lua │ ├── github-nvim-theme.lua │ ├── impatient_nvim.lua │ ├── nvim-web-devicons.lua │ ├── Abstract_cs.lua │ ├── desktop-notify_nvim.lua │ ├── dart-vim-plugin.lua │ ├── modes_nvim.lua │ ├── vim_commentary.lua │ ├── gitblame.lua │ ├── surround_nvim.lua │ ├── lspstatus.lua │ ├── rooter_nvim.lua │ ├── hardline_nvim.lua │ ├── lspinstall.lua │ ├── penvim.lua │ ├── vim-maximizer.lua │ ├── staline_nvim.lua │ ├── nvim-ts-autotag.lua │ ├── indentLine.lua │ ├── hop_nvim.lua │ ├── commits.lua │ ├── lspkind-nvim.lua │ ├── vimspector.lua │ ├── neoscroll_nvim.lua │ ├── indent-blankline_nvim.lua │ ├── fterm_nvim.lua │ ├── nvim-colorizer_lua.lua │ ├── hydra_nvim.lua │ ├── LuaSnip.lua │ ├── fidget_nivm.lua │ ├── barbar_nvim.lua │ ├── neovim-session-manager.lua │ ├── kommentary.lua │ ├── nvim-surround.lua │ ├── vsnip.lua │ ├── Comment_nvim.lua │ ├── nvim-autopairs.lua │ ├── alpha-nvim.lua │ ├── nvim-ts-context-commentstring.lua │ ├── formatter.lua │ ├── renamer_nvim.lua │ ├── bubbly_nvim.lua │ ├── nvim-lsp-installer.lua │ ├── mason_nvim.lua │ ├── flutter-tools_nvim.lua │ ├── goto-preview.lua │ ├── vim_rooter.lua │ ├── nvim-treesitter.lua │ ├── lsp_signature_nvim.lua │ ├── trouble_nvim.lua │ ├── vim-floaterm.lua │ ├── gitsigns_nvim.lua │ ├── lspsaga_nvim.lua │ ├── nvim-cmp.lua │ ├── nvim-dap.lua │ ├── telescope_nvim.lua │ ├── null-ls_nvim.lua │ ├── nvim_navic.lua │ ├── nvim-bufferline_lua.lua │ ├── nvim-tree_lua.lua │ ├── feline_nvim.lua │ ├── windline_nvim.lua │ └── galaxyline_nvim.lua ├── customs │ └── override_defalut.lua ├── mappings.lua └── configs.lua ├── .stylua.toml ├── extra └── snippets │ ├── package.json │ └── lua.json ├── LICENSE ├── init.lua └── README.md /.__abstract__: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | plugin/ 2 | -------------------------------------------------------------------------------- /lua/plugins/context_vt_nvim.lua: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.stylua.toml: -------------------------------------------------------------------------------- 1 | column_width = 120 2 | line_endings = "Unix" 3 | indent_type = "Tabs" 4 | indent_width = 4 5 | quote_style = "AutoPreferDouble" 6 | call_parentheses = "Always" 7 | -------------------------------------------------------------------------------- /lua/plugins/vim_surround.lua: -------------------------------------------------------------------------------- 1 | --------------------------------------------------------------------- 2 | -- PluginName: vim-surround 3 | -- Github: github.com/tpope/vim-surround 4 | 5 | --------------------------------------------------------------------- 6 | -------------------------------------------------------------------------------- /extra/snippets/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "dotfiles", 3 | "engines": { 4 | "vscode": "^1.11.0" 5 | }, 6 | "contributes": { 7 | "snippets": [ 8 | { 9 | "language": "lua", 10 | "path": "lua.json" 11 | } 12 | ] 13 | } 14 | } 15 | 16 | -------------------------------------------------------------------------------- /lua/plugins/filetype_nvim.lua: -------------------------------------------------------------------------------- 1 | 2 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 3 | -- ───────────────────────────────────────────────── -- 4 | -- Plugin: filetype.nvim 5 | -- Github: github.com/nathom/filetype.nvim 6 | -- ───────────────────────────────────────────────── -- 7 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 8 | 9 | 10 | 11 | 12 | 13 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 14 | -- ━━━━━━━━━━━━━━━━━━━❰ configs ❱━━━━━━━━━━━━━━━━━━━ -- 15 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 16 | 17 | pcall(require, "filetype") 18 | 19 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 20 | -- ━━━━━━━━━━━━━━━━━❰ end configs ❱━━━━━━━━━━━━━━━━━ -- 21 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 22 | 23 | -------------------------------------------------------------------------------- /lua/plugins/github-nvim-theme.lua: -------------------------------------------------------------------------------- 1 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 2 | --─────────────────────────────────────────────────-- 3 | -- Plugin: github-nvim-theme 4 | -- Github: github.com/projekt0n/github-nvim-theme 5 | --─────────────────────────────────────────────────-- 6 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 7 | 8 | 9 | 10 | 11 | 12 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 13 | --━━━━━━━━━━━━━━━━━━━❰ configs ❱━━━━━━━━━━━━━━━━━━━-- 14 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 15 | 16 | require("github-theme").setup({ 17 | theme_style = "dark_default", 18 | -- other config 19 | }) 20 | 21 | 22 | 23 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 24 | --━━━━━━━━━━━━━━━━━❰ end configs ❱━━━━━━━━━━━━━━━━━-- 25 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 26 | -------------------------------------------------------------------------------- /lua/plugins/impatient_nvim.lua: -------------------------------------------------------------------------------- 1 | 2 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 3 | -- ───────────────────────────────────────────────── -- 4 | -- Plugin: impatient.nvim 5 | -- Github: github.com/lewis6991/impatient.nvim 6 | -- ───────────────────────────────────────────────── -- 7 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 8 | 9 | 10 | 11 | 12 | 13 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 14 | -- ━━━━━━━━━━━━━━━━━━━❰ configs ❱━━━━━━━━━━━━━━━━━━━ -- 15 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 16 | 17 | 18 | local impatient_ok, _ = pcall(require, "impatient") 19 | if not impatient_ok then 20 | return 21 | end 22 | 23 | require('impatient') 24 | 25 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 26 | -- ━━━━━━━━━━━━━━━━━❰ end configs ❱━━━━━━━━━━━━━━━━━ -- 27 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 28 | 29 | -------------------------------------------------------------------------------- /lua/plugins/nvim-web-devicons.lua: -------------------------------------------------------------------------------- 1 | 2 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 3 | -- ───────────────────────────────────────────────── -- 4 | -- Plugin: nvim-web-devicons 5 | -- Github: github.com/kyazdani42/nvim-web-devicons 6 | -- ───────────────────────────────────────────────── -- 7 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 8 | 9 | 10 | 11 | 12 | 13 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 14 | -- ━━━━━━━━━━━━━━━━━━━❰ configs ❱━━━━━━━━━━━━━━━━━━━ -- 15 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 16 | 17 | local import_icons, icons = pcall(require, "nvim-web-devicons") 18 | if not import_icons then return end 19 | 20 | -- Get all icons 21 | icons.get_icons() 22 | 23 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 24 | -- ━━━━━━━━━━━━━━━━━❰ end configs ❱━━━━━━━━━━━━━━━━━ -- 25 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 26 | 27 | -------------------------------------------------------------------------------- /lua/plugins/Abstract_cs.lua: -------------------------------------------------------------------------------- 1 | 2 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 3 | -- ───────────────────────────────────────────────── -- 4 | -- Plugin: Abstract-cs 5 | -- Github: github.com/Abstract-IDE/Abstract-cs 6 | -- ───────────────────────────────────────────────── -- 7 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 8 | 9 | 10 | 11 | 12 | 13 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 14 | -- ━━━━━━━━━━━━━━━━━━━❰ configs ❱━━━━━━━━━━━━━━━━━━━ -- 15 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 16 | 17 | -- apply colorscheme without throwing any errors 18 | local apply_cs, _ = pcall(vim.cmd, 'colorscheme abscs') 19 | if not apply_cs then return end 20 | 21 | -- theme name 22 | vim.g.abscs_theme_name = 'aqua' 23 | 24 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 25 | -- ━━━━━━━━━━━━━━━━━❰ end configs ❱━━━━━━━━━━━━━━━━━ -- 26 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 27 | 28 | -------------------------------------------------------------------------------- /lua/plugins/desktop-notify_nvim.lua: -------------------------------------------------------------------------------- 1 | 2 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 3 | -- ───────────────────────────────────────────────── -- 4 | -- Plugin: desktop-notify.nvim 5 | -- Github: github.com/simrat39/desktop-notify.nvim 6 | -- ───────────────────────────────────────────────── -- 7 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 8 | 9 | 10 | 11 | 12 | 13 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 14 | -- ━━━━━━━━━━━━━━━━━━━❰ configs ❱━━━━━━━━━━━━━━━━━━━ -- 15 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 16 | 17 | -- safely import desktop-notify 18 | local notify_imported, notify = pcall(require, 'desktop-notify') 19 | if not notify_imported then return end 20 | 21 | notify.override_vim_notify() 22 | 23 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 24 | -- ━━━━━━━━━━━━━━━━━❰ end configs ❱━━━━━━━━━━━━━━━━━ -- 25 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 26 | 27 | -------------------------------------------------------------------------------- /lua/plugins/dart-vim-plugin.lua: -------------------------------------------------------------------------------- 1 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 2 | -- ───────────────────────────────────────────────── -- 3 | -- Plugin: dart-vim-plugin 4 | -- Github: github.com/dart-lang/dart-vim-plugin 5 | -- ───────────────────────────────────────────────── -- 6 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 7 | 8 | 9 | 10 | 11 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 12 | -- ━━━━━━━━━━━━━━━━━━━❰ configs ❱━━━━━━━━━━━━━━━━━━━ -- 13 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 14 | 15 | -- Enable HTML syntax highlighting inside Dart strings (default: false) 16 | vim.g.dart_html_in_string = "v.true" 17 | -- Enable Dart style guide syntax (like 2-space indentation) 18 | vim.g.dart_style_guide = 2 19 | -- Enable DartFmt execution on buffer save with 20 | vim.g.dart_format_on_save = 0 21 | 22 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 23 | -- ━━━━━━━━━━━━━━━━━❰ end configs ❱━━━━━━━━━━━━━━━━━ -- 24 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 25 | 26 | -------------------------------------------------------------------------------- /lua/plugins/modes_nvim.lua: -------------------------------------------------------------------------------- 1 | 2 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 3 | -- ───────────────────────────────────────────────── -- 4 | -- Plugin: modes.nvim 5 | -- Github: github.com/mvllow/modes.nvim 6 | -- ───────────────────────────────────────────────── -- 7 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 8 | 9 | 10 | 11 | 12 | 13 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 14 | -- ━━━━━━━━━━━━━━━━━━━❰ configs ❱━━━━━━━━━━━━━━━━━━━ -- 15 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 16 | 17 | require('modes').setup({ 18 | 19 | colors = { 20 | copy = "#f5c359", 21 | delete = "#c75c6a", 22 | insert = "#3c6662", 23 | visual = "#9745be", 24 | }, 25 | 26 | -- Cursorline highlight opacity 27 | line_opacity = 0.1, 28 | 29 | -- Highlight cursor 30 | set_cursor = false, 31 | 32 | -- Highlight in active window only 33 | focus_only = false, 34 | }) 35 | 36 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 37 | -- ━━━━━━━━━━━━━━━━━❰ end configs ❱━━━━━━━━━━━━━━━━━ -- 38 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 39 | 40 | -------------------------------------------------------------------------------- /lua/plugins/vim_commentary.lua: -------------------------------------------------------------------------------- 1 | -- -------------------------------------------------------------------- 2 | -- tpope/vim-commentary 3 | -- -------------------------------------------------------------------- 4 | 5 | local keymap = vim.api.nvim_set_keymap 6 | 7 | 8 | -- for custom file support 9 | vim.cmd([[ autocmd FileType kivy setlocal commentstring=#\ %s ]]) 10 | 11 | -- Visual mode 12 | keymap('x', 'cm', "Commentary", {silent=true}) 13 | -- Normal mode 14 | keymap('n', 'cm', "Commentary", {silent=true}) 15 | -- Operator pending mode (this lets you do e.g. `dmc` to delete a block of comments) 16 | keymap('o', 'cm', "Commentary", {silent=true}) 17 | 18 | -- Normal mode, current line 19 | keymap('n', 'cmc', "CommentaryLine", {silent=true}) 20 | 21 | -- Special case cgc (you can skip this one, but then `cmc` will also delete an extra blank line) 22 | -- nmap cmc ChangeCommentary 23 | -- --------------------------------------------------------------------- 24 | -- end of tpope/vim-commentary 25 | -- -------------------------------------------------------------------- 26 | 27 | -------------------------------------------------------------------------------- /lua/plugins/gitblame.lua: -------------------------------------------------------------------------------- 1 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 2 | --─────────────────────────────────────────────────-- 3 | -- Plugin: git-blame.nvim 4 | -- Github: github.com/f-person/git-blame.nvim 5 | --─────────────────────────────────────────────────-- 6 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 7 | 8 | 9 | 10 | 11 | 12 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 13 | --━━━━━━━━━━━━━━━━━━━❰ configs ❱━━━━━━━━━━━━━━━━━━━-- 14 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 15 | 16 | local g = vim.g -- global variables 17 | 18 | 19 | 20 | g.gitblame_enabled = 1 21 | 22 | -- The template for the blame message that will be shown. 23 | -- Available options: , , , , , 24 | g.gitblame_message_template = '' 25 | 26 | -- The format of the date fields. 27 | g.gitblame_date_format = '%c' 28 | 29 | 30 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 31 | --━━━━━━━━━━━━━━━━━❰ end configs ❱━━━━━━━━━━━━━━━━━-- 32 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 33 | 34 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Ali Shahid 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /lua/plugins/surround_nvim.lua: -------------------------------------------------------------------------------- 1 | 2 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 3 | -- ───────────────────────────────────────────────── -- 4 | -- Plugin: surround.nvim 5 | -- Github: github.com/blackcauldron7/surround.nvim 6 | -- ───────────────────────────────────────────────── -- 7 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 8 | 9 | 10 | 11 | 12 | 13 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 14 | -- ━━━━━━━━━━━━━━━━━━━❰ configs ❱━━━━━━━━━━━━━━━━━━━ -- 15 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 16 | 17 | 18 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 19 | -- ━━━━━━━━━━━━━━━━━❰ end configs ❱━━━━━━━━━━━━━━━━━ -- 20 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 21 | 22 | 23 | 24 | 25 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 26 | -- ━━━━━━━━━━━━━━━━━━❰ Mappings ❱━━━━━━━━━━━━━━━━━━━ -- 27 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 28 | 29 | 30 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 31 | -- ━━━━━━━━━━━━━━━━━❰ end Mappings ❱━━━━━━━━━━━━━━━━ -- 32 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 33 | 34 | -------------------------------------------------------------------------------- /lua/plugins/lspstatus.lua: -------------------------------------------------------------------------------- 1 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 2 | --─────────────────────────────────────────────────-- 3 | -- Plugin: lsp-status.nvim 4 | -- Github: github.com/nvim-lua/lsp-status.nvim 5 | --─────────────────────────────────────────────────-- 6 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 7 | 8 | 9 | 10 | 11 | 12 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 13 | --━━━━━━━━━━━━━━━━━━━❰ configs ❱━━━━━━━━━━━━━━━━━━━-- 14 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 15 | 16 | 17 | 18 | 19 | require('lsp-status').status() 20 | require('lsp-status').register_progress() 21 | require('lsp-status').config({ 22 | indicator_errors = '✗', 23 | indicator_warnings = '⚠', 24 | indicator_info = '', 25 | indicator_hint = '', 26 | indicator_ok = '✔', 27 | current_function = true, 28 | diagnostics = false, 29 | select_symbol = nil, 30 | update_interval = 100, 31 | status_symbol = ' 🇻', 32 | }) 33 | 34 | 35 | 36 | 37 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 38 | --━━━━━━━━━━━━━━━━━❰ end configs ❱━━━━━━━━━━━━━━━━━-- 39 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 40 | -------------------------------------------------------------------------------- /lua/plugins/rooter_nvim.lua: -------------------------------------------------------------------------------- 1 | 2 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 3 | -- ───────────────────────────────────────────────── -- 4 | -- Plugin: rooter.nvim 5 | -- Github: github.com/ygm2/rooter.nvim 6 | -- ───────────────────────────────────────────────── -- 7 | 8 | 9 | 10 | 11 | 12 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 13 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 14 | -- ━━━━━━━━━━━━━━━━━━━❰ configs ❱━━━━━━━━━━━━━━━━━━━ -- 15 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 16 | 17 | -- List of patterns(file or folder) which describes a directory as project root li 18 | vim.g.rooter_pattern = { 19 | '.__abstract__', 20 | '.__Abstract__', 21 | '.__nvim__.lua', 22 | '.__project__', 23 | '.git', 24 | 'Makefile', 25 | '_darcs', 26 | '.hg', 27 | '.bzr', 28 | '.svn', 29 | 'node_modules', 30 | 'CMakeLists.txt', 31 | } 32 | 33 | -- Whether to change directory to outermost root directory or not 34 | vim.g.outermost_root = false 35 | 36 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 37 | -- ━━━━━━━━━━━━━━━━━❰ end configs ❱━━━━━━━━━━━━━━━━━ -- 38 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 39 | 40 | -------------------------------------------------------------------------------- /lua/plugins/hardline_nvim.lua: -------------------------------------------------------------------------------- 1 | 2 | require('hardline').setup { 3 | bufferline = false, -- enable bufferline 4 | theme = 'default', -- change theme 5 | sections = { -- define sections 6 | {class = 'mode', item = require('hardline.parts.mode').get_item}, 7 | {class = 'high', item = require('hardline.parts.git').get_item, hide = 80}, 8 | '%<', 9 | {class = 'med', item = require('hardline.parts.filename').get_item}, 10 | {class = 'high', item = require('hardline.parts.filetype').get_item, hide = 80}, 11 | {class = 'med', item ='%='}, 12 | {class = 'low', item = require('hardline.parts.wordcount').get_item, hide = 80}, 13 | {class = 'error', item = require('hardline.parts.lsp').get_error}, 14 | {class = 'warning', item = require('hardline.parts.lsp').get_warning}, 15 | {class = 'warning', item = require('hardline.parts.whitespace').get_item}, 16 | {class = 'mode', item = require('hardline.parts.line').get_item}, 17 | }, 18 | bufferline_settings = { 19 | exclude_terminal = false, -- don't show terminal buffers in bufferline 20 | show_index = false, -- show buffer indexes (not the actual buffer numbers) in bufferline 21 | }, 22 | } 23 | -------------------------------------------------------------------------------- /lua/plugins/lspinstall.lua: -------------------------------------------------------------------------------- 1 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 2 | --─────────────────────────────────────────────────-- 3 | -- Plugin: nvim-lspinstall 4 | -- Github: github.com/kabouzeid/nvim-lspinstall 5 | --─────────────────────────────────────────────────-- 6 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 7 | 8 | 9 | 10 | 11 | 12 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 13 | --━━━━━━━━━━━━━━━━━━━❰ configs ❱━━━━━━━━━━━━━━━━━━━-- 14 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 15 | 16 | --[[ we are going to use lua/plugin_confs/lspconfig.lua 17 | file to change any setting related to LSP 18 | we aren't going to use lua/plugin_confs/lspinstall.lua 19 | file or if you prefer anyway, commentout dupilcate codes 20 | for lspconfig.lua file]]-- 21 | 22 | require'lspinstall'.setup() 23 | --[[ 24 | require'lspinstall'.setup() -- important 25 | 26 | local servers = require'lspinstall'.installed_servers() 27 | for _, server in pairs(servers) do 28 | require'lspconfig'[server].setup{} 29 | end 30 | --]] 31 | 32 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 33 | --━━━━━━━━━━━━━━━━━❰ end configs ❱━━━━━━━━━━━━━━━━━-- 34 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 35 | 36 | -------------------------------------------------------------------------------- /lua/plugins/penvim.lua: -------------------------------------------------------------------------------- 1 | 2 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 3 | -- ───────────────────────────────────────────────── -- 4 | -- Plugin: penvim 5 | -- Github: github.com/shaeinst/penvim 6 | -- ───────────────────────────────────────────────── -- 7 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 8 | 9 | 10 | 11 | 12 | 13 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 14 | -- ━━━━━━━━━━━━━━━━━━━❰ configs ❱━━━━━━━━━━━━━━━━━━━ -- 15 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 16 | 17 | local imported_penvim, penvim = pcall(require, "penvim") 18 | if not imported_penvim then return end 19 | 20 | penvim.setup({ 21 | 22 | project_env = { 23 | enable = true, 24 | config_name = '.__nvim__.lua' 25 | }, 26 | 27 | rooter = { 28 | enable = true, 29 | patterns = {'.__nvim__.lua'}, 30 | 31 | }, 32 | 33 | indentor = { 34 | enable = true, 35 | indent_length = 4, 36 | indent_type = "auto", -- auto|tab|space 37 | }, 38 | 39 | -- langs = { 40 | -- enable = true, 41 | -- } 42 | 43 | }) 44 | 45 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 46 | -- ━━━━━━━━━━━━━━━━━❰ end configs ❱━━━━━━━━━━━━━━━━━ -- 47 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 48 | 49 | -------------------------------------------------------------------------------- /lua/plugins/vim-maximizer.lua: -------------------------------------------------------------------------------- 1 | 2 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 3 | -- ───────────────────────────────────────────────── -- 4 | -- Plugin: vim-maximizer 5 | -- Github: github.com/szw/vim-maximizer 6 | -- ───────────────────────────────────────────────── -- 7 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 8 | 9 | 10 | 11 | 12 | 13 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 14 | -- ━━━━━━━━━━━━━━━━━━━❰ configs ❱━━━━━━━━━━━━━━━━━━━ -- 15 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 16 | 17 | -- "Whether Maximizer should set default mappings or not: 18 | vim.g.maximizer_set_default_mapping = 0 19 | 20 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 21 | -- ━━━━━━━━━━━━━━━━━❰ end configs ❱━━━━━━━━━━━━━━━━━ -- 22 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 23 | 24 | 25 | 26 | 27 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 28 | -- ━━━━━━━━━━━━━━━━━━━❰ Mappings ❱━━━━━━━━━━━━━━━━━━ -- 29 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 30 | 31 | vim.api.nvim_set_keymap('n', 'm', ':MaximizerToggle ', 32 | {silent = true, noremap = true}) 33 | 34 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 35 | -- ━━━━━━━━━━━━━━━━━❰ end Mappings ❱━━━━━━━━━━━━━━━━ -- 36 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 37 | 38 | -------------------------------------------------------------------------------- /lua/plugins/staline_nvim.lua: -------------------------------------------------------------------------------- 1 | 2 | -- Lsp server name . 3 | function lspservername() 4 | local msg = '' 5 | local buf_ft = vim.api.nvim_buf_get_option(0, 'filetype') 6 | local clients = vim.lsp.get_active_clients() 7 | if next(clients) == nil then return msg end 8 | for _, client in ipairs(clients) do 9 | local filetypes = client.config.filetypes 10 | if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then 11 | return "LSP[" .. client.name .. "]" 12 | end 13 | end 14 | return msg 15 | end 16 | 17 | 18 | 19 | 20 | 21 | 22 | require('staline').setup { 23 | defaults = { 24 | left_separator = "", 25 | right_separator = "", 26 | line_column = "[%l:%c /%L] 並%p%%", -- `:h stl` to see all flags. 27 | fg = "#000000", -- Foreground text color. 28 | bg = "#031118", -- Default background is transparent. 29 | cool_symbol = " ", -- Change this to override defult OS icon. 30 | full_path = false, 31 | filename_section = '%{luaeval("lspservername()")}', 32 | 33 | }, 34 | mode_colors = { 35 | n = "#25B2BC", 36 | i = "#859f96", 37 | c = "#e27d60", 38 | v = "#4799eb", 39 | }, 40 | mode_icons = { 41 | n = " ", 42 | i = " ", 43 | c = " ", 44 | v = " ", 45 | }, 46 | } 47 | -------------------------------------------------------------------------------- /lua/plugins/nvim-ts-autotag.lua: -------------------------------------------------------------------------------- 1 | 2 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 3 | -- ───────────────────────────────────────────────── -- 4 | -- Plugin: nvim-ts-autotag 5 | -- Github: github.com/windwp/nvim-ts-autotag 6 | -- ───────────────────────────────────────────────── -- 7 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 8 | 9 | 10 | 11 | 12 | 13 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 14 | -- ━━━━━━━━━━━━━━━━━━━❰ configs ❱━━━━━━━━━━━━━━━━━━━ -- 15 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 16 | 17 | local import_tag, autotag = pcall(require, "nvim-ts-autotag") 18 | if not import_tag then return end 19 | 20 | autotag.setup({ 21 | 22 | autotag = { 23 | enable = true, 24 | }, 25 | 26 | filetypes = { 27 | 'html', 'htmldjango', 28 | 'javascript', 'javascriptreact', 'jsx', 29 | 'typescript', 'typescriptreact', 'tsx', 30 | 'rescript', 31 | 'svelte', 32 | 'vue', 33 | 'xml', 34 | 'php', 35 | 'markdown', 36 | 'glimmer','handlebars','hbs' 37 | }, 38 | 39 | skip_tags = { 40 | 'area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'slot', 41 | 'input', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr', 'menuitem' 42 | } 43 | }) 44 | 45 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 46 | -- ━━━━━━━━━━━━━━━━━❰ end configs ❱━━━━━━━━━━━━━━━━━ -- 47 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 48 | 49 | -------------------------------------------------------------------------------- /lua/plugins/indentLine.lua: -------------------------------------------------------------------------------- 1 | --"--------------------------------------------------------------------- 2 | --" PluginName: indentLine 3 | --" Github: github.com/Yggdroot/indentLine 4 | --"--------------------------------------------------------------------- 5 | -- 6 | -- 7 | -- 8 | -- 9 | -- 10 | --"--------------------------------------------------------------------- 11 | --" CONFIGS 12 | --"--------------------------------------------------------------------- 13 | -- 14 | --" Change Conceal Behaviour 15 | --" This plugin enables the Vim conceal feature which automatically hides stretches of text based on syntax highlighting. 16 | --" For example, users utilizing the built in json.vim syntax file will no longer see quotation marks in their JSON files. 17 | --" so for .json file, disable conceal Behaviour 18 | 19 | vim.cmd([[ autocmd BufRead,BufNewFile *.json let g:indentLine_setConceal = 0 ]]) 20 | 21 | --" enable/disable indent line guide 22 | vim.g.indentLine_enabled = 1 23 | 24 | --" Change Indent Char 25 | vim.g.indentLine_char = '▏' 26 | --" to display more beautiful lines. 27 | --" let g:indentLine_char_list = ['|', '¦', '┆', '┊'] 28 | -- 29 | --" customize conceal color(indent line guide color ) 30 | vim.g.indentLine_color_gui = '#222F22' 31 | 32 | --"--------------------------------------------------------------------- 33 | --" end of CONFIGS 34 | --"--------------------------------------------------------------------- 35 | -- 36 | -------------------------------------------------------------------------------- /lua/plugins/hop_nvim.lua: -------------------------------------------------------------------------------- 1 | 2 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 3 | -- ───────────────────────────────────────────────── -- 4 | -- Plugin: hop.nvim 5 | -- Github: github.com/phaazon/hop.nvim 6 | -- ───────────────────────────────────────────────── -- 7 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 8 | 9 | 10 | 11 | 12 | 13 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 14 | -- ━━━━━━━━━━━━━━━━━━━❰ configs ❱━━━━━━━━━━━━━━━━━━━ -- 15 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 16 | 17 | local imported_hop, hop = pcall(require, "hop") 18 | if not imported_hop then return end 19 | 20 | hop.setup { 21 | keys = 'qwertyuiopasdfghjklzxcvbnm', 22 | jump_on_sole_occurrence = false 23 | } 24 | 25 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 26 | -- ━━━━━━━━━━━━━━━━━❰ end configs ❱━━━━━━━━━━━━━━━━━ -- 27 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 28 | 29 | 30 | 31 | 32 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 33 | -- ━━━━━━━━━━━━━━━━━━━❰ Mappings ❱━━━━━━━━━━━━━━━━━━ -- 34 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 35 | 36 | local keymap = vim.api.nvim_set_keymap 37 | local options = {noremap = true, silent = true} 38 | 39 | keymap( 'n', 'f', "lua require'hop'.hint_words()", options) 40 | 41 | 42 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 43 | -- ━━━━━━━━━━━━━━━━━❰ end Mappings ❱━━━━━━━━━━━━━━━━ -- 44 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 45 | 46 | -------------------------------------------------------------------------------- /init.lua: -------------------------------------------------------------------------------- 1 | 2 | -- Author: Ali Shahid 3 | -- Github: github.com/shaeinst 4 | 5 | 6 | 7 | -- ───────────────────────────────────────────────── -- 8 | -- ────────────────❰ Leader Mapping ❱─────────────── -- 9 | -- mapping leader here. it will work for every mapped 10 | 11 | vim.g.mapleader = ';' 12 | vim.g.maplocalleader = '|' 13 | -- ───────────────────────────────────────────────── -- 14 | 15 | 16 | 17 | 18 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 19 | -- ━━━━━━━━━━━━━❰ Load/Source Configs ❱━━━━━━━━━━━━━ -- 20 | 21 | -- plugin config to improve start-up time. 22 | -- it should be always on the top of init.lua file 23 | require('plugins/impatient_nvim') -- impatient needs to be setup before any other lua plugin is loaded so it is recommended you add the following near the start of your 24 | 25 | require('configs') -- plugin independent configs 26 | require('mappings') -- plugin independent mappings 27 | require('customs/abstractline') -- status line 28 | require('customs/override_defalut') -- always put this config(override_defalut) at last because it's use to overide the any already defined config 29 | 30 | -- load/source PLUGINS CONFIGS 31 | -- loading plugins and its configs are managed in seperate config file, ~/.config/nvim/lua/plugins/packer_nvim.lua 32 | -- NOTE: always load plugins at last 33 | require('packer_nvim') 34 | 35 | -- ━━━━━━━━━━━━━━━━━❰ end of Load ❱━━━━━━━━━━━━━━━━━ -- 36 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 37 | 38 | -------------------------------------------------------------------------------- /lua/plugins/commits.lua: -------------------------------------------------------------------------------- 1 | 2 | return { 3 | Abstract_cs = "", 4 | alpha_nvim = "", 5 | awesome_flutter_snippets = "", 6 | bracey_vim = "", 7 | Comment_nvim = "", 8 | cmp_buffer = "", 9 | cmp_luasnip = "", 10 | cmp_nvim_lsp = "", 11 | cmp_nvim_lsp_signature_help = "", 12 | cmp_nvim_lua = "", 13 | cmp_path = "", 14 | dart_vim_plugin = "", 15 | editorconfig_nvim = "", 16 | feline_nvim = "", 17 | fidget_nvim = "", 18 | filetype_nvim = "", 19 | flutter_tools_nvim = "", 20 | friendly_snippets = "", 21 | gitsigns_nvim = "", 22 | goto_preview = "", 23 | hop_nvim = "", 24 | impatient_nvim = "", 25 | indent_blankline_nvim = "", 26 | lsp_signature_nvim = "", 27 | LuaSnip = "", 28 | mason_lspconfig_nvim = "", 29 | mason_nvim = "", 30 | neovim_session_manager = "", 31 | null_ls_nvim = "", 32 | nvim_autopairs = "", 33 | nvim_bufferline_lua = "", 34 | nvim_cmp = "", 35 | nvim_colorizer_lua = "", 36 | nvim_lsp_installer = "", 37 | nvim_lspconfig = "", 38 | nvim_navic = "", 39 | nvim_surround = "", 40 | nvim_tree_lua = "", 41 | nvim_treesitter = "", 42 | nvim_ts_autotag = "", 43 | nvim_ts_context_commentstring = "", 44 | nvim_web_devicons = "", 45 | packer_nvim = "", 46 | penvim = "", 47 | playground = "", 48 | plenary_nvim = "", 49 | renamer_nvim = "", 50 | scope_nvim = "", 51 | telescope_file_browser_nvim = "", 52 | telescope_fzf_native_nvim = "", 53 | telescope_media_files_nvim = "", 54 | telescope_nvim = "", 55 | telescope_symbols_nvim = "", 56 | telescope_ui_select_nvim = "", 57 | trouble_nvim = "", 58 | vim_floaterm = "", 59 | vim_maximizer = "", 60 | } 61 | -------------------------------------------------------------------------------- /lua/plugins/lspkind-nvim.lua: -------------------------------------------------------------------------------- 1 | 2 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 3 | -- ───────────────────────────────────────────────── -- 4 | -- Plugin: lspkind-nvim 5 | -- Github: github.com/onsails/lspkind-nvim 6 | -- Description: vscode-like pictograms for neovim lsp completion items 7 | -- ───────────────────────────────────────────────── -- 8 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 9 | 10 | 11 | 12 | 13 | 14 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 15 | -- ━━━━━━━━━━━━━━━━━━━❰ configs ❱━━━━━━━━━━━━━━━━━━━ -- 16 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 17 | 18 | local lspkind_imported_ok, lspkind = pcall(require, "lspkind") 19 | if not lspkind_imported_ok then return end 20 | 21 | lspkind.init({ 22 | -- enables text annotations (default: true) 23 | mode = true, 24 | 25 | -- enables text annotations (default: 'default') 26 | -- default symbol map can be either 'default' or 'codicons' for codicon preset (requires vscode-codicons font installed) 27 | preset = 'codicons', 28 | 29 | -- override preset symbols (default: {}) 30 | symbol_map = { 31 | Text = '', 32 | Method = 'ƒ', 33 | Function = '', 34 | Constructor = '', 35 | Variable = '', 36 | Class = '', 37 | Interface = 'ﰮ', 38 | Module = '', 39 | Property = '', 40 | Unit = '', 41 | Value = '', 42 | Enum = '了', 43 | Keyword = '', 44 | Snippet = '﬌', 45 | Color = '', 46 | File = '', 47 | Folder = '', 48 | EnumMember = '', 49 | Constant = '', 50 | Struct = '', 51 | }, 52 | }) 53 | 54 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 55 | -- ━━━━━━━━━━━━━━━━━❰ end configs ❱━━━━━━━━━━━━━━━━━ -- 56 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 57 | 58 | -------------------------------------------------------------------------------- /lua/plugins/vimspector.lua: -------------------------------------------------------------------------------- 1 | 2 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 3 | -- ───────────────────────────────────────────────── -- 4 | -- Plugin: vimspector 5 | -- Github: github.com/puremourning/vimspector 6 | -- ───────────────────────────────────────────────── -- 7 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 8 | 9 | 10 | 11 | 12 | 13 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 14 | -- ━━━━━━━━━━━━━━━━━━━❰ configs ❱━━━━━━━━━━━━━━━━━━━ -- 15 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 16 | 17 | local g = vim.g 18 | 19 | g.vimspector_enable_mappings = 'HUMAN' 20 | 21 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 22 | -- ━━━━━━━━━━━━━━━━━❰ end configs ❱━━━━━━━━━━━━━━━━━ -- 23 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 24 | 25 | 26 | 27 | 28 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 29 | -- ━━━━━━━━━━━━━━━━━━━❰ Mappings ❱━━━━━━━━━━━━━━━━━━ -- 30 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 31 | 32 | local keymap = vim.api.nvim_set_keymap 33 | local options = {noremap = true, silent = true} 34 | -- local cmd = vim.cmd 35 | -- cmd([[ autocmd BufEnter * nmap silent q :bd ]]) 36 | 37 | keymap('n', 'dd', ':call vimspector#Launch()', options) 38 | keymap('n', 'dr', ':VimspectorReset', options) 39 | keymap('n', 'de', ':VimspectorEval ', options) 40 | keymap('n', 'dw', ':VimspectorWatch ', options) 41 | keymap('n', 'do', ':VimspectorShowOutput', options) 42 | 43 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 44 | -- ━━━━━━━━━━━━━━━━━❰ end Mappings ❱━━━━━━━━━━━━━━━━ -- 45 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 46 | 47 | -------------------------------------------------------------------------------- /lua/plugins/neoscroll_nvim.lua: -------------------------------------------------------------------------------- 1 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 2 | --─────────────────────────────────────────────────-- 3 | -- Plugin: neoscroll.nvim 4 | -- Github: github.com/karb94/neoscroll.nvim 5 | --─────────────────────────────────────────────────-- 6 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 7 | 8 | 9 | 10 | 11 | 12 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 13 | --━━━━━━━━━━━━━━━━━━━❰ configs ❱━━━━━━━━━━━━━━━━━━━-- 14 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 15 | 16 | require('neoscroll').setup({ 17 | easing_function = "quadratic" -- Default easing function 18 | -- Set any other options as needed 19 | }) 20 | 21 | 22 | 23 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 24 | --━━━━━━━━━━━━━━━━━❰ end configs ❱━━━━━━━━━━━━━━━━━-- 25 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 26 | 27 | 28 | 29 | 30 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 31 | --━━━━━━━━━━━━━━━━━━━❰ Mappings ❱━━━━━━━━━━━━━━━━━━━-- 32 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 33 | local t = {} 34 | -- Syntax: t[keys] = {function, {function arguments}} 35 | t[''] = {'scroll', {'-vim.wo.scroll', 'true', '250'}} 36 | t[''] = {'scroll', { 'vim.wo.scroll', 'true', '250'}} 37 | t[''] = {'scroll', {'-vim.api.nvim_win_get_height(0)', 'true', '450'}} 38 | t[''] = {'scroll', { 'vim.api.nvim_win_get_height(0)', 'true', '450'}} 39 | t[''] = {'scroll', {'-0.10', 'false', '100'}} 40 | t[''] = {'scroll', { '0.10', 'false', '100'}} 41 | t['zt'] = {'zt', {'250'}} 42 | t['zz'] = {'zz', {'250'}} 43 | t['zb'] = {'zb', {'250'}} 44 | 45 | require('neoscroll.config').set_mappings(t) 46 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 47 | --━━━━━━━━━━━━━━━━━❰ end Mappings ❱━━━━━━━━━━━━━━━━-- 48 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 49 | 50 | -------------------------------------------------------------------------------- /lua/plugins/indent-blankline_nvim.lua: -------------------------------------------------------------------------------- 1 | 2 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 3 | -- ───────────────────────────────────────────────── -- 4 | -- Plugin: indent-blankline.nvim 5 | -- Github: github.com/lukas-reineke/indent-blankline.nvim 6 | -- ───────────────────────────────────────────────── -- 7 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 8 | 9 | 10 | 11 | 12 | 13 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 14 | -- ━━━━━━━━━━━━━━━━━━━❰ configs ❱━━━━━━━━━━━━━━━━━━━ -- 15 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 16 | 17 | --[===[ 18 | NOTE: 19 | to know more about filetype_exclude and buftype_exclude 20 | https://github.com/lukas-reineke/indent-blankline.nvim/issues/284 21 | :set buftype 22 | --]===] 23 | 24 | local ibl_import, ibl = pcall(require, "ibl") 25 | if not ibl_import then return end 26 | 27 | ibl.setup { 28 | 29 | debounce = 100, 30 | indent = { 31 | char = "▎", -- | ¦ ┆ ┊ ║ ▎ 32 | tab_char= "▎", 33 | smart_indent_cap = true, 34 | priority = 2, 35 | highlight = { 36 | "IndentBlanklineIndent1", "IndentBlanklineIndent2", "IndentBlanklineIndent3", "IndentBlanklineIndent4", 37 | "IndentBlanklineIndent5", "IndentBlanklineIndent6", "IndentBlanklineIndent7", "IndentBlanklineIndent8", 38 | }, 39 | }, 40 | whitespace = { 41 | highlight = { "Whitespace", "NonText" }, 42 | remove_blankline_trail = true, 43 | }, 44 | scope = { 45 | enabled = true, 46 | }, 47 | exclude = { 48 | filetypes = { 49 | "rust", "lspinfo", "packer", "checkhealth", "help", "man", "gitcommit", "TelescopePrompt", 50 | "TelescopeResults", 'startify', 'alpha', 'dashboard', 'neogitstatus', 'NvimTree', '', 51 | }, 52 | buftypes = { "terminal",'nofile', }, 53 | } 54 | } 55 | 56 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 57 | -- ━━━━━━━━━━━━━━━━━❰ end configs ❱━━━━━━━━━━━━━━━━━ -- 58 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 59 | 60 | -------------------------------------------------------------------------------- /lua/plugins/fterm_nvim.lua: -------------------------------------------------------------------------------- 1 | 2 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 3 | -- ───────────────────────────────────────────────── -- 4 | -- Plugin: FTerm.nvim 5 | -- Github: github.com/numtostr/FTerm.nvim 6 | -- ───────────────────────────────────────────────── -- 7 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 8 | 9 | 10 | 11 | 12 | 13 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 14 | -- ━━━━━━━━━━━━━━━━━━━❰ configs ❱━━━━━━━━━━━━━━━━━━━ -- 15 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 16 | 17 | require'FTerm'.setup({ 18 | -- Filetype of the terminal buffer 19 | ft = 'FTerm', 20 | -- Command to run inside the terminal. It could be a `string` or `table` 21 | cmd = os.getenv('SHELL'), 22 | -- Neovim's native window border. See `:h nvim_open_win` for more configuration options. 23 | border = 'single', 24 | -- Close the terminal as soon as shell/command exits. 25 | -- Disabling this will mimic the native terminal behaviour. 26 | auto_close = true, 27 | -- Highlight group for the terminal. See `:h winhl` 28 | hl = 'Normal', 29 | -- Transparency of the floating window. See `:h winblend` 30 | blend = 0, 31 | -- Object containing the terminal window dimensions. 32 | -- The value for each field should be between `0` and `1` 33 | dimensions = { 34 | height = 0.8, -- Height of the terminal window 35 | width = 0.8, -- Width of the terminal window 36 | x = 0.5, -- X axis of the terminal window 37 | y = 0.5, -- Y axis of the terminal window 38 | }, 39 | -- Callback invoked when the terminal exits. 40 | -- See `:h jobstart-options` 41 | on_exit = nil, 42 | -- Callback invoked when the terminal emits stdout data. 43 | -- See `:h jobstart-options` 44 | on_stdout = nil, 45 | -- Callback invoked when the terminal emits stderr data. 46 | -- See `:h jobstart-options` 47 | on_stderr = nil, 48 | }) 49 | 50 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 51 | -- ━━━━━━━━━━━━━━━━━❰ end configs ❱━━━━━━━━━━━━━━━━━ -- 52 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 53 | 54 | -------------------------------------------------------------------------------- /lua/plugins/nvim-colorizer_lua.lua: -------------------------------------------------------------------------------- 1 | 2 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 3 | -- ───────────────────────────────────────────────── -- 4 | -- Plugin: nvim-colorizer.lua 5 | -- Github: github.com/NvChad/nvim-colorizer.lua 6 | -- ───────────────────────────────────────────────── -- 7 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 8 | 9 | 10 | 11 | 12 | 13 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 14 | -- ━━━━━━━━━━━━━━━━━━━❰ configs ❱━━━━━━━━━━━━━━━━━━━ -- 15 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 16 | 17 | -- safely import colorizer 18 | local colorizer_imported_ok, colorizer = pcall(require, 'colorizer') 19 | if not colorizer_imported_ok then return end 20 | 21 | colorizer.setup { 22 | 23 | user_default_options = { 24 | -- RGB = true, -- #RGB hex codes 25 | -- RRGGBB = true, -- #RRGGBB hex codes 26 | names = false, -- "Name" codes like Blue or blue 27 | RRGGBBAA = true, -- #RRGGBBAA hex codes 28 | AARRGGBB = true, -- 0xAARRGGBB hex codes 29 | rgb_fn = true, -- CSS rgb() and rgba() functions 30 | hsl_fn = true, -- CSS hsl() and hsla() functions 31 | -- css = true, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB 32 | -- css_fn = true, -- Enable all CSS *functions*: rgb_fn, hsl_fn 33 | -- Available modes for `mode`: foreground, background, virtualtext 34 | mode = "background", -- Set the display mode. 35 | virtualtext = "■", 36 | }, 37 | 38 | -- all the sub-options of filetypes apply to buftypes 39 | filetypes = { 40 | '*', -- Highlight all files, but customize some others. 41 | css = { rgb_fn = true, names = true }, 42 | -- html = { names = false; }, -- Disable parsing "names" like Blue or Gray 43 | -- '!vim', -- Exclude vim from highlighting. 44 | -- 'javascript', -- Highlight for javascript file 45 | -- html = { mode = 'foreground'; } 46 | }, 47 | 48 | buftypes = {}, 49 | } 50 | 51 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 52 | -- ━━━━━━━━━━━━━━━━━❰ end configs ❱━━━━━━━━━━━━━━━━━ -- 53 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 54 | 55 | -------------------------------------------------------------------------------- /lua/plugins/hydra_nvim.lua: -------------------------------------------------------------------------------- 1 | 2 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 3 | -- ───────────────────────────────────────────────── -- 4 | -- Plugin: hydra.nvim 5 | -- Github: github.com/anuvyklack/hydra.nvim 6 | -- ───────────────────────────────────────────────── -- 7 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 8 | 9 | 10 | 11 | 12 | 13 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 14 | -- ━━━━━━━━━━━━━━━━━━━❰ configs ❱━━━━━━━━━━━━━━━━━━━ -- 15 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 16 | 17 | local imported_hydra, Hydra = pcall(require, 'hydra') 18 | if not imported_hydra then return end 19 | 20 | Hydra({ 21 | hint = [[ 22 | ^^^^^^ Move ^^^^^^ ^^ Split ^^^^ Size 23 | ^^^^^^--------------^^^^^^ ^^--------------- ^^^^------------- 24 | ^ ^ _k_ ^ ^ ^ ^ _K_ ^ ^ _s_: horizontally _+_ _-_: height 25 | _h_ ^ ^ _l_ _H_ ^ ^ _L_ _v_: vertically _>_ _<_: width 26 | ^ ^ _j_ ^ ^ ^ ^ _J_ ^ ^ _q_: close ^ _=_ ^: equalize 27 | focus^^^^^^ window^^^^^^ 28 | ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ __ 29 | ]], 30 | config = { 31 | -- timeout = 4000, 32 | invoke_on_body = false, 33 | hint = { 34 | border = 'rounded', 35 | -- position = 'bottom', 36 | }, 37 | }, 38 | mode = 'n', 39 | body = '', 40 | heads = { 41 | -- Move focus 42 | {'h', 'h'}, 43 | {'j', 'j'}, 44 | {'k', 'k'}, 45 | {'l', 'l'}, 46 | -- Move window 47 | {'H', 'WinShift left'}, 48 | {'J', 'WinShift down'}, 49 | {'K', 'WinShift up'}, 50 | {'L', 'WinShift right'}, 51 | -- Split 52 | {'s', 's'}, 53 | {'v', 'v'}, 54 | {'q', 'try | close | catch | endtry', {desc = 'close window'}}, 55 | -- Size 56 | {'+', '+'}, 57 | {'-', '-'}, 58 | {'>', '2>', {desc = 'increase width'}}, 59 | {'<', '2<', {desc = 'decrease width'}}, 60 | {'=', '=', {desc = 'equalize'}}, 61 | -- 62 | {'', nil, {exit = true}}, 63 | }, 64 | }) 65 | 66 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 67 | -- ━━━━━━━━━━━━━━━━━❰ end Mappings ❱━━━━━━━━━━━━━━━━ -- 68 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 69 | 70 | -------------------------------------------------------------------------------- /lua/plugins/LuaSnip.lua: -------------------------------------------------------------------------------- 1 | 2 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 3 | -- ───────────────────────────────────────────────── -- 4 | -- Plugin: LuaSnip 5 | -- Github: github.com/L3MON4D3/LuaSnip 6 | -- ───────────────────────────────────────────────── -- 7 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 8 | 9 | 10 | 11 | 12 | 13 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 14 | -- ━━━━━━━━━━━━━━━━━━━❰ configs ❱━━━━━━━━━━━━━━━━━━━ -- 15 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 16 | 17 | local import_ls, luasnip = pcall(require, "luasnip") 18 | if not import_ls then return end 19 | 20 | luasnip.config.set_config({ 21 | history = false, -- If true, Snippets that were exited can still be jumped back into. 22 | update_events = "TextChanged,TextChangedI", -- Update more often, :h events for more info. 23 | region_check_events = "CursorMoved", -- Ref: https://github.com/L3MON4D3/LuaSnip/issues/91 24 | }) 25 | 26 | 27 | -- enable html snippets in javascript/javascript(REACT) 28 | luasnip.filetype_extend("javascriptreact", {"html"}) 29 | luasnip.filetype_extend("typescriptreact", {"html"}) 30 | 31 | -- enable html snippets in Django (htmldjango) 32 | luasnip.filetype_extend("htmldjango", {"html"}) 33 | 34 | -- this will lazy load all filetypes 35 | require("luasnip/loaders/from_vscode").lazy_load() 36 | 37 | -- lazy loading so you only get in memory snippets of languages you use 38 | require'luasnip/loaders/from_vscode'.lazy_load({ 39 | paths = {"~/.config/nvim/extra/snippets"}, 40 | }) 41 | 42 | -- ───────────────────────────────────────────────── -- 43 | -- NOTE: not working, need some fix 44 | -- firendl-snippets 45 | local filetype = vim.bo.filetype 46 | 47 | if filetype == "javascriptreact" then 48 | require("luasnip/loaders/from_vscode").load({include = {"javascriptreact"}}) 49 | return 50 | end 51 | if filetype == "typescriptreact" then 52 | require("luasnip/loaders/from_vscode").load({include = {"typescriptreact"}}) 53 | return 54 | end 55 | -- ───────────────────────────────────────────────── -- 56 | 57 | 58 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 59 | -- ━━━━━━━━━━━━━━━━━❰ end configs ❱━━━━━━━━━━━━━━━━━ -- 60 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 61 | 62 | -------------------------------------------------------------------------------- /lua/customs/override_defalut.lua: -------------------------------------------------------------------------------- 1 | 2 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 3 | -- ─────────────────────────────────────────────── -- 4 | -- Override configs 5 | -- this config file is used to override the already defined config/mappings. 6 | -- This make config more readable and less complicated. 7 | 8 | -- ─────────────────────────────────────────────── -- 9 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 10 | 11 | 12 | 13 | 14 | 15 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 16 | -- ━━━━━━━━━━━━━━━━━━❰ configs ❱━━━━━━━━━━━━━━━━━━ -- 17 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 18 | 19 | --[===[ Examples for Config 20 | 21 | local exec = vim.api.nvim_exec -- execute Vimscript 22 | local opt = vim.opt -- global options 23 | local cmd = vim.cmd -- execute Vim commands 24 | local fn = vim.fn -- call Vim functions 25 | local g = vim.g -- global variables 26 | local b = vim.bo -- buffer-scoped options 27 | local w = vim.wo -- windows-scoped options 28 | 29 | -- don't automatically wrap on load 30 | opt.wrap = false 31 | 32 | -- highlight on yank 33 | exec([[ 34 | augroup YankHighlight 35 | autocmd! 36 | autocmd TextYankPost * silent! lua vim.highlight.on_yank{higroup="IncSearch", timeout=500, on_visual=true} 37 | augroup end 38 | ]], false) 39 | 40 | -- 4 spaces for selected filetypes 41 | cmd([[ autocmd FileType python,c,cpp setlocal shiftwidth=4 tabstop=4 ]]) 42 | 43 | ]===] 44 | 45 | 46 | 47 | 48 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 49 | -- ━━━━━━━━━━━━━━━━❰ end configs ❱━━━━━━━━━━━━━━━━ -- 50 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 51 | 52 | 53 | 54 | 55 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 56 | -- ━━━━━━━━━━━━━━━━━━❰ Mappings ❱━━━━━━━━━━━━━━━━━ -- 57 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 58 | 59 | --[===[ Examples for Config 60 | local keymap = vim.api.nvim_set_keymap 61 | 62 | -- to save file 63 | keymap('i', '', ':w ', { noremap=true, silent=true }) 64 | 65 | ]===] 66 | 67 | 68 | 69 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 70 | -- ━━━━━━━━━━━━━━━━❰ end Mappings ❱━━━━━━━━━━━━━━━ -- 71 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 72 | 73 | -------------------------------------------------------------------------------- /lua/plugins/fidget_nivm.lua: -------------------------------------------------------------------------------- 1 | 2 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 3 | -- ───────────────────────────────────────────────── -- 4 | -- Plugin: fidget.nvim 5 | -- Github: github.com/j-hui/fidget.nvim 6 | -- ───────────────────────────────────────────────── -- 7 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 8 | 9 | 10 | 11 | 12 | 13 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 14 | -- ━━━━━━━━━━━━━━━━━━━❰ configs ❱━━━━━━━━━━━━━━━━━━━ -- 15 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 16 | 17 | local imported_fidget, fidget = pcall(require, "fidget") 18 | if not imported_fidget then return end 19 | 20 | fidget.setup { 21 | text = { 22 | spinner = "pipe", -- animation shown when tasks are ongoing 23 | done = "✔", -- character shown when all tasks are complete 24 | commenced = "Started", -- message shown when task starts 25 | completed = "Completed", -- message shown when task completes 26 | }, 27 | align = { 28 | bottom = false, -- align fidgets along bottom edge of buffer 29 | right = true, -- align fidgets along right edge of buffer 30 | }, 31 | timer = { 32 | spinner_rate = 125, -- frame rate of spinner animation, in ms 33 | fidget_decay = 2000, -- how long to keep around empty fidget, in ms 34 | task_decay = 1000, -- how long to keep around completed task, in ms 35 | }, 36 | window = { 37 | relative = "win", -- where to anchor, either "win" or "editor" 38 | blend = 0, -- &winblend for the window 39 | zindex = nil, -- the zindex value for the window 40 | }, 41 | fmt = { 42 | leftpad = true, -- right-justify text in fidget box 43 | stack_upwards = false, -- list of tasks grows upwards 44 | max_width = 0, -- maximum width of the fidget box 45 | fidget = function(fidget_name, spinner) -- function to format fidget title 46 | return string.format("%s %s", spinner, fidget_name) 47 | end, 48 | task = function(task_name, message, percentage) -- function to format each task line 49 | return string.format( 50 | "%s%s [%s]", 51 | message, 52 | percentage and string.format(" (%s%%)", percentage) or "", 53 | task_name 54 | ) 55 | end, 56 | }, 57 | } 58 | 59 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 60 | -- ━━━━━━━━━━━━━━━━━❰ end configs ❱━━━━━━━━━━━━━━━━━ -- 61 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 62 | 63 | -------------------------------------------------------------------------------- /lua/plugins/barbar_nvim.lua: -------------------------------------------------------------------------------- 1 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 2 | --─────────────────────────────────────────────────-- 3 | -- Plugin: barbar.nvim 4 | -- Github: github.com/romgrk/barbar.nvim 5 | --─────────────────────────────────────────────────-- 6 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 7 | 8 | 9 | 10 | 11 | 12 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 13 | --━━━━━━━━━━━━━━━━━━━❰ configs ❱━━━━━━━━━━━━━━━━━━━-- 14 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 15 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 16 | --━━━━━━━━━━━━━━━━━❰ end configs ❱━━━━━━━━━━━━━━━━━-- 17 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 28 | --━━━━━━━━━━━━━━━━━━━❰ Mappings ❱━━━━━━━━━━━━━━━━━━━-- 29 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 30 | 31 | local keymap = vim.api.nvim_set_keymap 32 | local options = { noremap=true, silent=true } 33 | 34 | 35 | -- Move to previous/next 36 | keymap('n', '', ':BufferNext', options) 37 | keymap('n', '', ':BufferPrevious', options) 38 | -- Goto buffer in position... 39 | keymap('n', '1', ':BufferGoto 1', options) 40 | keymap('n', '2', ':BufferGoto 2', options) 41 | keymap('n', '3', ':BufferGoto 3', options) 42 | keymap('n', '4', ':BufferGoto 4', options) 43 | keymap('n', '5', ':BufferGoto 5', options) 44 | keymap('n', '6', ':BufferGoto 6', options) 45 | keymap('n', '7', ':BufferGoto 7', options) 46 | keymap('n', '8', ':BufferGoto 8', options) 47 | keymap('n', '9', ':BufferGoto 9', options) 48 | 49 | -- Re-order to previous/next 50 | keymap('n', ',', ':BufferMovePrevious 9', options) 51 | keymap('n', '.', ':BufferMoveNext 9', options) 52 | 53 | 54 | -- Close buffer 55 | -- nnoremap :BufferClose 56 | keymap('n', 'q', ':BufferClose', options) 57 | 58 | -- Magic buffer-picking mode 59 | keymap('n', 'm', ':BufferPick', options) 60 | 61 | 62 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 63 | --━━━━━━━━━━━━━━━━━❰ end Mappings ❱━━━━━━━━━━━━━━━━-- 64 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 65 | 66 | -------------------------------------------------------------------------------- /lua/plugins/neovim-session-manager.lua: -------------------------------------------------------------------------------- 1 | 2 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 3 | -- ───────────────────────────────────────────────── -- 4 | -- Plugin: neovim-session-manager 5 | -- Github: github.com/Shatur/neovim-session-manager 6 | -- ───────────────────────────────────────────────── -- 7 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 8 | 9 | 10 | 11 | 12 | 13 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 14 | -- ━━━━━━━━━━━━━━━━━━━❰ configs ❱━━━━━━━━━━━━━━━━━━━ -- 15 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 16 | 17 | -- safely import session_manager 18 | local session_imported, session = pcall(require, 'session_manager') 19 | if not session_imported then return end 20 | 21 | session.setup({ 22 | sessions_dir = vim.fn.stdpath('data').."/.cache/sessions", -- The directory where the session files will be saved. 23 | path_replacer = '__', -- The character to which the path separator will be replaced for session files. 24 | colon_replacer = '++', -- The character to which the colon symbol will be replaced for session files. 25 | autoload_mode = require('session_manager.config').AutoloadMode.Disabled, -- Define what to do when Neovim is started without arguments. Possible values: Disabled, CurrentDir, LastSession 26 | autosave_last_session = true, -- Automatically save last session on exit and on session switch. 27 | autosave_ignore_not_normal = true, -- Plugin will not save a session when no buffers are opened, or all of them aren't writable or listed. 28 | autosave_ignore_filetypes = { -- All buffers of these file types will be closed before the session is saved. 29 | 'gitcommit', 30 | }, 31 | autosave_only_in_session = false, -- Always autosaves session. If true, only autosaves after a session is active. 32 | max_path_length = 80, -- Shorten the display path if length exceeds this threshold. Use 0 if don't want to shorten the path at all. 33 | }) 34 | 35 | 36 | -- -- if you would like to have NvimTree or any other file tree automatically opened after a session load, 37 | -- local config_group = vim.api.nvim_create_augroup('MyConfigGroup', {}) -- A global group for all your config autocommands 38 | -- vim.api.nvim_create_autocmd( 39 | -- { 'SessionLoadPost' }, { 40 | -- group = config_group, 41 | -- callback = function() 42 | -- require('nvim-tree').toggle(false, true) 43 | -- end, 44 | -- }) 45 | 46 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 47 | -- ━━━━━━━━━━━━━━━━━❰ end configs ❱━━━━━━━━━━━━━━━━━ -- 48 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 49 | 50 | -------------------------------------------------------------------------------- /lua/plugins/kommentary.lua: -------------------------------------------------------------------------------- 1 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 2 | --─────────────────────────────────────────────────-- 3 | -- Plugin: kommentary 4 | -- Github: github.com/b3nj5m1n/kommentary 5 | --─────────────────────────────────────────────────-- 6 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 7 | 8 | 9 | 10 | 11 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 12 | --━━━━━━━━━━━━━━━━━━━❰ configs ❱━━━━━━━━━━━━━━━━━━━-- 13 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 14 | 15 | -- For global 16 | require('kommentary.config').configure_language( 17 | "default", 18 | { 19 | prefer_single_line_comments = true, 20 | } 21 | ) 22 | 23 | --Configure unsupported language 24 | require('kommentary.config').configure_language( 25 | "Rust", 26 | { 27 | single_line_comment_string = "//", 28 | multi_line_comment_strings = {"/*", "*/"}, 29 | } 30 | ) 31 | 32 | require('kommentary.config').configure_language( 33 | "cpp", 34 | { 35 | single_line_comment_string = "//", 36 | multi_line_comment_strings = {"/*", "*/"}, 37 | } 38 | ) 39 | 40 | 41 | 42 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 43 | --━━━━━━━━━━━━━━━━━❰ end configs ❱━━━━━━━━━━━━━━━━━-- 44 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 53 | --━━━━━━━━━━━━━━━━━━❰ Mappings ❱━━━━━━━━━━━━━━━━━━━-- 54 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 55 | -- If you don't want to use the default mappings, 56 | vim.g.kommentary_create_default_mappings = false 57 | 58 | 59 | --[[ 60 | vim.api.nvim_set_keymap("n", "cic", "kommentary_line_increase", {}) 61 | vim.api.nvim_set_keymap("n", "ci", "kommentary_motion_increase", {}) 62 | vim.api.nvim_set_keymap("x", "ci", "kommentary_visual_increase", {}) 63 | vim.api.nvim_set_keymap("n", "cdc", "kommentary_line_decrease", {}) 64 | vim.api.nvim_set_keymap("n", "cd", "kommentary_motion_decrease", {}) 65 | vim.api.nvim_set_keymap("x", "cd", "kommentary_visual_decrease", {}) 66 | ]] 67 | 68 | vim.api.nvim_set_keymap("n", "cc", "kommentary_line_default", {}) 69 | vim.api.nvim_set_keymap("n", "cm", "kommentary_motion_default", {}) 70 | vim.api.nvim_set_keymap("x", "cmc", "kommentary_visual_default", {}) 71 | 72 | 73 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 74 | --━━━━━━━━━━━━━━━━━❰ end Mappings ❱━━━━━━━━━━━━━━━━-- 75 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 76 | 77 | -------------------------------------------------------------------------------- /lua/plugins/nvim-surround.lua: -------------------------------------------------------------------------------- 1 | 2 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 3 | -- ───────────────────────────────────────────────── -- 4 | -- Plugin: nvim-surround 5 | -- Github: github.com/kylechui/nvim-surround 6 | -- Description: Add/change/delete surrounding delimiter pairs with ease. 7 | -- ───────────────────────────────────────────────── -- 8 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 9 | 10 | 11 | 12 | 13 | 14 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 15 | -- ━━━━━━━━━━━━━━━━━━━❰ configs ❱━━━━━━━━━━━━━━━━━━━ -- 16 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 17 | 18 | local imported_surround, surround = pcall(require, 'nvim-surround') 19 | if not imported_surround then return end 20 | 21 | 22 | surround.setup({ 23 | keymaps = { -- vim-surround style keymaps 24 | visual = "S", 25 | delete = "ds", 26 | change = "cs", 27 | insert = "s", 28 | -- insert_line = "S", 29 | -- normal = "ys", 30 | -- normal_cur = "yss", 31 | -- normal_line = "yS", 32 | -- normal_cur_line = "ySS", 33 | -- visual_line = "gS", 34 | }, 35 | surrounds = { 36 | ["("] = { add = { "( ", " )" }, }, 37 | [")"] = { add = { "(", ")" }, }, 38 | ["{"] = { add = { "{ ", " }" }, }, 39 | ["}"] = { add = { "{", "}" }, }, 40 | ["<"] = { add = { "< ", " >" }, }, 41 | [">"] = { add = { "<", ">" }, }, 42 | ["["] = { add = { "[ ", " ]" }, }, 43 | ["]"] = { add = { "[", "]" }, }, 44 | ["'"] = { add = { "'", "'" }, }, 45 | ['"'] = { add = { '"', '"' }, }, 46 | ["`"] = { add = { "`", "`" }, }, 47 | }, 48 | aliases = { 49 | ["a"] = ">", -- Single character aliases apply everywhere 50 | ["b"] = ")", 51 | ["B"] = "}", 52 | ["r"] = "]", 53 | -- Table aliases only apply for changes/deletions 54 | ["q"] = { '"', "'", "`" }, -- Any quote character 55 | ["s"] = { ")", "]", "}", ">", "'", '"', "`" }, -- Any surrounding delimiter 56 | }, 57 | highlight= { -- Highlight before inserting/changing surrounds 58 | duration = 0, 59 | }, 60 | move_cursor = "begin", 61 | }) 62 | 63 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 64 | -- ━━━━━━━━━━━━━━━━━❰ end configs ❱━━━━━━━━━━━━━━━━━ -- 65 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 66 | 67 | -------------------------------------------------------------------------------- /lua/plugins/vsnip.lua: -------------------------------------------------------------------------------- 1 | --"--------------------------------------------------------------------- 2 | --" PluginName: vim-vsnip 3 | --" Github: github.com/hrsh7th/vim-vsnip 4 | -- 5 | --"--------------------------------------------------------------------- 6 | 7 | 8 | 9 | 10 | --"--------------------------------------------------------------------- 11 | --" CONFIGS 12 | --"--------------------------------------------------------------------- 13 | --" location to store vsnip files 14 | vim.g.vsnip_snippet_dir = vim.fn.expand('~/.config/nvim/extra/snippets/vsnip') 15 | 16 | -- How to use LSP snippet? 17 | local capabilities = vim.lsp.protocol.make_client_capabilities() 18 | capabilities.textDocument.completion.completionItem.snippetSupport = true 19 | capabilities.textDocument.completion.completionItem.resolveSupport = { 20 | properties = { 21 | 'documentation', 22 | 'detail', 23 | 'additionalTextEdits', 24 | } 25 | } 26 | 27 | require'lspconfig'.rust_analyzer.setup { 28 | capabilities = capabilities, 29 | } 30 | --------------------------------------------------------------------- 31 | -- end of CONFIGS 32 | --------------------------------------------------------------------- 33 | 34 | 35 | 36 | 37 | 38 | ----------------------------------------------------------------------- 39 | -- MAPPINGS 40 | ----------------------------------------------------------------------- 41 | 42 | --[[ 43 | -- we difine moving in lua/plugin_configs/compe.lua file because vicompie and 44 | -- vsnip could conflict or override one another's mappig so we defined Mapping 45 | -- smartly so that it will work for both without any unexpected result 46 | 47 | -- pmenu and vim-vsnip 48 | local keymap = vim.api.nvim_set_keymap 49 | options = {silent=true, expr=true} 50 | 51 | 52 | -- Jump forward or backward 53 | -- pmenu and vim-vsnip 54 | keymap('i', '', "pumvisible() ? '' : vsnip#jumpable(1) ? '(vsnip-jump-next)' : ''", options) 55 | keymap('i', '', "pumvisible() ? '' : vsnip#jumpable(-1) ? '(vsnip-jump-prev)' : ''", options) 56 | -- vim-vsnip 57 | keymap('s', '', "vsnip#jumpable(1) ? '(vsnip-jump-next)' : ''", options) 58 | keymap('s', '', "vsnip#jumpable(-1) ? '(vsnip-jump-prev)' : ''", options) 59 | ]] 60 | --------------------------------------------------------------------- 61 | -- enf of MAPPINGS 62 | --------------------------------------------------------------------- 63 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /lua/plugins/Comment_nvim.lua: -------------------------------------------------------------------------------- 1 | 2 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 3 | -- ───────────────────────────────────────────────── -- 4 | -- Plugin: Comment.nvim 5 | -- Github: github.com/numToStr/Comment.nvim 6 | -- ───────────────────────────────────────────────── -- 7 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 8 | 9 | 10 | 11 | 12 | 13 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 14 | -- ━━━━━━━━━━━━━━━━━━━❰ configs ❱━━━━━━━━━━━━━━━━━━━ -- 15 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 16 | 17 | -- safely import Comment 18 | local comment_imported_ok, comment = pcall(require, 'Comment') 19 | if not comment_imported_ok then return end 20 | 21 | comment.setup({ 22 | ---Add a space b/w comment and the line 23 | ---@type boolean 24 | padding = true, 25 | 26 | ---Whether the cursor should stay at its position 27 | ---NOTE: This only affects NORMAL mode mappings and doesn't work with dot-repeat 28 | ---@type boolean 29 | sticky = true, 30 | 31 | ---Lines to be ignored while comment/uncomment. 32 | ---Could be a regex string or a function that returns a regex string. 33 | ---Example: Use '^$' to ignore empty lines 34 | ---@type string|function 35 | ignore = '^$', 36 | 37 | ---Pre-hook, called before commenting the line 38 | ---@type function|nil 39 | -- NOTE: Already implemented with JoosepAlviste/nvim-ts-context-commentstring 40 | -- pre_hook = nil, 41 | 42 | ---Post-hook, called after commenting is done 43 | ---@type function|nil 44 | post_hook = nil, 45 | 46 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 47 | -- ━━━━━━━━━━━━━━━━━❰ end configs ❱━━━━━━━━━━━━━━━━━ -- 48 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 49 | 50 | 51 | 52 | 53 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 54 | -- ━━━━━━━━━━━━━━━━━━━❰ Mappings ❱━━━━━━━━━━━━━━━━━━━ -- 55 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 56 | 57 | mappings = { 58 | basic = true, ---Includes `gcc`, `gcb`, `gc[count]{motion}` and `gb[count]{motion}` 59 | extra = true, ---Includes `gco`, `gcO`, `gcA` 60 | extended = false, ---Includes `g>`, `g<`, `g>[count]{motion}` and `g<[count]{motion}` 61 | }, 62 | 63 | ---LHS of toggle mapping in NORMAL 64 | ---@type table 65 | toggler = { 66 | line = 'cc', ---line-comment keymap 67 | block = 'cb', ---block-comment keymap 68 | }, 69 | 70 | ---LHS of operator-pending mapping in VISUAL mode 71 | ---@type table 72 | opleader = { 73 | line = 'gc', ---line-comment keymap 74 | block = 'gb', ---block-comment keymap 75 | }, 76 | }) 77 | 78 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 79 | -- ━━━━━━━━━━━━━━━━━❰ end Mappings ❱━━━━━━━━━━━━━━━━ -- 80 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 81 | 82 | -------------------------------------------------------------------------------- /lua/plugins/nvim-autopairs.lua: -------------------------------------------------------------------------------- 1 | 2 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 3 | -- ─────────────────────────────────────────────────-- 4 | -- Plugin: nvim-autopairs 5 | -- Github: github.com/windwp/nvim-autopairs 6 | -- ─────────────────────────────────────────────────-- 7 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 8 | 9 | 10 | 11 | 12 | 13 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 14 | -- ━━━━━━━━━━━━━━━━━━━❰ Configs ❱━━━━━━━━━━━━━━━━━━━ -- 15 | 16 | -- safely import nvim-autopairs 17 | local autopairs_imported_ok, autopairs = pcall(require, 'nvim-autopairs') 18 | if not autopairs_imported_ok then return end 19 | 20 | autopairs.setup({ 21 | enable_check_bracket_line = true, -- Don't add pairs if it already have a close pairs in same line 22 | disable_filetype = {"TelescopePrompt", "vim"}, -- 23 | enable_afterquote = false, -- add bracket pairs after quote 24 | enable_moveright = true, 25 | 26 | -- use treesitter to check for a pair. 27 | check_ts = true, 28 | ts_config = { 29 | -- lua = {'string'},-- it will not add a pair on that treesitter node 30 | -- javascript = {'template_string', 'string'}, 31 | -- java = false,-- don't check treesitter on java 32 | } 33 | 34 | }) 35 | 36 | -- this is nvim-cmp Plugin dependent setting 37 | -- If you want insert `(` after select function or method item 38 | local cmp_autopairs = require('nvim-autopairs.completion.cmp') 39 | if not cmp_autopairs then return end 40 | 41 | local import_cmp, cmp = pcall(require, 'cmp') 42 | if not import_cmp then return end 43 | cmp.event:on( 'confirm_done', cmp_autopairs.on_confirm_done()) 44 | 45 | local Rule = require('nvim-autopairs.rule') 46 | 47 | autopairs.add_rules { 48 | -- before insert after 49 | -- (|) ( |) ( | ) 50 | Rule(' ', ' '):with_pair( 51 | function(opts) 52 | local pair = opts.line:sub(opts.col - 1, opts.col) 53 | return vim.tbl_contains({'()', '[]', '{}'}, pair) 54 | end 55 | ), 56 | Rule('( ', ' )'):with_pair(function() return false end):with_move( 57 | function(opts) return opts.prev_char:match('.%)') ~= nil end):use_key(')'), 58 | Rule('{ ', ' }'):with_pair(function() return false end):with_move( 59 | function(opts) return opts.prev_char:match('.%}') ~= nil end):use_key('}'), 60 | Rule('[ ', ' ]'):with_pair(function() return false end):with_move( 61 | function(opts) return opts.prev_char:match('.%]') ~= nil end):use_key(']'), 62 | --[===[ 63 | arrow key on javascript 64 | Before Insert After 65 | (item)= > (item)=> { } 66 | --]===] 67 | -- Rule('%(.*%)%s*%=>$', ' { }', {'typescript', 'typescriptreact', 'javascript'}):use_regex( true):set_end_pair_length(2), 68 | } 69 | 70 | -- ━━━━━━━━━━━━━━━━━❰ end Configs ❱━━━━━━━━━━━━━━━━━ -- 71 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 72 | 73 | -------------------------------------------------------------------------------- /lua/plugins/alpha-nvim.lua: -------------------------------------------------------------------------------- 1 | 2 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 3 | -- ───────────────────────────────────────────────── -- 4 | -- Plugin: alpha-nvim 5 | -- Github: github.com/goolord/alpha-nvim 6 | -- ───────────────────────────────────────────────── -- 7 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 8 | 9 | 10 | 11 | 12 | 13 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 14 | -- ━━━━━━━━━━━━━━━━━━━❰ configs ❱━━━━━━━━━━━━━━━━━━━ -- 15 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 16 | 17 | local alpha_ok, alpha = pcall(require, "alpha") 18 | if not alpha_ok then return end 19 | 20 | local dashboard_ok, dashboard = pcall(require, "alpha.themes.dashboard") 21 | if not dashboard_ok then return end 22 | 23 | -- set highlights 24 | vim.api.nvim_set_hl(0, "AlphaDashboard", {fg="#1D918B"}) 25 | dashboard.section.header.opts.hl = 'AlphaDashboard' 26 | dashboard.section.footer.opts.hl = 'AlphaDashboard' 27 | 28 | 29 | local function footer() 30 | local datetime_ok, datetime = pcall(os.date, " %I:%M:%p (%d-%m-%Y)") 31 | local version = vim.version() 32 | local nvim_verion = string.format("v%d.%d.%d ", version.major, version.minor, version.patch ) 33 | if not datetime_ok then 34 | return nvim_verion 35 | end 36 | return nvim_verion .. " | " .. datetime 37 | end 38 | 39 | 40 | -- Set header 41 | dashboard.section.header.val = { 42 | "┃█████ ", 43 | "┃██ ██ ", 44 | "┃██ ██ ", 45 | "┃██ ████████", 46 | "┃██ ██ ", 47 | "┃██ ██", 48 | } 49 | 50 | 51 | -- Set menu 52 | local options = {} 53 | local update_cmd = ":FloatermNew cd ~/.config/nvim/ && " 54 | update_cmd = update_cmd .. "echo updating configs... && " 55 | update_cmd = update_cmd .. "git pull && " 56 | update_cmd = update_cmd .. "echo updating plugins... && " 57 | update_cmd = update_cmd .. "nvim --headless -c 'autocmd User PackerComplete quitall' -c PackerSync && " 58 | update_cmd = update_cmd .. "echo updated && " 59 | update_cmd = update_cmd .. " " 60 | dashboard.section.buttons.val = { 61 | dashboard.button("n", " New file", ":ene startinsert ", options), 62 | dashboard.button("r", " Recent", ":Telescope oldfiles", options), 63 | dashboard.button("s", "s Sessions", ":SessionManager load_session", options), 64 | dashboard.button("f", "🔎 Find file", ":Telescope find_files", options), 65 | dashboard.button("u", "🔨 Update Plugins", update_cmd, options), 66 | dashboard.button("q", " Quit NVIM", ":qa", options), 67 | } 68 | 69 | dashboard.section.footer.val = footer() 70 | 71 | -- Send config to alpha 72 | alpha.setup(dashboard.opts) 73 | 74 | -- Disable folding on alpha buffer 75 | vim.cmd([[ 76 | autocmd FileType alpha setlocal nofoldenable 77 | ]]) 78 | 79 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 80 | -- ━━━━━━━━━━━━━━━━━❰ end configs ❱━━━━━━━━━━━━━━━━━ -- 81 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 82 | 83 | -------------------------------------------------------------------------------- /lua/plugins/nvim-ts-context-commentstring.lua: -------------------------------------------------------------------------------- 1 | 2 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 3 | -- ───────────────────────────────────────────────── -- 4 | -- Plugin: nvim-ts-context-commentstring 5 | -- Github: github.com/JoosepAlviste/nvim-ts-context-commentstring 6 | -- ───────────────────────────────────────────────── -- 7 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 8 | 9 | 10 | 11 | 12 | 13 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 14 | -- ━━━━━━━━━━━━━━━━━━━❰ configs ❱━━━━━━━━━━━━━━━━━━━ -- 15 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 16 | 17 | -- safely import tree-sitter 18 | local treesitter_imported_ok, treesitter = pcall(require, 'nvim-treesitter.configs') 19 | if not treesitter_imported_ok then return end 20 | 21 | treesitter.setup { 22 | context_commentstring = { 23 | enable = true, 24 | enable_autocmd = false, 25 | 26 | config = { 27 | javascript = { 28 | __default = '// %s', 29 | jsx_element = '{/* %s */}', 30 | jsx_fragment = '{/* %s */}', 31 | jsx_attribute = '// %s', 32 | comment = '// %s', 33 | __parent = { 34 | -- if a node has this as the parent, use the `//` commentstring 35 | jsx_expression = '// %s', 36 | }, 37 | }, 38 | css = '// %s', 39 | } 40 | }, 41 | } 42 | 43 | -- safely import Comment 44 | local comment_imported_ok, comment = pcall(require, 'Comment') 45 | if not comment_imported_ok then return end 46 | 47 | comment.setup({ 48 | 49 | -- Integration of nvim-ts-context-commentstring to numToStr/Comment.nvim 50 | ---Pre-hook, called before commenting the line 51 | -- NOTE: Comment.nvim already supports treesitter out-of-the-box except for tsx/jsx. 52 | pre_hook = function(ctx) 53 | -- Only calculate commentstring for jsx/tsx filetypes 54 | local filetype = vim.bo.filetype 55 | if filetype == 'typescriptreact' or filetype == "javascriptreact" then 56 | local import_U, U = pcall(require, 'Comment.utils') 57 | if not import_U then return end 58 | -- Determine whether to use linewise or blockwise commentstring 59 | local type = ctx.ctype == U.ctype.linewise and '__default' or '__multiline' 60 | -- Determine the location where to calculate commentstring from 61 | local location = nil 62 | if ctx.ctype == U.ctype.blockwise then 63 | location = require('ts_context_commentstring.utils').get_cursor_location() 64 | elseif ctx.cmotion == U.cmotion.v or ctx.cmotion == U.cmotion.V then 65 | location = require('ts_context_commentstring.utils').get_visual_start_location() 66 | end 67 | return require('ts_context_commentstring.internal').calculate_commentstring({ 68 | key = type, 69 | location = location, 70 | }) 71 | end 72 | end, 73 | }) 74 | 75 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 76 | -- ━━━━━━━━━━━━━━━━━❰ end configs ❱━━━━━━━━━━━━━━━━━ -- 77 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 78 | 79 | -------------------------------------------------------------------------------- /lua/plugins/formatter.lua: -------------------------------------------------------------------------------- 1 | 2 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 3 | -- ───────────────────────────────────────────────── -- 4 | -- Plugin: formatter.nvim 5 | -- Github: github.com/mhartington/formatter.nvim 6 | -- ───────────────────────────────────────────────── -- 7 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 8 | 9 | 10 | 11 | 12 | 13 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 14 | -- ━━━━━━━━━━━━━━━━━━━❰ configs ❱━━━━━━━━━━━━━━━━━━━ -- 15 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 16 | 17 | require('formatter').setup({ 18 | logging = false, 19 | 20 | filetype = { 21 | -- C++ 22 | cpp = { 23 | function() 24 | return { 25 | exe = "clang-format", 26 | args = { 27 | '-assume-filename=', 28 | vim.fn.shellescape(vim.api.nvim_buf_get_name(0)), 29 | '-style="{BasedOnStyle: Microsoft, UseTab: Always}"' 30 | }, 31 | stdin = true 32 | } 33 | end 34 | }, 35 | 36 | -- C 37 | c = { 38 | function() 39 | return { 40 | exe = "clang-format", 41 | args = { 42 | '-assume-filename=', 43 | vim.fn.shellescape(vim.api.nvim_buf_get_name(0)), 44 | '-style="{BasedOnStyle: Microsoft, UseTab: Always}"' 45 | }, 46 | stdin = true 47 | } 48 | end 49 | }, 50 | 51 | -- Python 52 | python = {function() return {exe = "yapf", stdin = true} end}, 53 | 54 | -- Javascript 55 | javascript = { 56 | function() 57 | return { 58 | exe = "js-beautify", 59 | args = {'--indent-size 4', '--max-preserve-newlines 3'}, 60 | stdin = true 61 | } 62 | end 63 | }, 64 | 65 | -- Lua 66 | lua = { 67 | function() 68 | return { 69 | exe = "lua-format", 70 | args = {'--indent-width 1', '--tab-width 4', '--use-tab'}, 71 | stdin = true 72 | } 73 | end 74 | } 75 | } 76 | 77 | }) 78 | 79 | -- Format on save 80 | -- To enable format on save, you can create a autocmd to trigger the formater using FormatWrite, 81 | -- which will format and write to the current saved file. 82 | -- vim.api.nvim_exec([[ 83 | -- augroup FormatAutogroup 84 | -- autocmd! 85 | -- autocmd BufWritePost *.py,*.c,*.cpp,*.js FormatWrite 86 | -- augroup END 87 | -- ]], true) 88 | 89 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 90 | -- ━━━━━━━━━━━━━━━━━❰ end configs ❱━━━━━━━━━━━━━━━━━ -- 91 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 92 | 93 | 94 | 95 | 96 | 97 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 98 | -- ━━━━━━━━━━━━━━━━━━━❰ Mappings ❱━━━━━━━━━━━━━━━━━━ -- 99 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 100 | 101 | -- local keymap = vim.api.nvim_set_keymap 102 | -- keymap('n', 'fm', ':Format', {noremap = true, silent = true}) 103 | 104 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 105 | -- ━━━━━━━━━━━━━━━━━❰ end Mappings ❱━━━━━━━━━━━━━━━━ -- 106 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 107 | 108 | -------------------------------------------------------------------------------- /lua/plugins/renamer_nvim.lua: -------------------------------------------------------------------------------- 1 | 2 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 3 | -- ───────────────────────────────────────────────── -- 4 | -- Plugin: renamer.nvim 5 | -- Github: github.com/filipdutescu/renamer.nvim 6 | -- ───────────────────────────────────────────────── -- 7 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 8 | 9 | 10 | 11 | 12 | 13 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 14 | -- ━━━━━━━━━━━━━━━━━━━❰ configs ❱━━━━━━━━━━━━━━━━━━━ -- 15 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 16 | 17 | local imported_renamer, renamer = pcall(require, 'renamer') 18 | if not imported_renamer then return end 19 | 20 | local mappings_utils = require('renamer.mappings.utils') 21 | 22 | renamer.setup { 23 | -- The popup title, shown if `border` is true 24 | title = 'Rename', 25 | -- The padding around the popup content 26 | padding = { top = 0, left = 0, bottom = 0, right = 0, }, 27 | -- The minimum width of the popup 28 | min_width = 15, 29 | -- The maximum width of the popup 30 | max_width = 45, 31 | -- Whether or not to shown a border around the popup 32 | border = true, 33 | -- The characters which make up the border 34 | border_chars = { '─', '│', '─', '│', '╭', '╮', '╯', '╰' }, 35 | -- Whether or not to highlight the current word references through LSP 36 | show_refs = true, 37 | -- Whether or not to add resulting changes to the quickfix list 38 | with_qf_list = true, 39 | -- Whether or not to enter the new name through the UI or Neovim's `input` prompt 40 | with_popup = true, 41 | -- The keymaps available while in the `renamer` buffer. The example below 42 | -- overrides the default values, but you can add others as well. 43 | -- Custom handler to be run after successfully renaming the word. Receives 44 | -- the LSP 'textDocument/rename' raw response as its parameter. 45 | handler = nil, 46 | 47 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 48 | -- ━━━━━━━━━━━━━━━━━❰ end configs ❱━━━━━━━━━━━━━━━━━ -- 49 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 50 | 51 | 52 | 53 | 54 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 55 | -- ━━━━━━━━━━━━━━━━━━━❰ Mappings ❱━━━━━━━━━━━━━━━━━━ -- 56 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 57 | -- mappings for renamer popup window 58 | mappings = { 59 | [''] = mappings_utils.set_cursor_to_start, 60 | [''] = mappings_utils.set_cursor_to_end, 61 | [''] = mappings_utils.set_cursor_to_word_end, 62 | [''] = mappings_utils.set_cursor_to_word_start, 63 | [''] = mappings_utils.clear_line, 64 | [''] = mappings_utils.undo, 65 | [''] = mappings_utils.redo, 66 | }, 67 | } 68 | 69 | -- to rename 70 | local options = {noremap = true, silent = true} 71 | local keymap = vim.api.nvim_set_keymap 72 | keymap('n', 'R', 'lua require("renamer").rename()', options) 73 | keymap('v', 'R', 'lua require("renamer").rename()', options) 74 | 75 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 76 | -- ━━━━━━━━━━━━━━━━━❰ end Mappings ❱━━━━━━━━━━━━━━━━ -- 77 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 78 | 79 | -------------------------------------------------------------------------------- /lua/plugins/bubbly_nvim.lua: -------------------------------------------------------------------------------- 1 | vim.g.bubbly_tabline = 1 2 | vim.g.bubbly_statusline = { 3 | 'mode', 4 | 'path', 5 | 'filetype', 6 | 7 | 'divisor', 8 | 'progress', 9 | } 10 | 11 | 12 | vim.g.bubbly_palette = { 13 | background = "#1B1717", 14 | foreground = "Black", 15 | black = "Black", 16 | red = "Red", 17 | green = "Green", 18 | yellow = "Yellow", 19 | blue = "Blue", 20 | purple = "Magenta", 21 | cyan = "Cyan", 22 | white = "White", 23 | lightgrey = "LightGrey", 24 | darkgrey = "Grey", 25 | } 26 | 27 | 28 | vim.g.bubbly_characters = { 29 | -- Bubble delimiters 30 | left = '', 31 | right = '', 32 | -- Close character for the tabline 33 | close = 'x', 34 | -- Bubble separators 35 | bubble_separator = '', 36 | } 37 | 38 | 39 | 40 | vim.g.bubbly_symbols = { 41 | default = 'PANIC!', 42 | 43 | path = { 44 | readonly = 'RO', 45 | unmodifiable = '', 46 | modified = '*', 47 | }, 48 | signify = { 49 | added = '+%s', -- requires 1 '%s' 50 | modified = '~%s', -- requires 1 '%s' 51 | removed = '-%s', -- requires 1 '%s' 52 | }, 53 | coc = { 54 | error = 'E%s', -- requires 1 '%s' 55 | warning = 'W%s', -- requires 1 '%s' 56 | }, 57 | builtinlsp = { 58 | diagnostic_count = { 59 | error = 'E%s', -- requires 1 '%s' 60 | warning = 'W%s', --requires 1 '%s' 61 | }, 62 | }, 63 | branch = ' %s', -- requires 1 '%s' 64 | total_buffer_number = '﬘ %s', --requires 1 '%d' 65 | lsp_status = { 66 | diagnostics = { 67 | error = 'E%d', 68 | warning = 'W%d', 69 | hint = 'H%d', 70 | info = 'I%d', 71 | }, 72 | }, 73 | } 74 | 75 | 76 | 77 | 78 | 79 | vim.g.bubbly_colors = { 80 | default = 'red', 81 | 82 | mode = { 83 | normal = 'Blue', -- uses by default 'background' as the foreground color. 84 | insert = 'Red', 85 | visual = 'White', 86 | visualblock = 'red', 87 | command = 'red', 88 | terminal = 'blue', 89 | replace = 'yellow', 90 | default = 'white' 91 | }, 92 | path = { 93 | readonly = { background = 'lightgrey', foreground = 'foreground' }, 94 | unmodifiable = { background = 'darkgrey', foreground = 'foreground' }, 95 | path = 'white', 96 | modified = { background = 'lightgrey', foreground = 'foreground' }, 97 | }, 98 | branch = 'purple', 99 | signify = { 100 | added = 'green', 101 | modified = 'blue', 102 | removed = 'red', 103 | }, 104 | paste = 'red', 105 | builtinlsp = { 106 | diagnostic_count = { 107 | error = 'red', 108 | warning = 'yellow', 109 | }, 110 | current_function = 'purple', 111 | }, 112 | filetype = 'blue', 113 | progress = { 114 | rowandcol = { background = 'lightgrey', foreground = 'foreground' }, 115 | percentage = { background = 'darkgrey', foreground = 'foreground' }, 116 | }, 117 | tabline = { 118 | active = 'blue', 119 | inactive = 'white', 120 | close = 'darkgrey', 121 | }, 122 | total_buffer_number = 'cyan', 123 | lsp_status = { 124 | messages = 'white', 125 | diagnostics = { 126 | error = 'red', 127 | warning = 'yellow', 128 | hint = 'white', 129 | info = 'blue', 130 | }, 131 | }, 132 | } 133 | -------------------------------------------------------------------------------- /lua/plugins/nvim-lsp-installer.lua: -------------------------------------------------------------------------------- 1 | 2 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 3 | -- ───────────────────────────────────────────────── -- 4 | -- Plugin: nvim-lsp-installer 5 | -- Github: github.com/williamboman/nvim-lsp-installer 6 | -- ───────────────────────────────────────────────── -- 7 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 8 | 9 | 10 | 11 | 12 | 13 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 14 | -- ━━━━━━━━━━━━━━━━━━━❰ configs ❱━━━━━━━━━━━━━━━━━━━ -- 15 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 16 | 17 | local M = {} 18 | 19 | M.setup = { 20 | 21 | -- A list of servers to automatically install if they're not already installed. Example: { "rust_analyzer", "sumneko_lua" } 22 | -- This setting has no relation with the `automatic_installation` setting. 23 | -- ensure_installed = {"sumneko_lua"}, 24 | 25 | -- Whether servers that are set up (via lspconfig) should be automatically installed if they're not already installed. 26 | -- This setting has no relation with the `ensure_installed` setting. 27 | -- Can either be: 28 | -- - false: Servers are not automatically installed. 29 | -- - true: All servers set up via lspconfig are automatically installed. 30 | -- - { exclude: string[] }: All servers set up via lspconfig, except the ones provided in the list, are automatically installed. 31 | -- Example: automatic_installation = { exclude = { "rust_analyzer", "solargraph" } } 32 | automatic_installation = false, 33 | 34 | ui = { 35 | -- Whether to automatically check for outdated servers when opening the UI window. 36 | check_outdated_servers_on_open = true, 37 | -- The border to use for the UI window. Accepts same border values as |nvim_open_win()|. 38 | border = "rounded", 39 | icons = { 40 | server_installed = "✓", 41 | server_pending = "➜", 42 | server_uninstalled = "✗", 43 | }, 44 | keymaps = { 45 | -- Keymap to expand a server in the UI 46 | toggle_server_expand = "", 47 | -- Keymap to install the server under the current cursor position 48 | install_server = "i", 49 | -- Keymap to reinstall/update the server under the current cursor position 50 | update_server = "u", 51 | -- Keymap to check for new version for the server under the current cursor position 52 | check_server_version = "c", 53 | -- Keymap to update all installed servers 54 | update_all_servers = "U", 55 | -- Keymap to check which installed servers are outdated 56 | check_outdated_servers = "C", 57 | -- Keymap to uninstall a server 58 | uninstall_server = "X", 59 | }, 60 | }, 61 | 62 | -- The directory in which to install all servers. 63 | -- install_root_dir = path.concat { vim.fn.stdpath "data", "lsp_servers" }, 64 | 65 | -- Controls to which degree logs are written to the log file. It's useful to set this to vim.log.levels.DEBUG when 66 | -- debugging issues with server installations. 67 | log_level = vim.log.levels.INFO, 68 | 69 | -- Limit for the maximum amount of servers to be installed at the same time. Once this limit is reached, any further 70 | -- servers that are requested to be installed will be put in a queue. 71 | max_concurrent_installers = 4, 72 | } 73 | 74 | return M 75 | 76 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 77 | -- ━━━━━━━━━━━━━━━━━❰ end configs ❱━━━━━━━━━━━━━━━━━ -- 78 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 79 | 80 | -------------------------------------------------------------------------------- /lua/plugins/mason_nvim.lua: -------------------------------------------------------------------------------- 1 | 2 | 3 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 4 | -- ───────────────────────────────────────────────── -- 5 | -- Plugin: mason.nvim 6 | -- Github: github.com/williamboman/mason.nvim 7 | -- ───────────────────────────────────────────────── -- 8 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 9 | 10 | 11 | 12 | 13 | 14 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 15 | -- ━━━━━━━━━━━━━━━━━━━❰ configs ❱━━━━━━━━━━━━━━━━━━━ -- 16 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 17 | 18 | local M = {} 19 | 20 | M.setup = { 21 | 22 | ui = { 23 | -- The border to use for the UI window. Accepts same border values as |nvim_open_win()|. 24 | border = "rounded", 25 | 26 | icons = { 27 | -- The list icon to use for installed packages. 28 | package_installed = "✓", 29 | -- The list icon to use for packages that are installing, or queued for installation. 30 | package_pending = "➜", 31 | -- The list icon to use for packages that are not installed. 32 | package_uninstalled = "✗", 33 | }, 34 | 35 | keymaps = { 36 | -- Keymap to expand a package 37 | toggle_package_expand = "", 38 | -- Keymap to install the package under the current cursor position 39 | install_package = "i", 40 | -- Keymap to reinstall/update the package under the current cursor position 41 | update_package = "u", 42 | -- Keymap to check for new version for the package under the current cursor position 43 | check_package_version = "c", 44 | -- Keymap to update all installed packages 45 | update_all_packages = "U", 46 | -- Keymap to check which installed packages are outdated 47 | check_outdated_packages = "C", 48 | -- Keymap to uninstall a package 49 | uninstall_package = "X", 50 | -- Keymap to cancel a package installation 51 | cancel_installation = "", 52 | -- Keymap to apply language filter 53 | apply_language_filter = "", 54 | }, 55 | }, 56 | 57 | -- The directory in which to install packages. 58 | -- install_root_dir = path.concat { vim.fn.stdpath "data", "mason" }, 59 | 60 | pip = { 61 | -- These args will be added to `pip install` calls. Note that setting extra args might impact intended behavior 62 | -- and is not recommended. 63 | -- 64 | -- Example: { "--proxy", "https://proxyserver" } 65 | install_args = {}, 66 | }, 67 | 68 | -- Controls to which degree logs are written to the log file. It's useful to set this to vim.log.levels.DEBUG when 69 | -- debugging issues with package installations. 70 | log_level = vim.log.levels.INFO, 71 | 72 | -- Limit for the maximum amount of packages to be installed at the same time. Once this limit is reached, any further 73 | -- packages that are requested to be installed will be put in a queue. 74 | max_concurrent_installers = 4, 75 | 76 | github = { 77 | -- The template URL to use when downloading assets from GitHub. 78 | -- The placeholders are the following (in order): 79 | -- 1. The repository (e.g. "rust-lang/rust-analyzer") 80 | -- 2. The release version (e.g. "v0.3.0") 81 | -- 3. The asset name (e.g. "rust-analyzer-v0.3.0-x86_64-unknown-linux-gnu.tar.gz") 82 | download_url_template = "https://github.com/%s/releases/download/%s/%s", 83 | }, 84 | } 85 | 86 | return M 87 | 88 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 89 | -- ━━━━━━━━━━━━━━━━━❰ end configs ❱━━━━━━━━━━━━━━━━━ -- 90 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 91 | 92 | -------------------------------------------------------------------------------- /lua/plugins/flutter-tools_nvim.lua: -------------------------------------------------------------------------------- 1 | 2 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 3 | -- ───────────────────────────────────────────────── -- 4 | -- Plugin: flutter-tools.nvim 5 | -- Github: github.com/akinsho/flutter-tools.nvim 6 | -- ───────────────────────────────────────────────── -- 7 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 8 | 9 | 10 | 11 | 12 | 13 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 14 | -- ━━━━━━━━━━━━━━━━━━━❰ configs ❱━━━━━━━━━━━━━━━━━━━ -- 15 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 16 | 17 | local import_flutter, flutter = pcall(require, 'flutter-tools') 18 | if not import_flutter then return end 19 | 20 | 21 | flutter.setup { 22 | 23 | ui = { 24 | -- the border type to use for all floating windows, the same options/formats 25 | -- used for ":h nvim_open_win" e.g. "single" | "shadow" | {} 26 | border = "rounded", 27 | }, 28 | 29 | debugger = { -- integrate with nvim dap + install dart code debugger 30 | enabled = false, 31 | }, 32 | 33 | widget_guides = {enabled = true}, 34 | closing_tags = { 35 | prefix = "//", -- character to use for close tag e.g. > Widget 36 | enabled = true, -- set to false to disable 37 | }, 38 | 39 | dev_log = { 40 | open_cmd = "tabedit", -- command to use to open the log buffer 41 | }, 42 | 43 | dev_tools = { 44 | autostart = false, -- autostart devtools server if not detected 45 | auto_open_browser = false, -- Automatically opens devtools in the browser 46 | }, 47 | 48 | outline = { 49 | open_cmd = "35vnew", -- command to use to open the outline buffer 50 | }, 51 | } 52 | 53 | --- Telescope Integration 54 | --- In order to set this up, you can explicitly load the extension. 55 | local import_telescope, telescope = pcall(require, 'telescope') 56 | if import_telescope then 57 | telescope.load_extension("flutter") 58 | end 59 | 60 | -- --> Highlights/Colors 61 | -- Widget guides 62 | -- FlutterWidgetGuides - this changes the highlight of the Widget guides 63 | -- Notifications 64 | -- The highlights for flutter-tools notifications and popups can be changed by overriding the default highlight groups 65 | -- FlutterNotificationNormal - this changes the highlight of the notification content. 66 | -- FlutterNotificationBorder - this changes the highlight of the notification border. 67 | -- FlutterPopupNormal - this changes the highlight of the popup content. 68 | -- FlutterPopupBorder - this changes the highlight of the popup border. 69 | -- FlutterPopupSelected - this changes the highlight of the popup's selected line. 70 | 71 | vim.cmd([[ autocmd VimEnter *.dart highlight FlutterWidgetGuides guifg=#8C8C8C ]]) 72 | 73 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 74 | -- ━━━━━━━━━━━━━━━━━❰ end configs ❱━━━━━━━━━━━━━━━━━ -- 75 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 76 | 77 | 78 | 79 | 80 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 81 | -- ━━━━━━━━━━━━━━━━━━━❰ Mappings ❱━━━━━━━━━━━━━━━━━━ -- 82 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 83 | 84 | -- to list available commands in flutter-tools plugin 85 | vim.cmd([[ autocmd VimEnter *.dart nnoremap o :Telescope flutter commands ]]) 86 | 87 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 88 | -- ━━━━━━━━━━━━━━━━━❰ end Mappings ❱━━━━━━━━━━━━━━━━ -- 89 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 90 | 91 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 | 3 |

4 | 5 |

6 | 7 | 8 |
9 | Screenshots 10 | Request Feature 11 | 12 | ![Contributors](https://img.shields.io/github/contributors/Abstract-IDE/Abstract?color=dark-green) ![Issues](https://img.shields.io/github/issues/Abstract-IDE/Abstract) ![License](https://img.shields.io/github/license/Abstract-IDE/Abstract) 13 |
14 | 15 | 16 | 17 | 18 | 19 | ## Table Of Contents 20 | 21 | * [About](#about) 22 | * [Documentaton](#documentaton) 23 | * [Project Stracture](#project-stracture) 24 | * [License](#license) 25 | * [Screenshots](#screenshots) 26 | * [To-do](#to-do) 27 | 28 | 29 | ## About 30 | 31 | Abstract, The NeoVim configuration to achieve the power of Modern IDE 32 | 33 | ![2022-07-25_20-56](https://user-images.githubusercontent.com/41078534/180812465-8e65807c-a25e-4bc6-8abd-38d32538259e.png) 34 | 35 | 36 | 37 | ## Documentaton 38 | more about Abstract and installation can be found on [DOCS](https://abstract-ide.github.io/site/docs/getting-started/installation/abstract) 39 | 40 | 41 | 42 | ### Project Stracture 43 | 44 | ``` 45 | ├── extra/ 46 | │ └── snippets/ / custom defined snippets 47 | │ ... 48 | ├── init.lua / load/source configs | heart of Abstract 49 | ├── lua/ 50 | │ ├── autocmd.lua / auto command configs 51 | │ ├── configs.lua / configs that's don't depends on plugins 52 | │ ├── mappings.lua / mappings that don't depends on plugins 53 | │ ├── packer_nvim.lua / manage plugins 54 | │ ├── customs/ 55 | │ │ ├── override_defalut.lua / configs to override defined config 56 | │ │ └── abstractline.lua / i am working on it. btw it's a status line 57 | │ └── plugins/ / dir containing configs for plugins. each plugin has it's own config and can be locaed through init.lua file 58 | │ ... 59 | ├── plugin/ / auto-created by plugin manager 60 | └── setup.py / python-script to install/update Abstract 61 | ``` 62 | 63 | 64 | 65 | ## License 66 | 67 | Distributed under the MIT License. 68 |

69 | 70 | 71 | 72 | ## Screenshots 73 | ![screenshot_buff_and_nerdtree](https://user-images.githubusercontent.com/41078534/177386049-93fc7a75-2f23-4d53-92a3-9ce8999283bf.png) 74 | ![screenshot_python_lsp](https://user-images.githubusercontent.com/41078534/177386239-f77ea88e-a934-4979-8806-017f39225e9d.png) 75 | ![screenshot_running_c](https://user-images.githubusercontent.com/41078534/177386287-53ea37a3-6349-40f6-b0f3-fcb5942fdb8f.png) 76 | ![screenshot_telescope_as_fuzzy_finder](https://user-images.githubusercontent.com/41078534/177386330-4863acdb-9c66-4f68-9b6a-96f379becf05.png) 77 | ![screenshot_packer](https://user-images.githubusercontent.com/41078534/177386379-955c7ddf-8750-4497-8e94-1d4fde28d6da.png) 78 | ![screenshot_codeaction_in_flutter_app](https://user-images.githubusercontent.com/41078534/177386497-bb984c56-9bf2-40e5-a9df-88f87767feb0.png) 79 |
80 | 81 | 82 | 83 | ## To-Do 84 | 85 | - add installer(setup.py) support for Windows and Mac os 86 | 87 | 88 | 89 | ## Known Bugs 90 | 91 | - there is no known bugs yet. Please open the issue if you find one. 92 | 93 | -------------------------------------------------------------------------------- /lua/plugins/goto-preview.lua: -------------------------------------------------------------------------------- 1 | 2 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 3 | -- ───────────────────────────────────────────────── -- 4 | -- Plugin: goto-preview 5 | -- Github: github.com/rmagatti/goto-preview 6 | -- ───────────────────────────────────────────────── -- 7 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 8 | 9 | 10 | 11 | 12 | 13 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 14 | -- ━━━━━━━━━━━━━━━━━━━❰ configs ❱━━━━━━━━━━━━━━━━━━━ -- 15 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 16 | 17 | local import_goto_preview, goto_preview = pcall(require, "goto-preview") 18 | if not import_goto_preview then return end 19 | local import_themes, telescope_themes = pcall(require, 'telescope.themes') 20 | 21 | goto_preview.setup { 22 | width = 80, -- Width of the floating window 23 | height = 15, -- Height of the floating window 24 | border = {"↖", "─", "┐", "│", "┘", "─", "└", "│"}, -- Border characters of the floating window 25 | default_mappings = false, -- Bind default mappings 26 | debug = false, -- Print debug information 27 | opacity = nil, -- 0-100 opacity level of the floating window where 100 is fully transparent. 28 | resizing_mappings = false, -- Binds arrow keys to resizing the floating window. 29 | -- A function taking two arguments, a buffer and a window to be ran as a hook. 30 | post_open_hook = function() 31 | -- add preview window to buffer list 32 | local buffer_num = vim.api.nvim_get_current_buf() -- current buffer 33 | vim.api.nvim_buf_set_option(buffer_num, "buflisted") 34 | end, 35 | references = { -- Configure the telescope UI for slowing the references cycling window. 36 | telescope = import_themes and { 37 | telescope_themes.get_dropdown { 38 | winblend = 15, 39 | layout_config = {prompt_position = "top", width = 64, height = 15}, 40 | border = {}, 41 | previewer = false, 42 | shorten_path = false, 43 | }, 44 | }, 45 | }, 46 | -- These two configs can also be passed down to the goto-preview definition and implementation calls for one off "peak" functionality. 47 | focus_on_open = true, -- Focus the floating window when opening it. 48 | dismiss_on_move = false, -- Dismiss the floating window when moving the cursor. 49 | force_close = true, -- passed into vim.api.nvim_win_close's second argument. See :h nvim_win_close 50 | bufhidden = "wipe", -- the bufhidden option to set on the floating window. See :h bufhidden 51 | } 52 | 53 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 54 | -- ━━━━━━━━━━━━━━━━━❰ end configs ❱━━━━━━━━━━━━━━━━━ -- 55 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 56 | 57 | 58 | 59 | 60 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 61 | -- ━━━━━━━━━━━━━━━━━━━❰ Mappings ❱━━━━━━━━━━━━━━━━━━ -- 62 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 63 | 64 | local options = { noremap=true } 65 | vim.api.nvim_set_keymap("n", "gpd", "lua require('goto-preview').goto_preview_definition()", options) 66 | vim.api.nvim_set_keymap("n", "gpi", "lua require('goto-preview').goto_preview_implementation()", options) 67 | -- Only set if telescope is installed 68 | vim.api.nvim_set_keymap("n", "gpr", "lua require('goto-preview').goto_preview_references()", options) 69 | 70 | vim.api.nvim_set_keymap("n", "gP", "lua require('goto-preview').close_all_win()", options) 71 | 72 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 73 | -- ━━━━━━━━━━━━━━━━━❰ end Mappings ❱━━━━━━━━━━━━━━━━ -- 74 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 75 | 76 | -------------------------------------------------------------------------------- /lua/plugins/vim_rooter.lua: -------------------------------------------------------------------------------- 1 | -- -------------------------------------------------------------------- 2 | -- PluginName: vim-rooter 3 | -- Github: github.com/airblade/vim-rooter 4 | -- -------------------------------------------------------------------- 5 | 6 | -- HELP NOTE --> 7 | -- Using root-finding functionality in other scripts The public function FindRootDirectory() 8 | -- returns the absolute path to the root directory as a string, 9 | -- if a root directory is found, or an empty string otherwise. 10 | 11 | 12 | 13 | -- -------------------------------------------------------------------- 14 | -- CONFIGS 15 | -- -------------------------------------------------------------------- 16 | -- How to identify a root directory 17 | -- Set g:rooter_patterns to a list of identifiers. They are checked breadth-first as 18 | -- Rooter walks up the directory tree and the first match is used. 19 | 20 | -- To specify the root has a certain directory or file (which may be a glob), just give the name: 21 | vim.cmd([[ let g:rooter_patterns = ['.git', 'Makefile', '*.sln', 'build/env.sh'] ]]) 22 | -- To specify the root is a certain directory, prefix it with =. 23 | -- let g:rooter_patterns = ['=src'] 24 | -- To specify the root has a certain directory as an ancestor (useful for excluding directories), prefix it with ^: 25 | -- let g:rooter_patterns = ['^fixtures'] 26 | -- To specify the root has a certain directory as its direct ancestor / parent (useful when you put working projects in a common directory), prefix it with >: 27 | -- let g:rooter_patterns = ['>Latex'] 28 | -- To exclude a pattern, prefix it with !. 29 | -- let g:rooter_patterns = ['!.git/worktrees', '!=extras', '!^fixtures', '!build/env.sh'] 30 | 31 | -- By default vim-rooter uses :cd to change directory. To use :lcd or :tcd instead: 32 | -- let g:rooter_cd_cmd = 'lcd' 33 | 34 | -- To stop Rooter echoing the project directory: 35 | vim.g.rooter_silent_chdir = 1 36 | 37 | -- By default Rooter doesn't resolve symbolic links in the file or directory which triggers it. To do so: 38 | -- let g:rooter_resolve_links = 1 39 | 40 | 41 | 42 | -- --Which buffers trigger Rooter-- 43 | -- By default all files and directories trigger Rooter. Configure a comma separated list of 44 | -- patterns to specify which files trigger. Include / to trigger on directories. For example: 45 | -- Everything (default) --> let g:rooter_targets = '/,*' 46 | -- All files --> let g:rooter_targets = '*' 47 | -- YAML files --> let g:rooter_targets = '*.yml,*.yaml' 48 | -- Directories and YAML files --> let g:rooter_targets = '/,*.yml,*.yaml' 49 | -- let g:rooter_targets = '$HOME/.config/nvim/configs, ~/codeDNA/dev, $HOME/codeDNA/LearnTeach_Code' 50 | 51 | -- --Non-project files-- 52 | -- Don't change directory (default). --> let g:rooter_change_directory_for_non_project_files = '' 53 | -- Change to file's directory (similar to autochdir). --> let g:rooter_change_directory_for_non_project_files = 'current' 54 | -- Change to home directory. --> let g:rooter_change_directory_for_non_project_files = 'home' 55 | 56 | -- -------------------------------------------------------------------- 57 | -- end of CONFIGS 58 | -- -------------------------------------------------------------------- 59 | 60 | 61 | 62 | 63 | 64 | -- -------------------------------------------------------------------- 65 | -- MAPPINGS 66 | -- -------------------------------------------------------------------- 67 | 68 | -- -------------------------------------------------------------------- 69 | -- enf of MAPPINGS 70 | -- -------------------------------------------------------------------- 71 | 72 | -------------------------------------------------------------------------------- /lua/plugins/nvim-treesitter.lua: -------------------------------------------------------------------------------- 1 | 2 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 3 | -- ───────────────────────────────────────────────── -- 4 | -- Plugin: nvim-treesitter 5 | -- Github: github.com/nvim-treesitter/nvim-treesitter 6 | -- ───────────────────────────────────────────────── -- 7 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 8 | 9 | 10 | 11 | 12 | 13 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 14 | -- ━━━━━━━━━━━━━━━━━━━❰ configs ❱━━━━━━━━━━━━━━━━━━━ -- 15 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 16 | 17 | -- safely import tree-sitter 18 | local treesitter_imported_ok, treesitter = pcall(require, 'nvim-treesitter.configs') 19 | if not treesitter_imported_ok then return end 20 | 21 | 22 | local register = vim.treesitter.language.register 23 | register('html', 'htmldjango') -- enable html parser in htmldjango file 24 | register('bash', 'zsh') -- enable bash parser in zsh file 25 | 26 | 27 | treesitter.setup { 28 | modules = {}, -- this option is not mentioned in doc. i am providing it to hide warning emmiting when editing this config 29 | ensure_installed = {}, -- A list of parser names, or "all" (the five listed parsers should always be installed) 30 | sync_install = false, -- Install parsers synchronously (only applied to `ensure_installed`) 31 | auto_install = false, -- Automatically install missing parsers when entering buffer. Recommendation: set to false if you don't have `tree-sitter` CLI installed locally 32 | ignore_install = {}, -- List of parsers to ignore installing (or "all") 33 | 34 | -- Indentation based on treesitter for the = operator. NOTE: This is an experimental feature. 35 | indent = { 36 | enable = true 37 | }, 38 | 39 | highlight = { 40 | enable = true, -- {"c", "cpp", "dart", "python", "javascript"}, enable = true (false will disable the whole extension) 41 | -- disable lighlight if file is too long 42 | disable = function() -- Disable in large C++ buffers 43 | -- disable highlight if file has > 6000 LOC 44 | return vim.api.nvim_buf_line_count(0) > 6000 45 | -- return lang == "cpp" and vim.api.nvim_buf_line_count(bufnr) > 50000 46 | end, 47 | -- disable = { "c", "rust" }, -- list of language that will be disabled 48 | custom_captures = { 49 | -- Highlight the @foo.bar capture group with the "Identifier" highlight group. 50 | ["foo.bar"] = "Identifier", 51 | }, 52 | -- Setting this to true will run `:h syntax` and tree-sitter at the same time. 53 | -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). 54 | -- Using this option may slow down your editor, and you may see some duplicate highlights. 55 | -- Instead of true it can also be a list of languages 56 | additional_vim_regex_highlighting = true, 57 | }, 58 | 59 | playground = { 60 | enable = true, 61 | disable = {}, 62 | updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code 63 | persist_queries = false, -- Whether the query persists across vim sessions 64 | 65 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 66 | -- ━━━━━━━━━━━━━━━━━❰ end configs ❱━━━━━━━━━━━━━━━━━ -- 67 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 68 | 69 | 70 | 71 | 72 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 73 | -- ━━━━━━━━━━━━━━━━━━━❰ Mappings ❱━━━━━━━━━━━━━━━━━━ -- 74 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 75 | -- keybindings = { 76 | -- toggle_query_editor = 'o', 77 | -- toggle_hl_groups = 'i', 78 | -- toggle_injected_languages = 't', 79 | -- toggle_anonymous_nodes = 'a', 80 | -- toggle_language_display = 'I', 81 | -- focus_language = 'f', 82 | -- unfocus_language = 'F', 83 | -- update = 'R', 84 | -- goto_node = '', 85 | -- show_help = '?' 86 | -- } 87 | }, 88 | } 89 | 90 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 91 | -- ━━━━━━━━━━━━━━━━━❰ end Mappings ❱━━━━━━━━━━━━━━━━ -- 92 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 93 | 94 | -------------------------------------------------------------------------------- /extra/snippets/lua.json: -------------------------------------------------------------------------------- 1 | { 2 | "require": { 3 | "prefix": "req", 4 | "body": ["require(\"${1:module}\")"], 5 | "description": "Require module" 6 | }, 7 | "return": { 8 | "prefix": "rt", 9 | "body": ["return $0"], 10 | "description": "return value" 11 | }, 12 | "assigment": { 13 | "prefix": "ll", 14 | "body": ["local ${1:varName} = ${0:value}"], 15 | "description": "create a variable" 16 | }, 17 | "local": { 18 | "prefix": "l", 19 | "body": ["local ${0}"], 20 | "description": "create a variable" 21 | }, 22 | "locreq": { 23 | "prefix": "lreq", 24 | "body": ["local ${1:var} = require(\"${2:module}\")"], 25 | "description": "Require module as a variable" 26 | }, 27 | "class": { 28 | "prefix": "cl", 29 | "body": [ 30 | "${1:className} = {}\n", 31 | "$1.${2:new} = function($3)", 32 | "\tlocal ${4:varName} = ${5:{}}\n", 33 | "\t${6: --code}\n", 34 | "\treturn $4", 35 | "end" 36 | ], 37 | "description": "Create a class" 38 | }, 39 | "if": { 40 | "prefix": "if", 41 | "body": ["if ${1:true} then", "\t$0", "end"] 42 | }, 43 | "elseif": { 44 | "prefix": "elseif", 45 | "body": ["elseif ${1:true} then", "\t$0"] 46 | }, 47 | "for": { 48 | "prefix": "for", 49 | "body": ["for ${1:i}=${2:1},${3:10} do", "\t$0", "end"], 50 | "description": "for loop range" 51 | }, 52 | "foreach": { 53 | "prefix": "foreach", 54 | "body": ["for i, ${1:x} in pairs(${2:table}) do", "\t$0", "end"] 55 | }, 56 | "forline": { 57 | "prefix": "forline", 58 | "body": [ 59 | "f = io.open(${1:\"${2:filename}\"}, \"${3:r}\")\n", 60 | "while true do", 61 | "\tline = f:read()", 62 | "\tif line == nil then break end\n", 63 | "\t${0:-- code}", 64 | "end" 65 | ], 66 | "description": "read file line by line" 67 | }, 68 | "function": { 69 | "prefix": "fu", 70 | "body": ["function ${1:name}($2)", "\t${3:-- code}", "end"] 71 | }, 72 | "inline-function": { 73 | "prefix": "f=", 74 | "body": ["local ${1:name} = function($2)", "\t${0:-- code}", "end"] 75 | }, 76 | "print": { 77 | "prefix": "p", 78 | "body": ["print(${0})"] 79 | }, 80 | "self": { 81 | "prefix": "self:", 82 | "body": ["function self:${1:methodName}($2)", "\t$0", "end"] 83 | }, 84 | "while": { 85 | "prefix": "while", 86 | "body": ["while ${1:true} do", "\t$0", "end"] 87 | }, 88 | "lua": { 89 | "prefix": "lua", 90 | "body": ["lua << EOF", "$0", "EOF"] 91 | }, 92 | 93 | 94 | "template plugin" : { 95 | "prefix": "template plugin", 96 | "body": [ 97 | "\n", 98 | "-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ --", 99 | "-- ───────────────────────────────────────────────── --", 100 | "-- Plugin: $1", 101 | "-- Github: github.com/$2/$1", 102 | "-- ───────────────────────────────────────────────── --", 103 | "-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ --", 104 | 105 | "\n\n\n\n", 106 | 107 | "-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ --", 108 | "-- ━━━━━━━━━━━━━━━━━━━❰ configs ❱━━━━━━━━━━━━━━━━━━━ --", 109 | "-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ --", 110 | "\n$0\n", 111 | "-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ --", 112 | "-- ━━━━━━━━━━━━━━━━━❰ end configs ❱━━━━━━━━━━━━━━━━━ --", 113 | "-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ --", 114 | 115 | "\n\n\n", 116 | 117 | "-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ --", 118 | "-- ━━━━━━━━━━━━━━━━━━━❰ Mappings ❱━━━━━━━━━━━━━━━━━━ --", 119 | "-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ --", 120 | "\n", 121 | "-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ --", 122 | "-- ━━━━━━━━━━━━━━━━━❰ end Mappings ❱━━━━━━━━━━━━━━━━ --", 123 | "-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ --", 124 | "\n", 125 | "" 126 | ] 127 | } 128 | 129 | } 130 | 131 | -------------------------------------------------------------------------------- /lua/plugins/lsp_signature_nvim.lua: -------------------------------------------------------------------------------- 1 | 2 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 3 | --─────────────────────────────────────────────────-- 4 | -- Plugin: lsp_signature.nvim 5 | -- Github: github.com/ray-x/lsp_signature.nvim 6 | 7 | -- Simple winbar/statusline plugin that shows 8 | -- your current code context 9 | --─────────────────────────────────────────────────-- 10 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 11 | 12 | 13 | 14 | 15 | 16 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 17 | --━━━━━━━━━━━━━━━━━━━❰ configs ❱━━━━━━━━━━━━━━━━━━━-- 18 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 19 | 20 | local import_signature, lsp_signature = pcall(require, "lsp_signature") 21 | if not import_signature then return end 22 | 23 | 24 | local cfg = { 25 | debug = false, -- set to true to enable debug logging 26 | log_path = vim.fn.stdpath("cache") .. "/lsp_signature.log", -- log dir when debug is on 27 | -- default is ~/.cache/nvim/lsp_signature.log 28 | verbose = false, -- show debug line number 29 | 30 | bind = true, -- This is mandatory, otherwise border config won't get registered. 31 | -- If you want to hook lspsaga or other signature handler, pls set to false 32 | doc_lines = 10, -- will show two lines of comment/doc(if there are more than two lines in doc, will be truncated); 33 | -- set to 0 if you DO NOT want any API comments be shown 34 | -- This setting only take effect in insert mode, it does not affect signature help in normal 35 | -- mode, 10 by default 36 | 37 | max_height = 12, -- max height of signature floating_window 38 | max_width = 80, -- max_width of signature floating_window 39 | wrap = true, -- allow doc/signature text wrap inside floating_window, useful if your lsp return doc/sig is too long 40 | 41 | floating_window = true, -- show hint in a floating window, set to false for virtual text only mode 42 | 43 | floating_window_above_cur_line = true, -- try to place the floating above the current line when possible Note: 44 | -- will set to true when fully tested, set to false will use whichever side has more space 45 | -- this setting will be helpful if you do not want the PUM and floating win overlap 46 | 47 | floating_window_off_x = 1, -- adjust float windows x position. 48 | floating_window_off_y = 0, -- adjust float windows y position. e.g -2 move window up 2 lines; 2 move down 2 lines 49 | 50 | close_timeout = 4000, -- close floating window after ms when laster parameter is entered 51 | fix_pos = false, -- set to true, the floating window will not auto-close until finish all parameters 52 | hint_enable = true, -- virtual hint enable 53 | hint_prefix = "🐼 ", -- Panda for parameter, NOTE: for the terminal not support emoji, might crash 54 | hint_scheme = "String", 55 | hi_parameter = "LspSignatureActiveParameter", -- how your parameter will be highlight 56 | handler_opts = { 57 | border = "single", -- double, rounded, single, shadow, none 58 | }, 59 | 60 | always_trigger = false, -- sometime show signature on new line or in middle of parameter can be confusing, set it to false for #58 61 | 62 | auto_close_after = nil, -- autoclose signature float win after x sec, disabled if nil. 63 | extra_trigger_chars = {}, -- Array of extra characters that will trigger signature completion, e.g., {"(", ","} 64 | zindex = 200, -- by default it will be on top of all floating windows, set to <= 50 send it to bottom 65 | 66 | padding = "", -- character to pad on left and right of signature can be ' ', or '|' etc 67 | 68 | transparency = nil, -- disabled by default, allow floating win transparent value 1~100 69 | shadow_blend = 36, -- if you using shadow as border use this set the opacity 70 | shadow_guibg = "Black", -- if you using shadow as border use this set the color e.g. 'Green' or '#121315' 71 | timer_interval = 200, -- default timer check interval set to lower value if you want to reduce latency 72 | toggle_key = nil, -- toggle signature on and off in insert mode, e.g. toggle_key = '' 73 | 74 | select_signature_key = nil, -- cycle to next signature, e.g. '' function overloading 75 | move_cursor_key = nil, -- imap, use nvim_set_current_win to move cursor between current win and floating 76 | } 77 | 78 | -- require'lspconfig'.gopls.setup() 79 | lsp_signature.setup(cfg) 80 | 81 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 82 | --━━━━━━━━━━━━━━━━━❰ end configs ❱━━━━━━━━━━━━━━━━━-- 83 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 84 | 85 | -------------------------------------------------------------------------------- /lua/plugins/trouble_nvim.lua: -------------------------------------------------------------------------------- 1 | 2 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 3 | -- ───────────────────────────────────────────────── -- 4 | -- Plugin: trouble.nvim 5 | -- Github: github.com/folke/trouble.nvim 6 | -- ───────────────────────────────────────────────── -- 7 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 8 | 9 | 10 | 11 | 12 | 13 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 14 | -- ━━━━━━━━━━━━━━━━━━━❰ configs ❱━━━━━━━━━━━━━━━━━━━ -- 15 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 16 | 17 | local import_trouble, trouble = pcall(require, "trouble") 18 | if not import_trouble then return end 19 | 20 | trouble.setup { 21 | position = "bottom", -- position of the list can be: bottom, top, left, right 22 | height = 7, -- height of the trouble list when position is top or bottom 23 | width = 50, -- width of the list when position is left or right 24 | icons = true, -- use devicons for filenames 25 | mode = "workspace_diagnostics", -- lsp_document_diagnostics", "quickfix", "lsp_references", "loclist" 26 | fold_open = "", -- icon used for open folds 27 | fold_closed = "", -- icon used for closed folds 28 | 29 | indent_lines = true, -- add an indent guide below the fold icons 30 | auto_open = false, -- automatically open the list when you have diagnostics 31 | auto_close = true, -- automatically close the list when you have no diagnostics 32 | auto_preview = false, -- automatyically preview the location of the diagnostic. to close preview and go back to last window 33 | auto_fold = false, -- automatically fold a file trouble list at creation 34 | signs = { 35 | -- icons / text used for a diagnostic 36 | error = "", 37 | warning = "", 38 | hint = "", 39 | information = "", 40 | other = "﫠", 41 | }, 42 | use_lsp_diagnostic_signs = false, -- enabling this will use the signs defined in your lsp client 43 | 44 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 45 | -- ━━━━━━━━━━━━━━━━━❰ end configs ❱━━━━━━━━━━━━━━━━━ -- 46 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 47 | 48 | 49 | 50 | 51 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 52 | -- ━━━━━━━━━━━━━━━━━━━❰ Mappings ❱━━━━━━━━━━━━━━━━━━ -- 53 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 54 | 55 | action_keys = { -- key mappings for actions in the trouble list 56 | -- map to {} to remove a mapping, for example: 57 | -- close = {}, 58 | close = "q", -- close the list 59 | cancel = "", -- cancel the preview and get back to your last window / buffer / cursor 60 | refresh = "r", -- manually refresh 61 | jump = {"", ""}, -- jump to the diagnostic or open / close folds 62 | open_split = {""}, -- open buffer in new split 63 | open_vsplit = {""}, -- open buffer in new vsplit 64 | open_tab = {""}, -- open buffer in new tab 65 | jump_close = {"o"}, -- jump to the diagnostic and close the list 66 | toggle_mode = "m", -- toggle between "workspace" and "document" diagnostics mode 67 | toggle_preview = "P", -- toggle auto_preview 68 | hover = "K", -- opens a small poup with the full multiline message 69 | preview = "p", -- preview the diagnostic location 70 | close_folds = {"zM", "zm"}, -- close all folds 71 | open_folds = {"zR", "zr"}, -- open all folds 72 | toggle_fold = {"zA", "za"}, -- toggle fold of current file 73 | previous = "k", -- preview item 74 | next = "j", -- next item 75 | }, 76 | } 77 | 78 | local keymap = vim.api.nvim_set_keymap 79 | local opts = {silent = true, noremap = true} 80 | 81 | keymap("n", "t", "TroubleToggle", opts) 82 | 83 | --[===[ 84 | keymap("n", "xw", "Trouble lsp_workspace_diagnostics", 85 | {silent = true, noremap = true} 86 | ) 87 | keymap("n", "xd", "Trouble lsp_document_diagnostics", 88 | {silent = true, noremap = true} 89 | ) 90 | keymap("n", "xl", "Trouble loclist", 91 | {silent = true, noremap = true} 92 | ) 93 | keymap("n", "xq", "Trouble quickfix", 94 | {silent = true, noremap = true} 95 | ) 96 | keymap("n", "gR", "Trouble lsp_references", 97 | {silent = true, noremap = true} 98 | ) 99 | --]===] 100 | 101 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 102 | -- ━━━━━━━━━━━━━━━━━❰ end Mappings ❱━━━━━━━━━━━━━━━━ -- 103 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 104 | 105 | -------------------------------------------------------------------------------- /lua/mappings.lua: -------------------------------------------------------------------------------- 1 | 2 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 3 | -- ━━━━━━━━━━━━━❰ Plugin-Independent Mapping ❱━━━━━━━━━━━━━ -- 4 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 5 | --[===[ 6 | This config file contains the mappings that don't depend on any plugin. 7 | Mappings for plugin-dependent actions are in the "lua/plugin" directory. Each plugin has its own config file. 8 | 9 | To see the current mapping for ||, type :echo mapleader. 10 | If it reports an undefined variable, it means the leader key is set to the "default of '\'. 11 | I have defined the leader at the very start of the init.lua file so that every keymap will work. 12 | --]===] 13 | 14 | 15 | local keymap = vim.api.nvim_set_keymap 16 | local cmd = vim.cmd 17 | local options = {noremap = true, silent = true} 18 | local silent = {silent = true} 19 | 20 | 21 | -- TODO: fiqure out to implement q to quit only one buffer or one window at a time 22 | -- Close buffer 23 | cmd([[ autocmd BufEnter * nmap q :bd ]]) 24 | 25 | vim.api.nvim_create_autocmd( 26 | "FileType", 27 | { 28 | pattern = { 29 | "man", "help", "lspinfo", "null-ls-info", "lsp-installer" 30 | }, 31 | command = "nnoremap q :close", 32 | } 33 | ) 34 | 35 | 36 | -- map ctl+z to nothing so that it don't suspend terminal 37 | vim.api.nvim_create_autocmd( 38 | "BufEnter", 39 | { 40 | pattern = "*", 41 | command = "nnoremap " 42 | } 43 | ) 44 | 45 | -- keymap('n', 'q',':q ', options) 46 | -- write/save when the buffer has been modified. 47 | keymap('i', '', 'ma:update `a', options) 48 | keymap('n', '', 'ma:update `a', options) 49 | 50 | -- scroll window up/down 51 | keymap('i', '', '', silent) 52 | keymap('i', '', '', silent) 53 | 54 | -- scroll window horizontally (scroll-horizontal) 55 | -- < reference: https://unix.stackexchange.com/questions/110251/how-to-put-current-line-at-top-center-bottom-of-screen-in-vim 56 | keymap('n', '', 'zh', silent) -- left 57 | keymap('n', '', 'zl', silent) -- right 58 | 59 | -- number line enable 60 | keymap('n', 'n', ':set rnu! ', silent) 61 | 62 | -- clear Search Results 63 | keymap('n', '??', ':noh ', silent) 64 | 65 | --[[ 66 | on[ly] close all other windows but leave all buffers open. 67 | --]] 68 | keymap('n', '', ':only', silent) 69 | 70 | -- Resize splits more quickly 71 | -- ──────────────────────────────────────────────────── 72 | -- resize up and down 73 | keymap('n', ';k', ':resize +3 ', options) 74 | keymap('n', ';j', ':resize -3 ', options) 75 | -- resize right and left 76 | keymap('n', ';l', ':vertical resize +3 ', options) 77 | keymap('n', ';h', ':vertical resize -3 ', options) 78 | -- ──────────────────────────────────────────────────── 79 | 80 | --[[ 81 | easier moving of code blocks 82 | Try to go into visual mode (v), thenselect several lines of code 83 | here and then press ``>`` several times. 84 | --]] 85 | keymap('v', '<', '', '>gv', options) 87 | 88 | -- going back to normal mode which works even in vim's terminal 89 | -- you will need this if you use floaterm to escape terminal 90 | keymap('t', '', '', options) 91 | 92 | -- move selected line(s) up or down 93 | keymap('v', 'J', ":m '>+1gv=gv", options) 94 | keymap('v', 'K', ":m '<-2gv=gv", options) 95 | 96 | -- delete a word backward in insert mode with Ctrl+Backspace 97 | keymap('i', '', '', { noremap = true }) 98 | 99 | -- smart deletion, dd 100 | -- It solves the issue, where you want to delete empty line, but dd will override your last yank. 101 | -- Code below will check if u are deleting empty line, if so - use black hole register. 102 | -- [src: https://www.reddit.com/r/neovim/comments/w0jzzv/comment/igfjx5y/?utm_source=share&utm_medium=web2x&context=3] 103 | local function smart_dd() 104 | if vim.api.nvim_get_current_line():match("^%s*$") then 105 | return "\"_dd" 106 | else return "dd" end 107 | end 108 | vim.keymap.set("n", "dd", smart_dd, { noremap = true, expr = true }) 109 | 110 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 111 | -- ━━━━━━━━━━━━━━━❰ end of Plugin Mapping ❱━━━━━━━━━━━━━━━━ -- 112 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 113 | 114 | -------------------------------------------------------------------------------- /lua/plugins/vim-floaterm.lua: -------------------------------------------------------------------------------- 1 | 2 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 3 | -- ───────────────────────────────────────────────── -- 4 | -- Plugin: vim-floaterm 5 | -- Github: github.com/voldikss/vim-floaterm 6 | -- ───────────────────────────────────────────────── -- 7 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 8 | 9 | 10 | 11 | 12 | 13 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 14 | -- ━━━━━━━━━━━━━━━━━━━❰ Configs ❱━━━━━━━━━━━━━━━━━━━ -- 15 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 16 | 17 | -- Set floating window border line color to cyan, and background to orange 18 | vim.cmd("hi FloatermBorder guibg=none guifg=grey") 19 | -- Set floaterm window's background to black 20 | vim.cmd("hi Floaterm guibg=black") 21 | -- Set floaterm window background to gray once the cursor moves out from it 22 | vim.cmd("hi FloatermNC guibg=gray") 23 | 24 | -- Show floaterm info(e.g., 'floaterm: 1/3' implies there are 3 floaterms in total 25 | -- and the current is the first one) at the top left corner of floaterm window. 26 | vim.g.floaterm_title = 'Terminal: $1/$2' 27 | 28 | -- Set it to 'split' or 'vsplit' if you don't want to use floating or popup window. 29 | vim.g.floaterm_wintype = 'float' 30 | -- don't auto close terminal (useful when you try to compile/run code) 31 | vim.g.floaterm_autoclose = 0 32 | 33 | -- Type Number (number of columns) or Float (between 0 and 1). If Float, the width is relative to &columns. 34 | vim.g.floaterm_width = 0.6 35 | -- Type Number (number of lines) or Float (between 0 and 1). If Float, the height is relative to &lines. 36 | vim.g.floaterm_height = 0.7 37 | 38 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 39 | -- ━━━━━━━━━━━━━━━━━❰ end Configs ❱━━━━━━━━━━━━━━━━━ -- 40 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 41 | 42 | 43 | 44 | 45 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 46 | -- ━━━━━━━━━━━━━━━━━━❰ Mappings ❱━━━━━━━━━━━━━━━━━━━ -- 47 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 48 | 49 | local keymap = vim.api.nvim_set_keymap 50 | local options = { noremap=true, silent=true } 51 | 52 | -- use this (global, g) if you want your keymap works on any view(normal, insert, ...) 53 | vim.g.floaterm_keymap_toggle = '' -- toggle open/close floaterm 54 | -- vim.g.floaterm_keymap_prev = 'tk' -- go to previous floaterm window 55 | -- vim.g.floaterm_keymap_next = 'tj' -- go to next floaterm window 56 | -- vim.g.floaterm_keymap_new = 'tn' -- create new terminal 57 | -- vim.g.floaterm_keymap_kill = 'tq' -- quit current terminal 58 | 59 | -- go to previous floaterm window 60 | keymap('n', 'tk', ':FloatermPrev', options) 61 | -- go to next floaterm window 62 | keymap('n', 'tj', ':FloatermNext', options) 63 | -- create new floaterm window 64 | keymap('n', 'tn', ':FloatermNew', options) 65 | -- exit floaterm window 66 | keymap('n', 'tq', ':FloatermKill', options) 67 | 68 | 69 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 70 | -- ━━━━━━━━━━━━━━━❰ Build and Run ❱━━━━━━━━━━━━━━━━━ -- 71 | 72 | -- compile, run or compile and run program. 73 | -- it depends on python script, https://github.com/shaeinst/lazy-builder. visit to know more. 74 | 75 | local lazy_builder_py = "~/.local/share/nvim/custom_tools/lazy-builder/build.py" 76 | local build_path = "~/.cache/build_files" 77 | local buffer_num = vim.api.nvim_get_current_buf() -- current buffer 78 | local filename = vim.api.nvim_buf_get_name(buffer_num) -- current filename with full location 79 | -- local filename_with_dir = vim.fn.expand('%:p') 80 | -- local filename_dir= vim.fn.expand('%:p:h') 81 | 82 | local run = ":w | :FloatermNew python " .. lazy_builder_py .. " -o " .. build_path .. " -r 1 " .. filename .. " " 83 | local build = ":w | :FloatermNew time python " .. lazy_builder_py .. " -o " .. build_path .. " -b 1 " .. filename .. " " 84 | local buildrun = ":w | :FloatermNew time python " .. lazy_builder_py .. " -o " .. build_path .. " -br 1 " .. filename .. " " 85 | 86 | keymap('n', 'r', run, {noremap = true, silent = true}) -- Run 87 | keymap('n', 'o', build, {noremap = true, silent = true}) -- build 88 | keymap('n', 'O', buildrun, {noremap = true, silent = true}) -- build and run 89 | 90 | -- ━━━━━━━━━━━━━━━━❰ end Build/Run ❱━━━━━━━━━━━━━━━━ -- 91 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 92 | 93 | 94 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 95 | -- ━━━━━━━━━━━━━━━━❰ end Mappings ❱━━━━━━━━━━━━━━━━━ -- 96 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 97 | 98 | -------------------------------------------------------------------------------- /lua/plugins/gitsigns_nvim.lua: -------------------------------------------------------------------------------- 1 | 2 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 3 | -- ───────────────────────────────────────────────── -- 4 | -- Plugin: gitsigns.nvim 5 | -- Github: github.com/lewis6991/gitsigns.nvim 6 | -- ───────────────────────────────────────────────── -- 7 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 8 | 9 | 10 | 11 | 12 | 13 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 14 | -- ━━━━━━━━━━━━━━━━━━━❰ configs ❱━━━━━━━━━━━━━━━━━━━ -- 15 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 16 | 17 | local import_gitsigns, gitsigns = pcall(require, "gitsigns") 18 | if not import_gitsigns then return end 19 | 20 | require('gitsigns').setup { 21 | signs = { 22 | add = { 23 | hl = 'GitSignsAdd', 24 | text = '│', 25 | numhl = 'GitSignsAddNr', 26 | linehl = 'GitSignsAddLn', 27 | }, 28 | change = { 29 | hl = 'GitSignsChange', 30 | text = '│', 31 | numhl = 'GitSignsChangeNr', 32 | linehl = 'GitSignsChangeLn', 33 | }, 34 | delete = { 35 | hl = 'GitSignsDelete', 36 | text = '_', 37 | numhl = 'GitSignsDeleteNr', 38 | linehl = 'GitSignsDeleteLn', 39 | }, 40 | topdelete = { 41 | hl = 'GitSignsDelete', 42 | text = '‾', 43 | numhl = 'GitSignsDeleteNr', 44 | linehl = 'GitSignsDeleteLn', 45 | }, 46 | changedelete = { 47 | hl = 'GitSignsChange', 48 | text = '~', 49 | numhl = 'GitSignsChangeNr', 50 | linehl = 'GitSignsChangeLn', 51 | }, 52 | }, 53 | signcolumn = true, -- Toggle with `:Gitsigns toggle_signs` 54 | numhl = false, -- Toggle with `:Gitsigns toggle_numhl` 55 | linehl = false, -- Toggle with `:Gitsigns toggle_linehl` 56 | word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff` 57 | 58 | watch_gitdir = {interval = 1000, follow_files = true}, 59 | attach_to_untracked = true, 60 | current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame` 61 | current_line_blame_opts = { 62 | virt_text = true, 63 | virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align' 64 | delay = 1000, 65 | }, 66 | current_line_blame_formatter_opts = {relative_time = false}, 67 | sign_priority = 6, 68 | update_debounce = 100, 69 | status_formatter = nil, -- Use default 70 | max_file_length = 40000, 71 | preview_config = { 72 | -- Options passed to nvim_open_win 73 | border = 'single', 74 | style = 'minimal', 75 | relative = 'cursor', 76 | row = 0, 77 | col = 1, 78 | }, 79 | diff_opts = {internal = true}, -- If vim.diff or luajit is present 80 | yadm = {enable = false}, 81 | } 82 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 83 | -- ━━━━━━━━━━━━━━━━━❰ end configs ❱━━━━━━━━━━━━━━━━━ -- 84 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 85 | 86 | 87 | 88 | 89 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 90 | -- ━━━━━━━━━━━━━━━━━━━❰ Mappings ❱━━━━━━━━━━━━━━━━━━ -- 91 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 92 | 93 | --[===[ 94 | require('gitsigns').setup { 95 | keymaps = { 96 | -- Default keymap options 97 | noremap = true, 98 | 99 | ['n ]c'] = { expr = true, "&diff ? ']c' : 'lua require\"gitsigns.actions\".next_hunk()'"}, 100 | ['n [c'] = { expr = true, "&diff ? '[c' : 'lua require\"gitsigns.actions\".prev_hunk()'"}, 101 | 102 | ['n hs'] = 'lua require"gitsigns".stage_hunk()', 103 | ['v hs'] = 'lua require"gitsigns".stage_hunk({vim.fn.line("."), vim.fn.line("v")})', 104 | ['n hu'] = 'lua require"gitsigns".undo_stage_hunk()', 105 | ['n hr'] = 'lua require"gitsigns".reset_hunk()', 106 | ['v hr'] = 'lua require"gitsigns".reset_hunk({vim.fn.line("."), vim.fn.line("v")})', 107 | ['n hR'] = 'lua require"gitsigns".reset_buffer()', 108 | ['n hp'] = 'lua require"gitsigns".preview_hunk()', 109 | ['n hb'] = 'lua require"gitsigns".blame_line(true)', 110 | ['n hS'] = 'lua require"gitsigns".stage_buffer()', 111 | ['n hU'] = 'lua require"gitsigns".reset_buffer_index()', 112 | 113 | -- Text objects 114 | ['o ih'] = ':lua require"gitsigns.actions".select_hunk()', 115 | ['x ih'] = ':lua require"gitsigns.actions".select_hunk()' 116 | }, 117 | } 118 | 119 | --]===] 120 | 121 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 122 | -- ━━━━━━━━━━━━━━━━━❰ end Mappings ❱━━━━━━━━━━━━━━━━ -- 123 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 124 | 125 | -------------------------------------------------------------------------------- /lua/plugins/lspsaga_nvim.lua: -------------------------------------------------------------------------------- 1 | 2 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 3 | -- ─────────────────────────────────────────────────-- 4 | -- Plugin: lspsaga.nvim 5 | -- Github: github.com/glepnir/lspsaga.nvim 6 | -- ─────────────────────────────────────────────────-- 7 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 8 | 9 | 10 | 11 | 12 | 13 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 14 | -- ━━━━━━━━━━━━━━━━━━━❰ configs ❱━━━━━━━━━━━━━━━━━━━-- 15 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 16 | 17 | local import_saga, saga = pcall(require, 'lspsaga') 18 | if not import_saga then return end 19 | 20 | 21 | saga.init_lsp_saga({ 22 | 23 | -- Options with default value 24 | -- "single" | "double" | "rounded" | "bold" | "plus" 25 | border_style = "single", 26 | -- the range of 0 for fully opaque window (disabled) to 100 for fully 27 | -- transparent background. Values between 0-30 are typically most useful. 28 | saga_winblend = 0, 29 | -- when cursor in saga window you config these to move 30 | -- Error, Warn, Info, Hint 31 | -- use emoji like 32 | -- { "🙀", "😿", "😾", "😺" } 33 | -- or 34 | -- { "😡", "😥", "😤", "😐" } 35 | -- and diagnostic_header can be a function type 36 | -- must return a string and when diagnostic_header 37 | -- is function type it will have a param `entry` 38 | -- entry is a table type has these filed 39 | -- { bufnr, code, col, end_col, end_lnum, lnum, message, severity, source } 40 | diagnostic_header = {" ", " ", " ", "ﴞ "}, 41 | -- show diagnostic source 42 | show_diagnostic_source = true, 43 | -- add bracket or something with diagnostic source, just have 2 elements 44 | diagnostic_source_bracket = {}, 45 | -- preview lines of lsp_finder and definition preview 46 | max_preview_lines = 10, 47 | -- use emoji lightbulb in default 48 | code_action_icon = "💡", 49 | -- if true can press number to execute the codeaction in codeaction window 50 | code_action_num_shortcut = true, 51 | -- same as nvim-lightbulb but async 52 | code_action_lightbulb = { 53 | enable = false, 54 | sign = true, 55 | enable_in_insert = true, 56 | sign_priority = 20, 57 | virtual_text = true, 58 | }, 59 | -- finder icons 60 | finder_icons = {def = ' ', ref = '諭 ', link = ' '}, 61 | -- custom finder title winbar function type 62 | -- param is current word with symbol icon string type 63 | -- return a winbar format string like `%#CustomFinder#Test%*` 64 | -- finder_title_bar = function(param) do your stuff here end, 65 | 66 | rename_in_select = true, 67 | definition_preview_icon = " ", 68 | -- show symbols in winbar must nightly 69 | symbol_in_winbar = { 70 | in_custom = false, 71 | enable = false, 72 | separator = ' ', 73 | show_file = true, 74 | click_support = false, 75 | }, 76 | -- show outline 77 | show_outline = { 78 | win_position = 'right', 79 | -- set special filetype win that outline window split.like NvimTree neotree 80 | -- defx, db_ui 81 | win_with = '', 82 | win_width = 30, 83 | auto_enter = true, 84 | auto_preview = true, 85 | virt_text = '┃', 86 | jump_key = 'o', 87 | -- auto refresh when change buffer 88 | auto_refresh = true, 89 | }, 90 | -- if you don't use nvim-lspconfig you must pass your server name and 91 | -- the related filetypes into this table 92 | -- like server_filetype_map = { metals = { "sbt", "scala" } } 93 | server_filetype_map = {}, 94 | 95 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 96 | -- ━━━━━━━━━━━━━━━━━❰ end configs ❱━━━━━━━━━━━━━━━━━-- 97 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 98 | 99 | 100 | 101 | 102 | 103 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 104 | -- ━━━━━━━━━━━━━━━━━━━❰ Mappings ❱━━━━━━━━━━━━━━━━━━━-- 105 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 106 | 107 | move_in_saga = {prev = '', next = ''}, 108 | finder_action_keys = { 109 | open = "o", 110 | vsplit = "s", 111 | split = "i", 112 | tabe = "t", 113 | quit = {"q", "Esc"},-- quit can be a table 114 | scroll_down = "", 115 | scroll_up = "", 116 | }, 117 | code_action_keys = {quit = "q", exec = ""}, 118 | rename_action_quit = "", 119 | }) 120 | 121 | 122 | local options = {noremap = true, silent = true} 123 | local keymap = vim.api.nvim_set_keymap 124 | 125 | -- Rename 126 | keymap('n', 'R', 'Lspsaga rename', options) 127 | keymap('v', 'R', 'Lspsaga rename', options) 128 | 129 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 130 | -- ━━━━━━━━━━━━━━━━━❰ end Mappings ❱━━━━━━━━━━━━━━━━-- 131 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 132 | 133 | -------------------------------------------------------------------------------- /lua/plugins/nvim-cmp.lua: -------------------------------------------------------------------------------- 1 | 2 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 3 | -- ───────────────────────────────────────────────── -- 4 | -- Plugin: nvim-cmp 5 | -- Github: github.com/hrsh7th/nvim-cmp 6 | -- ───────────────────────────────────────────────── -- 7 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 8 | 9 | 10 | 11 | 12 | 13 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 14 | -- ━━━━━━━━━━━━━━━━━━━❰ configs ❱━━━━━━━━━━━━━━━━━━━ -- 15 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 16 | 17 | -- Set completeopt to have a better completion experience 18 | vim.o.completeopt = 'menuone,noselect' 19 | 20 | local import_cmp, cmp = pcall(require, 'cmp') 21 | if not import_cmp then return end 22 | 23 | local import_luasnip, luasnip = pcall(require, 'luasnip') 24 | if not import_luasnip then return end 25 | 26 | 27 | cmp.setup({ 28 | 29 | -- -- Disabling completion in certain contexts, such as comments 30 | -- enabled = function() 31 | -- -- disable completion in comments 32 | -- local context = require 'cmp.config.context' 33 | -- -- keep command mode completion enabled when cursor is in a comment 34 | -- if vim.api.nvim_get_mode().mode == 'c' then 35 | -- return true 36 | -- else 37 | -- return not context.in_treesitter_capture("comment") 38 | -- and not context.in_syntax_group("Comment") 39 | -- end 40 | -- end, 41 | 42 | completion = { 43 | -- completeopt = 'menu,menuone,noinsert', 44 | }, 45 | 46 | snippet = { 47 | expand = function(args) luasnip.lsp_expand(args.body) end, 48 | }, 49 | 50 | formatting = { 51 | 52 | fields = {"kind", "abbr", "menu"}, 53 | 54 | format = function(entry, vim_item) 55 | local kind_icons = { 56 | Text = "", 57 | Method = "", 58 | Function = "", 59 | Constructor = "", 60 | Field = "", --  61 | Variable = "", 62 | Class = '', -- ﴯ 63 | Interface = "", 64 | Module = "", 65 | Property = "ﰠ", 66 | Unit = "", 67 | Value = "", 68 | Enum = "", 69 | Keyword = "", 70 | Snippet = "", 71 | Color = "", 72 | File = "", 73 | Reference = "", 74 | Folder = "", 75 | EnumMember = "", 76 | Constant = "", 77 | Struct = "", 78 | Event = "", 79 | Operator = '', --  80 | TypeParameter = ' ', 81 | } 82 | 83 | vim_item.kind = (kind_icons[vim_item.kind] or '') .. " " 84 | -- vim_item.kind = string.format('%s %s', kind_icons[vim_item.kind], vim_item.kind) -- show icons with the name of the item kind 85 | 86 | -- limit completion width 87 | local MAX_LABEL_WIDTH = 35 88 | local label = vim_item.abbr 89 | local truncated_label = vim.fn.strcharpart(label, 0, MAX_LABEL_WIDTH) 90 | if truncated_label ~= label then 91 | vim_item.abbr = truncated_label .. '…' 92 | end 93 | 94 | -- set a name for each source 95 | vim_item.menu = ({ 96 | buffer = "[Buffer]", 97 | nvim_lsp = "[LSP]", 98 | luasnip = "[Snippet]", 99 | nvim_lua = "[Lua]", 100 | latex_symbols = "[LaTeX]", 101 | })[entry.source.name] 102 | 103 | return vim_item 104 | end, 105 | }, 106 | 107 | sources = { 108 | {name = 'nvim_lsp'}, 109 | -- {name = 'nvim_lsp_signature_help' }, -- using ray-x/lsp_signature.nvim instead 110 | {name = 'nvim_lua'}, 111 | {name = 'path'}, 112 | {name = 'luasnip'}, 113 | {name = 'buffer', keyword_length = 1}, 114 | -- {name = 'calc'}, 115 | }, 116 | 117 | window = { 118 | documentation = { 119 | border = {"┌", "─", "┐", "│", "┘", "─", "└", "│"}, 120 | }, 121 | completion = { 122 | border = {"┌", "─", "┐", "│", "┘", "─", "└", "│"}, 123 | } 124 | }, 125 | 126 | experimental = { 127 | -- ghost_text = true, 128 | }, 129 | 130 | }) 131 | 132 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 133 | -- ━━━━━━━━━━━━━━━━━❰ end configs ❱━━━━━━━━━━━━━━━━━ -- 134 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 135 | 136 | 137 | 138 | 139 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 140 | -- ━━━━━━━━━━━━━━━━━━━❰ Mappings ❱━━━━━━━━━━━━━━━━━━ -- 141 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 142 | 143 | -- -- Require function for tab to work with LUA-SNIP 144 | -- local has_words_before = function() 145 | -- local line, col = unpack(vim.api.nvim_win_get_cursor(0)) 146 | -- return col ~= 0 and 147 | -- vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1] 148 | -- :sub(col, col) 149 | -- :match("%s") == nil 150 | -- end 151 | 152 | cmp.setup({ 153 | mapping = { 154 | [''] = cmp.mapping.complete({}), 155 | [''] = cmp.mapping.close(), 156 | [''] = cmp.mapping.scroll_docs(-4), 157 | [''] = cmp.mapping.scroll_docs(4), 158 | [''] = cmp.mapping.confirm({ 159 | behavior = cmp.ConfirmBehavior.Replace, 160 | select = false, 161 | }), 162 | 163 | [""] = cmp.mapping(function(fallback) 164 | if cmp.visible() then 165 | cmp.select_next_item() 166 | elseif luasnip.expand_or_jumpable() then 167 | luasnip.expand_or_jump() 168 | -- this will auto complete if our cursor in next to a word and we press tab 169 | -- elseif has_words_before() then 170 | -- cmp.complete() 171 | else 172 | fallback() 173 | end 174 | end, {"i", "s"}), 175 | 176 | [""] = cmp.mapping(function(fallback) 177 | if cmp.visible() then 178 | cmp.select_prev_item() 179 | elseif luasnip.jumpable(-1) then 180 | luasnip.jump(-1) 181 | else 182 | fallback() 183 | end 184 | end, {"i", "s"}), 185 | 186 | }, 187 | }) 188 | 189 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 190 | -- ━━━━━━━━━━━━━━━━━❰ end Mappings ❱━━━━━━━━━━━━━━━━ -- 191 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 192 | 193 | -------------------------------------------------------------------------------- /lua/plugins/nvim-dap.lua: -------------------------------------------------------------------------------- 1 | 2 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 3 | -- ───────────────────────────────────────────────── -- 4 | -- Plugin: nvim-dap | nvim-dap-ui | nvim-dap-virtual-text | telescope-dap.nvim 5 | -- Github: github.com/mfussenegger/nvim-dap 6 | -- github.com/rcarriga/nvim-dap-ui 7 | -- github.com/theHamsta/nvim-dap-virtual-text 8 | -- github.com/nvim-telescope/telescope-dap.nvim 9 | -- ───────────────────────────────────────────────── -- 10 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 11 | 12 | --[====[ 13 | 14 | this plugin is not implemented yet. Will do in future 15 | 16 | 17 | -- use { -- DAP, Debug Adapter Protocol client implementation for Neovim 18 | -- 'mfussenegger/nvim-dap', 19 | -- requires = { 20 | -- {'rcarriga/nvim-dap-ui'}, -- A UI for nvim-dap 21 | -- { 22 | -- 'theHamsta/nvim-dap-virtual-text', -- This plugin adds virtual text support to nvim-dap. nvim-treesitter is used to find variable definitions. 23 | -- requires = {'nvim-treesitter/nvim-treesitter'}, 24 | -- }, 25 | -- { 26 | -- 'nvim-telescope/telescope-dap.nvim', -- Integration for nvim-dap with telescope.nvim 27 | -- requires = {'nvim-telescope/telescope.nvim'}, 28 | -- }, 29 | -- }, 30 | -- config = [[ require('plugins/nvim-dap') ]] 31 | -- } 32 | 33 | --]====] 34 | 35 | 36 | 37 | 38 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 39 | -- ━━━━━━━━━━━━━━━━━━━❰ configs ❱━━━━━━━━━━━━━━━━━━━ -- 40 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 41 | 42 | -------------------------- 43 | -- telescope-dap.nvim 44 | pcall(require'telescope'.load_extension, 'dap') 45 | -------------------------- 46 | 47 | 48 | -------------------------- 49 | -- nvim-dap-ui 50 | require("dapui").setup({ 51 | icons = {expanded = "▾", collapsed = "▸"}, 52 | -- Expand lines larger than the window 53 | -- Requires >= 0.7 54 | expand_lines = vim.fn.has("nvim-0.7"), 55 | sidebar = { 56 | -- You can change the order of elements in the sidebar 57 | elements = { 58 | -- Provide as ID strings or tables with "id" and "size" keys 59 | { 60 | id = "scopes", 61 | size = 0.25, -- Can be float or integer > 1 62 | }, 63 | {id = "breakpoints", size = 0.25}, 64 | {id = "stacks", size = 0.25}, 65 | {id = "watches", size = 00.25}, 66 | }, 67 | size = 40, 68 | position = "left", -- Can be "left", "right", "top", "bottom" 69 | }, 70 | tray = { 71 | elements = {"repl", "console"}, 72 | size = 10, 73 | position = "bottom", -- Can be "left", "right", "top", "bottom" 74 | }, 75 | floating = { 76 | max_height = nil, -- These can be integers or a float between 0 and 1. 77 | max_width = nil, -- Floats will be treated as percentage of your screen. 78 | border = "single", -- Border style. Can be "single", "double" or "rounded" 79 | mappings = {close = {"q", ""}}, 80 | }, 81 | windows = {indent = 1}, 82 | render = { 83 | max_type_length = nil, -- Can be integer or nil. 84 | }, 85 | }) 86 | 87 | -- end nvim-dap-ui 88 | -------------------------- 89 | 90 | -------------------------- 91 | -- nvim-dap-virtual-text 92 | require("nvim-dap-virtual-text").setup { 93 | enabled = true, -- enable this plugin (the default) 94 | enabled_commands = true, -- create commands DapVirtualTextEnable, DapVirtualTextDisable, DapVirtualTextToggle, (DapVirtualTextForceRefresh for refreshing when debug adapter did not notify its termination) 95 | highlight_changed_variables = true, -- highlight changed values with NvimDapVirtualTextChanged, else always NvimDapVirtualText 96 | highlight_new_as_changed = false, -- highlight new variables in the same way as changed variables (if highlight_changed_variables) 97 | show_stop_reason = true, -- show stop reason when stopped for exceptions 98 | commented = false, -- prefix virtual text with comment string 99 | only_first_definition = true, -- only show virtual text at first definition (if there are multiple) 100 | all_references = false, -- show virtual text on all all references of the variable (not only definitions) 101 | filter_references_pattern = '", "<2-LeftMouse>"}, 138 | open = "o", 139 | remove = "d", 140 | edit = "e", 141 | repl = "r", 142 | toggle = "t", 143 | }, 144 | }) 145 | -------------------------- 146 | 147 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 148 | -- ━━━━━━━━━━━━━━━━━❰ end Mappings ❱━━━━━━━━━━━━━━━━ -- 149 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 150 | 151 | -------------------------------------------------------------------------------- /lua/plugins/telescope_nvim.lua: -------------------------------------------------------------------------------- 1 | 2 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 3 | -- ───────────────────────────────────────────────── -- 4 | -- PluginName: telescope.nvim 5 | -- Github: github.com/nvim-telescope/telescope.nvim 6 | -- ───────────────────────────────────────────────── -- 7 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 8 | 9 | 10 | 11 | 12 | 13 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 14 | -- ━━━━━━━━━━━━━━━━━━━❰ configs ❱━━━━━━━━━━━━━━━━━━━ -- 15 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 16 | 17 | -- safely import telescope 18 | local import_telescope, telescope = pcall(require, 'telescope') 19 | if not import_telescope then return end 20 | 21 | telescope.setup { 22 | 23 | defaults = { 24 | vimgrep_arguments = { 25 | 'rg', 26 | '--color=never', 27 | '--no-heading', 28 | '--with-filename', 29 | '--line-number', 30 | '--column', 31 | '--smart-case', 32 | }, 33 | 34 | initial_mode = "insert", 35 | selection_strategy = "reset", 36 | sorting_strategy = "ascending", 37 | layout_strategy = "horizontal", 38 | layout_config = { 39 | horizontal = { 40 | mirror = false, 41 | prompt_position = "top", 42 | preview_width = 0.4, 43 | }, 44 | vertical = { mirror = false, }, 45 | width = 0.8, 46 | height = 0.9, 47 | preview_cutoff = 80, 48 | }, 49 | file_ignore_patterns = { 50 | "__pycache__/", "__pycache__/*", 51 | 52 | "build/", "gradle/", "node_modules/", "node_modules/*", "obj/Debug", 53 | "smalljre_*/*", "target/", "vendor/*", "bin/Debug", "venv/", 54 | 55 | ".dart_tool/", ".git/", ".github/", ".gradle/",".idea/", ".vscode/", 56 | 57 | "%.sqlite3", "%.ipynb", "%.lock", "%.pdb", "%.so", 58 | "%.dll", "%.class", "%.exe", "%.cache", "%.pdf", "%.dylib", 59 | "%.jar", "%.docx", "%.met", "%.burp", "%.mp4", "%.mkv", "%.rar", 60 | "%.zip", "%.7z", "%.tar", "%.bz2", "%.epub", "%.flac", "%.tar.gz", 61 | }, 62 | 63 | file_sorter = require'telescope.sorters'.get_fuzzy_file, 64 | generic_sorter = require'telescope.sorters'.get_generic_fuzzy_sorter, 65 | file_previewer = require'telescope.previewers'.vim_buffer_cat.new, 66 | grep_previewer = require'telescope.previewers'.vim_buffer_vimgrep.new, 67 | qflist_previewer = require'telescope.previewers'.vim_buffer_qflist.new, 68 | 69 | prompt_prefix = "🔎 ", 70 | selection_caret = "➤ ", 71 | entry_prefix = " ", 72 | winblend = 0, 73 | border = {}, 74 | borderchars = {'─', '│', '─', '│', '┌', '┐', '┘', '└'}, -- │ ─ ╭ ╮ ╰ ╯ 75 | color_devicons = true, 76 | use_less = true, 77 | set_env = {['COLORTERM'] = 'truecolor'}, -- default = nil, 78 | path_display = {'truncate'}, -- How file paths are displayed () 79 | 80 | preview = { 81 | msg_bg_fillchar = " ", 82 | treesitter = false, 83 | }, 84 | 85 | live_grep = { 86 | preview = { 87 | treesitter = false 88 | } 89 | }, 90 | 91 | -- Developer configurations: Not meant for general override 92 | buffer_previewer_maker = require'telescope.previewers'.buffer_previewer_maker, 93 | }, 94 | 95 | extensions = { 96 | 97 | fzf = { 98 | fuzzy = true, -- false will only do exact matching 99 | override_generic_sorter = true, -- override the generic sorter 100 | override_file_sorter = true, -- override the file sorter 101 | case_mode = "smart_case", -- or "ignore_case" or "respect_case". the default case_mode is "smart_case" 102 | }, 103 | 104 | media_files = { 105 | -- filetypes whitelist 106 | filetypes = {"png", "jpg", "mp4", "webm", "pdf"}, 107 | find_cmd = "fd" -- find command (defaults to `fd`) 108 | }, 109 | 110 | file_browser = { 111 | theme = "ivy", 112 | -- disables netrw and use telescope-file-browser in its place 113 | hijack_netrw = true, 114 | }, 115 | 116 | ["ui-select"] = { 117 | require("telescope.themes").get_dropdown { 118 | winblend = 15, 119 | layout_config = { 120 | prompt_position = "top", 121 | width = 64, 122 | height = 15, 123 | }, 124 | border = {}, 125 | previewer = false, 126 | shorten_path = false, 127 | }, 128 | } 129 | 130 | }, 131 | 132 | } 133 | -- To get telescope-extension loaded and working with telescope, 134 | -- you need to call load_extension, somewhere after setup function: 135 | telescope.load_extension('fzf') 136 | telescope.load_extension('file_browser') 137 | telescope.load_extension('media_files') 138 | telescope.load_extension("ui-select") 139 | 140 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 141 | -- ━━━━━━━━━━━━━━━━━❰ end configs ❱━━━━━━━━━━━━━━━━━ -- 142 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 143 | 144 | 145 | 146 | 147 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 148 | -- ━━━━━━━━━━━━━━━━━━━❰ Mappings ❱━━━━━━━━━━━━━━━━━━ -- 149 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 150 | 151 | local keymap = vim.api.nvim_set_keymap 152 | local options = { silent = true, noremap = true } 153 | 154 | -- --> Launch Telescope without any argument 155 | keymap('n', "tt", "lua require('telescope.builtin').builtin() ", options) 156 | 157 | -- --> Lists available Commands 158 | keymap('n', "tc", "lua require('telescope.builtin').commands() ", options) 159 | 160 | -- --> Lists available help tags and opens a new window with the relevant help info on 161 | keymap('n', "th", "lua require('telescope.builtin').help_tags() ", options) 162 | 163 | -- --> show all availabe MAPPING 164 | keymap('n', "tm", "lua require('telescope.builtin').keymaps() ", options) 165 | 166 | -- --> show buffers/opened files 167 | keymap('n', "", "lua require('telescope.builtin').buffers() ", options) 168 | keymap('n', "tb", "lua require('telescope.builtin').buffers() ", options) 169 | 170 | -- --> show and grep current buffer 171 | keymap('n', "tw", "lua require('telescope.builtin').current_buffer_fuzzy_find() ", options) 172 | keymap('n', "tg", "lua require('telescope.builtin').live_grep() ", options) 173 | 174 | -- --> Find Files 175 | -- NOTE1: to get project root's directory, https://github.com/Abstract-IDE/penvim plugin is used. 176 | -- any config related to project root is in seperate config file (lua/plugin_confs/penvim.lua) 177 | -- to change settings related to working directory, refer to penvim.lua config file 178 | 179 | -- Find files from current file's project 180 | keymap('n', "", ":Telescope find_files ", options) 181 | keymap('n', "tp", ":Telescope find_files ", options) 182 | -- show all files from current working directory 183 | keymap('n', "", "lua require('telescope.builtin').find_files( { cwd = vim.fn.expand('%:p:h') }) ", options) 184 | keymap('n', "tf", "lua require('telescope.builtin').find_files( { cwd = vim.fn.expand('%:p:h') }) ", options) 185 | 186 | -- --> show symbols (@nvim-telescope/telescope-symbols.nvim) 187 | keymap('n', "ts", "lua require('telescope.builtin').symbols{ sources = {'emoji', 'kaomoji', 'gitmoji'} } ", options) 188 | 189 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 190 | -- ━━━━━━━━━━━━━━━━━❰ end Mappings ❱━━━━━━━━━━━━━━━━ -- 191 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 192 | 193 | -------------------------------------------------------------------------------- /lua/plugins/null-ls_nvim.lua: -------------------------------------------------------------------------------- 1 | 2 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 3 | -- ───────────────────────────────────────────────── -- 4 | -- Plugin: null-ls.nvim 5 | -- Github: github.com/jose-elias-alvarez/null-ls.nvim 6 | -- ───────────────────────────────────────────────── -- 7 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 8 | 9 | 10 | 11 | 12 | 13 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 14 | -- ━━━━━━━━━━━━━━━━━━━❰ configs ❱━━━━━━━━━━━━━━━━━━━ -- 15 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 16 | 17 | -- https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/doc/BUILTINS.md 18 | 19 | -- safley import null-ls 20 | local imported_null, null = pcall(require, "null-ls") 21 | if not imported_null then return end 22 | 23 | -- Packages(LSP, Formatter, Linter, DAP) are installed and managed by 'williamboman/mason.nvim' 24 | local imported_packages, packages = pcall(require, "mason-registry") 25 | if not imported_packages then return end 26 | -- get all installed Packages 27 | local installed_packages = packages.get_installed_package_names() 28 | 29 | local formatting = null.builtins.formatting 30 | -- local completion = null.builtins.completion 31 | -- local diagnostics = null.builtins.diagnostics 32 | -- local code_actions = null.builtins.code_actions 33 | 34 | -- register any number of sources simultaneously 35 | local sources = {} 36 | local load = false 37 | 38 | local api = vim.api 39 | local fn = vim.fn 40 | 41 | -- ───────────────────────────────────────────────── -- 42 | -- ─────────────────❰ FORMATTING ❱────────────────── -- 43 | -- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/formatting 44 | 45 | for _, package in pairs(installed_packages) do 46 | -- Lua 47 | if package == "luaformatter" then 48 | load = true 49 | sources[#sources+1] = formatting.lua_format.with({ 50 | command = "lua-format", 51 | args = { 52 | "--indent-width", 53 | "1", 54 | "--tab-width", 55 | "4", 56 | "--use-tab", 57 | "--chop-down-table", 58 | "--extra-sep-at-table-end", 59 | }, 60 | }) 61 | goto loop_continue 62 | end 63 | if package == "stylua" then 64 | load = true 65 | sources[#sources+1] = formatting.stylua.with({ 66 | command = "stylua", 67 | args = { 68 | "--search-parent-directories", 69 | "--stdin-filepath", 70 | "$FILENAME", 71 | "-", 72 | }, 73 | }) 74 | goto loop_continue 75 | end 76 | -- Python 77 | if package == "black" then 78 | load = true 79 | sources[#sources+1] = formatting.black.with({ 80 | command = "black", 81 | args = {"--quiet", "--fast", "-"}, 82 | }) 83 | goto loop_continue 84 | end 85 | -- Django ("htmldjango") 86 | if package == "djlint" then 87 | load = true 88 | sources[#sources + 1] = formatting.djlint.with({ 89 | command = "djlint", 90 | args = {"--reformat", "-"}, 91 | }) 92 | goto loop_continue 93 | end 94 | -- "javascript", "javascriptreact", "typescript", "typescriptreact", "vue", 95 | -- "css", "scss", "less", "html", "json", "yaml", "markdown", "graphql" 96 | if package == "prettier" then 97 | load = true 98 | sources[#sources+1] = formatting.prettier.with({ 99 | command = "prettier", 100 | args = {"--stdin-filepath", "$FILENAME"}, 101 | }) 102 | goto loop_continue 103 | end 104 | -- C, C++, CS, Java 105 | if package == "clang-format" then 106 | load = true 107 | sources[#sources+1] = formatting.clang_format.with({ 108 | command = "clang-format", 109 | args = { 110 | "-assume-filename", 111 | "$FILENAME", 112 | }, 113 | to_stdin = true, 114 | }) 115 | goto loop_continue 116 | end 117 | -- Rust 118 | if package == "rustfmt" then 119 | load = true 120 | sources[#sources + 1] = formatting.rustfmt.with({ 121 | command = "rustfmt" 122 | }) 123 | goto loop_continue 124 | end 125 | 126 | ::loop_continue:: 127 | end 128 | 129 | -- Go 130 | if fn.executable("gofmt") == 1 then 131 | load = true 132 | sources[#sources+1] = formatting.gofmt.with({}) 133 | end 134 | 135 | -- ───────────────❰ end FORMATTING ❱──────────────── -- 136 | -- ───────────────────────────────────────────────── -- 137 | 138 | 139 | -- ───────────────────────────────────────────────── -- 140 | -- ─────────────────❰ CODEACTION ❱────────────────── -- 141 | -- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/code_actions 142 | 143 | --[===[ 144 | -- Javascript 145 | if vim.fn.executable("clang-format") == 1 then 146 | load = true 147 | sources[#sources+1] = code_actions.eslint.with({ 148 | command = "eslint", 149 | filetypes = { "javascript", "javascriptreact", "typescript", "typescriptreact", "vue" }, 150 | args = { "-f", "json", "--stdin", "--stdin-filename", "$FILENAME" }, 151 | to_stdin = true, 152 | }) 153 | end 154 | ---]===] 155 | 156 | -- ───────────────❰ end CODEACTION ❱──────────────── -- 157 | -- ───────────────────────────────────────────────── -- 158 | 159 | 160 | -- ───────────────────────────────────────────────── -- 161 | -- ─────────────────❰ DIAGNOSTICS ❱───────────────── -- 162 | -- -- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics 163 | -- -- Django ("htmldjango") 164 | -- if vim.fn.executable("djlint") == 1 then 165 | -- load = true 166 | -- sources[#sources+1] = diagnostics.djlint.with({ 167 | -- command = "djlint", 168 | -- args = { "$FILENAME" }, 169 | -- }) 170 | -- end 171 | -- ───────────────❰ end DIAGNOSTICS ❱─────────────── -- 172 | -- ───────────────────────────────────────────────── -- 173 | 174 | 175 | -- ───────────────────────────────────────────────── -- 176 | -- ─────────────────❰ COMPLETION ❱────────────────── -- 177 | -- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/completion 178 | -- ───────────────❰ end COMPLETION ❱──────────────── -- 179 | -- ───────────────────────────────────────────────── -- 180 | 181 | -- ───────────────────────────────────────────────── -- 182 | -- ───────────────────❰ HOVER ❱───────────────────── -- 183 | -- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/hover 184 | -- ─────────────────❰ end HOVER ❱─────────────────── -- 185 | -- ───────────────────────────────────────────────── -- 186 | 187 | 188 | -- setup null-ls 189 | if load then 190 | null.setup({ 191 | sources = sources 192 | }) 193 | end 194 | 195 | -- give border to null-ls window 196 | local group = api.nvim_create_augroup("AbstractNulllsAutoGroup", {clear=true}) 197 | api.nvim_create_autocmd("FileType", { 198 | pattern = "null-ls-info", 199 | group = group, 200 | callback = function() api.nvim_win_set_config(0, {border = "rounded"}) end, 201 | }) 202 | 203 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 204 | -- ━━━━━━━━━━━━━━━━━❰ end configs ❱━━━━━━━━━━━━━━━━━ -- 205 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 206 | 207 | 208 | 209 | 210 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 211 | -- ━━━━━━━━━━━━━━━━━━━❰ Mappings ❱━━━━━━━━━━━━━━━━━━ -- 212 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 213 | 214 | local keymap = vim.api.nvim_set_keymap 215 | keymap('n', 'f', ':lua vim.lsp.buf.format({ timeout_ms = 2000 })', {noremap = true, silent = true}) 216 | 217 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 218 | -- ━━━━━━━━━━━━━━━━━❰ end Mappings ❱━━━━━━━━━━━━━━━━ -- 219 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 220 | 221 | -------------------------------------------------------------------------------- /lua/configs.lua: -------------------------------------------------------------------------------- 1 | 2 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 3 | -- ━━━━━━━━━━━━━❰ Plugin-Independent Configs ❱━━━━━━━━━━━━━ -- 4 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 5 | 6 | --[[ 7 | NOTE: 8 | every configs in this file are independent of any plugin 9 | configs for plugins are in "lua/plugins" directory and each plugin has 10 | it's own config file. some settings are already default in neovim so you 11 | don't need to define explicitly but it won't make any difference 12 | :end of NOTE 13 | --]] 14 | 15 | local opt = vim.opt 16 | local api = vim.api 17 | 18 | -- set theme 19 | pcall(require, 'plugins.Abstract_cs') 20 | 21 | opt.termguicolors = true -- Enable GUI colors for the terminal to get truecolor 22 | opt.list = true -- show whitespace 23 | opt.listchars = { 24 | nbsp = '⦸', -- CIRCLED REVERSE SOLIDUS (U+29B8, UTF-8: E2 A6 B8) 25 | extends = '»', -- RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK (U+00BB, UTF-8: C2 BB) 26 | precedes = '«', -- LEFT-POINTING DOUBLE ANGLE QUOTATION MARK (U+00AB, UTF-8: C2 AB) 27 | tab = ' ', -- '▷─' WHITE RIGHT-POINTING TRIANGLE (U+25B7, UTF-8: E2 96 B7) + BOX DRAWINGS HEAVY TRIPLE DASH HORIZONTAL (U+2505, UTF-8: E2 94 85) 28 | trail = '•', -- BULLET (U+2022, UTF-8: E2 80 A2) 29 | space = ' ', 30 | } 31 | opt.fillchars = { 32 | diff = '∙', -- BULLET OPERATOR (U+2219, UTF-8: E2 88 99) 33 | eob = ' ', -- NO-BREAK SPACE (U+00A0, UTF-8: C2 A0) to suppress ~ at EndOfBuffer 34 | fold = '·', -- MIDDLE DOT (U+00B7, UTF-8: C2 B7) 35 | vert = '│', -- window border when window splits vertically ─ ┴ ┬ ┤ ├ ┼ 36 | } 37 | 38 | -- backup related options 39 | -- neovim backup directory 40 | local backup_dir = vim.fn.stdpath('data').."/.cache" 41 | opt.backup = true -- make backups before writing 42 | opt.undofile = false -- persistent undos - undo after you re-open the file 43 | opt.writebackup = true -- Make backup before overwriting the current buffer 44 | opt.backupcopy = 'yes' -- Overwrite the original backup file 45 | opt.directory = backup_dir .. '/swap' -- directory to place swap files in 46 | opt.backupdir = backup_dir .. '/backedUP' -- where to put backup files 47 | opt.undodir = backup_dir .. '/undos' -- where to put undo files 48 | opt.viewdir = backup_dir .. '/view' -- where to store files for :mkview 49 | opt.shada = "'100,<50,f50,n"..backup_dir.."/shada/shada" 50 | 51 | opt.clipboard = vim.opt.clipboard + "unnamedplus" -- copy & paste 52 | opt.wrap = false -- don't automatically wrap on load 53 | opt.showmatch = true -- show the matching part of the pair for [] {} and () 54 | 55 | opt.cursorline = true -- highlight current line 56 | opt.number = true -- show line numbers 57 | opt.relativenumber = false -- show relative line number 58 | 59 | opt.incsearch = true -- incremental search 60 | opt.hlsearch = true -- highlighted search results 61 | opt.ignorecase = true -- ignore case sensetive while searching 62 | opt.smartcase = true 63 | 64 | opt.scrolloff = 1 -- when scrolling, keep cursor 1 lines away from screen border 65 | opt.sidescrolloff = 2 -- keep 30 columns visible left and right of the cursor at all times 66 | opt.backspace = 'indent,start,eol' -- make backspace behave like normal again 67 | opt.mouse = "a" -- turn on mouse interaction 68 | opt.mousescroll = 'ver:3,hor:2' -- vertical and horizontal scroll speed 69 | opt.updatetime = 500 -- CursorHold interval 70 | 71 | opt.softtabstop = 4 72 | opt.shiftwidth = 4 -- spaces per tab (when shifting), when using the >> or << commands, shift lines by 4 spaces 73 | opt.tabstop = 4 -- spaces per tab 74 | opt.smarttab = true -- / indent/dedent in leading whitespace 75 | opt.autoindent = true -- maintain indent of current line 76 | -- opt.expandtab = false, -- don't expand tabs into spaces 77 | 78 | opt.shiftround = true 79 | 80 | opt.splitbelow = true -- open horizontal splits below current window 81 | opt.splitright = true -- open vertical splits to the right of the current window 82 | opt.laststatus = 3 -- always show status line. 3 means Global Status Line 83 | -- opt.colorcolumn = "79", -- vertical word limit line 84 | opt.cmdheight = 1 -- command height 85 | 86 | opt.hidden = true -- allows you to hide buffers with unsaved changes without being prompted 87 | opt.inccommand = 'split' -- live preview of :s results 88 | opt.shell = 'zsh' -- shell to use for `!`, `:!`, `system()` etc. 89 | opt.lazyredraw = true -- faster scrolling 90 | 91 | opt.wildignore = vim.opt.wildignore + '*.o,*.rej,*.so' -- patterns to ignore during file-navigation 92 | opt.completeopt = 'menuone,noselect,noinsert' -- completion options 93 | 94 | -- -- configs 95 | -- if vim.api.nvim_call_function('has', {'nvim-0.8'}) == 1 then 96 | -- vim.opt.cmdheight = 0 -- command height 97 | -- end 98 | 99 | 100 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 101 | -- ━━━━━━━━━━━━━━━━━━━❰ Automate ❱━━━━━━━━━━━━━━━━━━━━ -- 102 | 103 | local group = api.nvim_create_augroup("AbstractAutoGroup", {clear=true}) 104 | 105 | api.nvim_create_autocmd( 106 | "TextYankPost", 107 | { 108 | desc = "highlight text on yank", 109 | pattern = "*", 110 | group = group, 111 | callback = function() 112 | vim.highlight.on_yank { 113 | higroup="Search", timeout=150, on_visual=true 114 | } 115 | end, 116 | } 117 | ) 118 | 119 | api.nvim_create_autocmd( 120 | "BufWinEnter", 121 | { 122 | desc = "jump to the last position when reopening a file", 123 | pattern = "*", 124 | group = group, 125 | command = [[ if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal! g`\"" | endif ]] 126 | } 127 | ) 128 | 129 | api.nvim_create_autocmd( 130 | "BufWritePre", 131 | { 132 | desc = "remove whitespaces on save", 133 | pattern = "*", 134 | group = group, 135 | command = "%s/\\s\\+$//e", 136 | } 137 | ) 138 | 139 | api.nvim_create_autocmd( 140 | {"BufEnter", "FileType"}, 141 | { 142 | desc = "don't auto comment new line", 143 | pattern = "*", 144 | group = group, 145 | command = "setlocal formatoptions-=c formatoptions-=r formatoptions-=o", 146 | } 147 | ) 148 | 149 | -- api.nvim_create_autocmd( 150 | -- "VimResized", 151 | -- { 152 | -- desc = "auto resize splited windows", 153 | -- pattern = "*", 154 | -- group = group, 155 | -- command = "tabdo wincmd =", 156 | -- } 157 | -- ) 158 | 159 | api.nvim_create_autocmd( 160 | "BufWinEnter", 161 | { 162 | desc = "clear the last used search pattern", 163 | pattern = "*", 164 | group = group, 165 | command = "let @/ = ''", 166 | } 167 | ) 168 | 169 | local init_color_fg = vim.api.nvim_get_hl_by_name("CursorLineNr", true).foreground 170 | local init_color_bg = vim.api.nvim_get_hl_by_name("CursorLineNr", true).background 171 | api.nvim_create_autocmd( 172 | { 'ModeChanged', 'InsertLeave'}, 173 | { 174 | desc = "change cursor color on mode change", 175 | group = group, 176 | callback = function() 177 | local mode = vim.api.nvim_get_mode().mode 178 | if mode == "i" then 179 | api.nvim_set_hl(0, "CursorLineNr", {fg="#000000", bg="#ac3131", bold=true}) 180 | elseif mode == "v" or mode == "V" or mode == "" then 181 | api.nvim_set_hl(0, "CursorLineNr", {fg="#000000", bg="#d1d1d1", bold=true}) 182 | else 183 | vim.api.nvim_set_hl(0, "CursorLineNr", {fg=init_color_fg, bg=init_color_bg, bold=true}) 184 | end 185 | end, 186 | } 187 | ) 188 | 189 | -- ━━━━━━━━━━━━━━━━❰ end of Automate ❱━━━━━━━━━━━━━━━━ -- 190 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 191 | 192 | 193 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 194 | -- ━━━━━━━━━❰ end of Plugin-Independent Configs ❱━━━━━━━━━━ -- 195 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 196 | 197 | -------------------------------------------------------------------------------- /lua/plugins/nvim_navic.lua: -------------------------------------------------------------------------------- 1 | 2 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 3 | -- ───────────────────────────────────────────────── -- 4 | -- Plugin: nvim-navic 5 | -- Github: github.com/SmiteshP/nvim-navic 6 | -- ───────────────────────────────────────────────── -- 7 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 8 | 9 | 10 | 11 | 12 | 13 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 14 | -- ━━━━━━━━━━━━━━━━━━━❰ configs ❱━━━━━━━━━━━━━━━━━━━ -- 15 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 16 | 17 | local import_navic, navic = pcall(require, "nvim-navic") 18 | if not import_navic then return end 19 | 20 | 21 | navic.setup({ 22 | highlight = true, 23 | separator = " ", 24 | depth_limit = 0, 25 | depth_limit_indicator = "..", 26 | 27 | icons = { 28 | File = " ", 29 | Module = " ", 30 | Namespace = " ", 31 | Package = " ", 32 | Class = " ", 33 | Method = " ", 34 | Property = " ", 35 | Field = " ", 36 | Constructor = " ", 37 | Enum = " ", 38 | Interface = " ", 39 | Function = " ", 40 | Variable = " ", 41 | Constant = " ", 42 | String = " ", 43 | Number = " ", 44 | Boolean = " ", 45 | Array = " ", 46 | Object = " ", 47 | Key = " ", 48 | Null = " ", 49 | EnumMember = " ", 50 | Struct = " ", 51 | Event = " ", 52 | Operator = " ", 53 | TypeParameter = " ", 54 | }, 55 | }) 56 | 57 | 58 | local function set_highlight(group, fg, bg, style) 59 | local options = { fg=fg, bg=bg } 60 | if style ~= nil then 61 | local italic, bold = false, false 62 | if style == 'italic' then italic = true end 63 | if style == 'bold' then bold = true end 64 | options = { fg=fg, bg=bg, italic=italic, bold=bold } 65 | end 66 | vim.api.nvim_set_hl(0, group, options) 67 | end 68 | 69 | 70 | local function init_highlight() 71 | set_highlight("NavicFileName", "#acacac", "#080808") 72 | set_highlight("NavicSeparator", "#51578f", "#080808", "italic") 73 | set_highlight("NavicText", "#666666", "#080808", "italic") 74 | 75 | set_highlight("NavicIconsArray", "#8b1540", "#080808", "italic") 76 | set_highlight("NavicIconsBoolean", "#015c8a", "#080808", "italic") 77 | set_highlight("NavicIconsClass", "#8d5c18", "#080808", "italic") 78 | set_highlight("NavicIconsConstant", "#FFFADE", "#080808", "italic") 79 | set_highlight("NavicIconsConstructor", "#015e8c", "#080808", "italic") 80 | set_highlight("NavicIconsEnum", "#168888", "#080808", "italic") 81 | set_highlight("NavicIconsEnumMember", "#0c494a", "#080808", "italic") 82 | set_highlight("NavicIconsEvent", "#8f476b", "#080808", "italic") 83 | set_highlight("NavicIconsField", "#038286", "#080808", "italic") 84 | -- set_highlight("NavicIconsFile", "#666666", "#080808", "italic") 85 | set_highlight("NavicIconsFunction", "#722587", "#080808", "italic") 86 | set_highlight("NavicIconsInterface", "#8b2c27", "#080808", "italic") 87 | set_highlight("NavicIconsKey", "#8a0015", "#080808", "italic") 88 | set_highlight("NavicIconsMethod", "#73538c", "#080808", "italic") 89 | set_highlight("NavicIconsModule", "#8d7138", "#080808", "italic") 90 | set_highlight("NavicIconsNamespace", "#FFFFFF", "#080808", "italic") 91 | set_highlight("NavicIconsNull", "#8c0015", "#080808", "italic") 92 | set_highlight("NavicIconsNumber", "#8a6e37", "#080808", "italic") 93 | set_highlight("NavicIconsObject", "#8d008d", "#080808", "italic") 94 | set_highlight("NavicIconsOperator", "#8b1540", "#080808", "italic") 95 | set_highlight("NavicIconsPackage", "#005a83", "#080808", "italic") 96 | set_highlight("NavicIconsProperty", "#008f6b", "#080808", "italic") 97 | set_highlight("NavicIconsString", "#8a3c24", "#080808", "italic") 98 | set_highlight("NavicIconsStruct", "#8c1717", "#080808", "italic") 99 | set_highlight("NavicIconsTypeParameter","#4d748f", "#080808", "italic") 100 | set_highlight("NavicIconsVariable", "#008470", "#080808", "italic") 101 | end 102 | 103 | local function filetype_exclude(filetype) 104 | -- disable winbar in these filetypes 105 | local filetype_to_exclude = { 106 | "", 107 | "alpha", 108 | "dap-repl", 109 | "dap-terminal", 110 | "dapui_breakpoints", 111 | "dapui_console", 112 | "dapui_scopes", 113 | "dapui_stacks", 114 | "dapui_watches", 115 | "dashboard", 116 | "DressingSelect", 117 | "harpoon", 118 | "help", 119 | "Jaq", 120 | "lab", 121 | "lir", 122 | "Markdown", 123 | "mason", 124 | "neo-tree", 125 | "neogitstatus", 126 | "notify", 127 | "NvimTree", 128 | "Outline", 129 | "packer", 130 | "spectre_panel", 131 | "startify", 132 | "TelescopePrompt", 133 | "toggleterm", 134 | "Trouble", 135 | } 136 | if vim.tbl_contains(filetype_to_exclude, filetype) then 137 | return true 138 | end 139 | return false 140 | end 141 | 142 | 143 | local function get_filetype_icon() 144 | local import_devicons, devicons = pcall(require, 'nvim-web-devicons') 145 | if not import_devicons then 146 | return false 147 | end 148 | local file_name = vim.fn.expand('%:t') 149 | local ext = vim.fn.expand "%:e" 150 | local icon, icon_color = devicons.get_icon_color(file_name, ext, { default = true }) 151 | 152 | return { 153 | icon = icon, 154 | icon_color = icon_color 155 | } 156 | end 157 | 158 | 159 | local function winbar() 160 | if filetype_exclude(vim.bo.filetype) then 161 | return 162 | end 163 | local filename = vim.fn.expand "%:t" 164 | local file = "" 165 | local winbar_data = "" 166 | 167 | if filename ~= "" or filename ~= nil then 168 | local dev_icon = get_filetype_icon() 169 | if dev_icon then 170 | local icon = dev_icon.icon 171 | local icon_color = dev_icon.icon_color 172 | if icon == "" or icon == nil then 173 | icon = " " 174 | end 175 | set_highlight("NavicFileIcon", icon_color, "#080808") 176 | file = " " .. "%#NavicFileIcon#" .. icon .. "%*" .. " " .. "%#NavicFileName#" .. filename .. "%*" 177 | end 178 | 179 | -- show modified flag/icon if file is being modified and not saved 180 | if vim.bo.modified then 181 | file = file .. "%#NavicFileName#" .. "" .. "%*" 182 | end 183 | winbar_data = file 184 | 185 | if navic.is_available() then 186 | local status_getlocation, navic_location = pcall(navic.get_location, {}) 187 | if not status_getlocation then 188 | goto continue_winbar 189 | end 190 | if navic_location == "error" then 191 | goto continue_winbar 192 | end 193 | if not (navic_location == "" or navic_location == nil ) then 194 | -- winbar_data = "%#NavicSeparator#"..">" .. "%*" .. " " .. navic_location 195 | winbar_data = " " .. navic_location 196 | else 197 | goto continue_winbar 198 | end 199 | winbar_data = file .. winbar_data 200 | end 201 | end 202 | 203 | ::continue_winbar:: 204 | local status_setwinbar, _ = pcall(vim.api.nvim_set_option_value, "winbar", winbar_data, { scope = "local" }) 205 | if not status_setwinbar then 206 | return 207 | end 208 | end 209 | 210 | 211 | init_highlight() 212 | 213 | vim.api.nvim_create_autocmd( 214 | { "BufFilePost", "BufWinEnter", "BufWritePost", "CursorHold", "CursorMoved", "InsertEnter", "TabClosed" }, 215 | { 216 | desc = "don't load winbar for certain filetypes and buffers", 217 | pattern = "*", 218 | group = vim.api.nvim_create_augroup("AbstractWinbarAutoGroup", {clear=true}), 219 | 220 | callback = function() 221 | winbar() 222 | end, 223 | } 224 | ) 225 | 226 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 227 | -- ━━━━━━━━━━━━━━━━━❰ end configs ❱━━━━━━━━━━━━━━━━━ -- 228 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 229 | 230 | -------------------------------------------------------------------------------- /lua/plugins/nvim-bufferline_lua.lua: -------------------------------------------------------------------------------- 1 | 2 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 3 | -- ───────────────────────────────────────────────── -- 4 | -- Plugin: nvim-bufferline.lua 5 | -- Github: github.com/akinsho/nvim-bufferline.lua 6 | -- ───────────────────────────────────────────────── -- 7 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 8 | 9 | 10 | 11 | 12 | 13 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 14 | -- ━━━━━━━━━━━━━━━━━━━❰ configs ❱━━━━━━━━━━━━━━━━━━━ -- 15 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 16 | 17 | -- safely import bufferline 18 | local bufferline_imported, bufferline = pcall(require, 'bufferline') 19 | if not bufferline_imported then return end 20 | 21 | bufferline.setup { 22 | 23 | options = { 24 | 25 | mode = "buffers", -- set to "tabs" to only show tabpages instead 26 | numbers = "ordinal", -- "none" | "ordinal" | "buffer_id" | "both" | function({ ordinal, id, lower, raise }): string 27 | always_show_bufferline = false, -- don't show bufferline if there is only one file is opened 28 | 29 | close_command = "bdelete! %d", -- can be a string | function, see "Mouse actions" 30 | right_mouse_command = "bdelete! %d", -- can be a string | function, see "Mouse actions" 31 | left_mouse_command = "buffer %d", -- can be a string | function, see "Mouse actions" 32 | middle_mouse_command = nil, -- can be a string | function, see "Mouse actions" 33 | 34 | -- NOTE: this plugin is designed with this icon in mind, 35 | -- and so changing this is NOT recommended, this is intended 36 | -- as an escape hatch for people who cannot bear it for whatever reason 37 | indicator = { 38 | icon = '▎', -- this should be omitted if indicator style is not 'icon' 39 | style = 'underline', -- 'icon' | 'underline' | 'none', 40 | }, 41 | buffer_close_icon = '', 42 | modified_icon = '●', 43 | close_icon = '', 44 | left_trunc_marker = '', 45 | right_trunc_marker = '', 46 | 47 | --- name_formatter can be used to change the buffer's label in the bufferline. 48 | --- Please note some names can/will break the 49 | --- bufferline so use this at your discretion knowing that it has 50 | --- some limitations that will *NOT* be fixed. 51 | name_formatter = function(buf) -- buf contains a "name", "path" and "bufnr" 52 | -- remove extension from markdown files for example 53 | if buf.name:match('%.md') then return vim.fn.fnamemodify(buf.name, ':t:r') end 54 | end, 55 | 56 | max_name_length = 22, 57 | max_prefix_length = 18, -- prefix used when a buffer is de-duplicate 58 | tab_size = 22, 59 | 60 | show_close_icon = false, 61 | show_buffer_icons = true, -- disable filetype icons for buffers 62 | show_buffer_close_icons = false, 63 | show_tab_indicators = true, 64 | enforce_regular_tabs = false, -- if set true, tabs will be prevented from extending beyond the tab size and all tabs will be the same length 65 | 66 | view = "multiwindow", 67 | -- can also be a table containing 2 custom separators 68 | -- [focused and unfocused]. eg: { '|', '|' } 69 | separator_style = {"", ""}, -- options "slant" | "thick" | "thin" | { 'any', 'any' }, 70 | offsets = { 71 | -- options function , text_" "h always_show_bufferline = false 72 | {filetype = "NvimTree", text = "EXPLORER", text_align = "center"}, 73 | {filetype = "neo-tree", text = "EXPLORER", text_align = "center"}, 74 | }, 75 | }, 76 | 77 | highlights = { 78 | fill = {bg={highlight="BufferLineFill", attribute="bg"}}, 79 | background = { -- current tab 80 | fg={highlight="BufferCurrent", attribute="fg"}, 81 | bg={highlight="BufferCurrent", attribute="bg"}, 82 | }, 83 | buffer_selected = { 84 | fg={highlight="fg", attribute="fg"}, 85 | bg={highlight="BufferSelected", attribute="bg"}, 86 | italic = false 87 | }, 88 | close_button_selected = { 89 | fg={highlight="BufferCloseButtonSelected", attribute="fg"}, 90 | bg={highlight="BufferCloseButtonSelected", attribute="bg"}, 91 | }, 92 | duplicate = { 93 | fg={highlight="fg", attribute="fg"}, 94 | bg={highlight="BufferCurrent", attribute="bg"}, 95 | }, 96 | duplicate_selected = { 97 | fg={highlight="fg", attribute="fg"}, 98 | bg={highlight="BufferCurrent", attribute="bg"}, 99 | }, 100 | indicator_selected = { bg={highlight="BufferSelected", attribute="bg"}, }, 101 | modified = { 102 | fg={highlight="BufferCurrentSign", attribute="fg"}, 103 | bg={highlight="BufferLineFill", attribute="bg"}, 104 | }, 105 | modified_selected = { 106 | fg={highlight="BufferCurrentSign", attribute="fg"}, 107 | bg={highlight="BufferLineFill", attribute="bg"}, 108 | }, 109 | numbers = { bg={highlight="BuffNumbers", attribute="bg"}, }, 110 | numbers_selected = { bg={highlight="BuffNumbers", attribute="bg"}, italic = false, }, 111 | tab_selected = { 112 | fg={highlight="TabSelectedFG", attribute="fg"}, 113 | bg={highlight="TabSelectedBG", attribute="bg"}, 114 | }, 115 | tab = { 116 | fg={highlight="TabFG", attribute="fg"}, 117 | bg={highlight="TabBG", attribute="bg"}, 118 | }, 119 | tab_close = { 120 | fg={highlight="TabFG", attribute="fg"}, 121 | bg={highlight="TabBG", attribute="bg"}, 122 | }, 123 | close_button = { 124 | fg={highlight="TabFG", attribute="fg"}, 125 | bg={highlight="TabBG", attribute="bg"}, 126 | }, 127 | 128 | -- duplicate_visible = { 129 | -- }, 130 | -- close_button = { 131 | -- }, 132 | -- close_button_visible = { 133 | -- }, 134 | -- tab_selected = { 135 | -- }, 136 | -- buffer_visible = { 137 | -- }, 138 | -- buffer_selected = { 139 | -- }, 140 | -- modified_visible = { 141 | -- }, 142 | -- separator_visible = { 143 | -- }, 144 | -- indicator_selected = { 145 | -- }, 146 | }, 147 | 148 | } 149 | 150 | -- vim.cmd("autocmd BufDelete * if len(getbufinfo({'buflisted':1})) -1 < 1 | set showtabline=1 | endif") 151 | 152 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 153 | -- ━━━━━━━━━━━━━━━━━❰ end configs ❱━━━━━━━━━━━━━━━━━ -- 154 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 155 | 156 | 157 | 158 | 159 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 160 | -- ━━━━━━━━━━━━━━━━━━❰ Mappings ❱━━━━━━━━━━━━━━━━━━━ -- 161 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 162 | 163 | local keymap = vim.api.nvim_set_keymap 164 | local options = {noremap = true, silent = true} 165 | 166 | -- Move to previous/next 167 | keymap('n', '\\', ':BufferLineCycleNext', options) 168 | keymap('n', '|', ':BufferLineCyclePrev', options) 169 | 170 | -- Re-order to previous/next 171 | keymap('n', '.', ':BufferLineMoveNext', options) 172 | keymap('n', ',', ':BufferLineMovePrev', options) 173 | 174 | -- Close buffer 175 | -- nnoremap :BufferClose 176 | 177 | -- Magic buffer-picking mode 178 | keymap('n', '<\\>', ':BufferLinePick', options) 179 | 180 | -- go to buffer number 181 | keymap('n', '1', ':BufferLineGoToBuffer 1', options) 182 | keymap('n', '2', ':BufferLineGoToBuffer 2', options) 183 | keymap('n', '3', ':BufferLineGoToBuffer 3', options) 184 | keymap('n', '4', ':BufferLineGoToBuffer 4', options) 185 | keymap('n', '5', ':BufferLineGoToBuffer 5', options) 186 | keymap('n', '6', ':BufferLineGoToBuffer 6', options) 187 | keymap('n', '7', ':BufferLineGoToBuffer 7', options) 188 | keymap('n', '8', ':BufferLineGoToBuffer 8', options) 189 | keymap('n', '9', ':BufferLineGoToBuffer 9', options) 190 | 191 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 192 | -- ━━━━━━━━━━━━━━━━━❰ end Mappings ❱━━━━━━━━━━━━━━━━ -- 193 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 194 | 195 | -------------------------------------------------------------------------------- /lua/plugins/nvim-tree_lua.lua: -------------------------------------------------------------------------------- 1 | 2 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 3 | -- ───────────────────────────────────────────────── -- 4 | -- Plugin: nvim-tree.lua 5 | -- Github: github.com/kyazdani42/nvim-tree.lua 6 | -- ───────────────────────────────────────────────── -- 7 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 8 | 9 | 10 | 11 | 12 | 13 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 14 | -- ━━━━━━━━━━━━━━━━━━━❰ Mappings ❱━━━━━━━━━━━━━━━━━━ -- 15 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 16 | 17 | vim.api.nvim_set_keymap('n', 'f', ':NvimTreeToggle', {noremap = true, silent = true}) 18 | 19 | local function on_attach(bufnr) 20 | local api = require('nvim-tree.api') 21 | 22 | local function opts(desc) 23 | return { desc = 'nvim-tree: ' .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true } 24 | end 25 | 26 | 27 | -- Default mappings. Feel free to modify or remove as you wish. 28 | -- 29 | -- BEGIN_DEFAULT_ON_ATTACH 30 | vim.keymap.set('n', '', api.tree.change_root_to_node, opts('CD')) 31 | vim.keymap.set('n', '', api.node.open.replace_tree_buffer, opts('Open: In Place')) 32 | vim.keymap.set('n', '', api.node.show_info_popup, opts('Info')) 33 | vim.keymap.set('n', '', api.fs.rename_sub, opts('Rename: Omit Filename')) 34 | vim.keymap.set('n', '', api.node.open.tab, opts('Open: New Tab')) 35 | vim.keymap.set('n', '', api.node.open.vertical, opts('Open: Vertical Split')) 36 | vim.keymap.set('n', '', api.node.open.horizontal, opts('Open: Horizontal Split')) 37 | vim.keymap.set('n', '', api.node.navigate.parent_close, opts('Close Directory')) 38 | vim.keymap.set('n', '', api.node.open.edit, opts('Open')) 39 | vim.keymap.set('n', '', api.node.open.preview, opts('Open Preview')) 40 | vim.keymap.set('n', '>', api.node.navigate.sibling.next, opts('Next Sibling')) 41 | vim.keymap.set('n', '<', api.node.navigate.sibling.prev, opts('Previous Sibling')) 42 | vim.keymap.set('n', '.', api.node.run.cmd, opts('Run Command')) 43 | vim.keymap.set('n', '-', api.tree.change_root_to_parent, opts('Up')) 44 | vim.keymap.set('n', 'a', api.fs.create, opts('Create')) 45 | vim.keymap.set('n', 'bmv', api.marks.bulk.move, opts('Move Bookmarked')) 46 | vim.keymap.set('n', 'B', api.tree.toggle_no_buffer_filter, opts('Toggle No Buffer')) 47 | vim.keymap.set('n', 'c', api.fs.copy.node, opts('Copy')) 48 | vim.keymap.set('n', 'C', api.tree.toggle_git_clean_filter, opts('Toggle Git Clean')) 49 | vim.keymap.set('n', '[c', api.node.navigate.git.prev, opts('Prev Git')) 50 | vim.keymap.set('n', ']c', api.node.navigate.git.next, opts('Next Git')) 51 | vim.keymap.set('n', 'd', api.fs.remove, opts('Delete')) 52 | vim.keymap.set('n', 'D', api.fs.trash, opts('Trash')) 53 | vim.keymap.set('n', 'E', api.tree.expand_all, opts('Expand All')) 54 | vim.keymap.set('n', 'e', api.fs.rename_basename, opts('Rename: Basename')) 55 | vim.keymap.set('n', ']e', api.node.navigate.diagnostics.next, opts('Next Diagnostic')) 56 | vim.keymap.set('n', '[e', api.node.navigate.diagnostics.prev, opts('Prev Diagnostic')) 57 | vim.keymap.set('n', 'F', api.live_filter.clear, opts('Clean Filter')) 58 | vim.keymap.set('n', 'f', api.live_filter.start, opts('Filter')) 59 | vim.keymap.set('n', 'g?', api.tree.toggle_help, opts('Help')) 60 | vim.keymap.set('n', 'gy', api.fs.copy.absolute_path, opts('Copy Absolute Path')) 61 | vim.keymap.set('n', 'H', api.tree.toggle_hidden_filter, opts('Toggle Dotfiles')) 62 | vim.keymap.set('n', 'I', api.tree.toggle_gitignore_filter, opts('Toggle Git Ignore')) 63 | vim.keymap.set('n', 'J', api.node.navigate.sibling.last, opts('Last Sibling')) 64 | vim.keymap.set('n', 'K', api.node.navigate.sibling.first, opts('First Sibling')) 65 | vim.keymap.set('n', 'm', api.marks.toggle, opts('Toggle Bookmark')) 66 | vim.keymap.set('n', 'o', api.node.open.edit, opts('Open')) 67 | vim.keymap.set('n', 'O', api.node.open.no_window_picker, opts('Open: No Window Picker')) 68 | vim.keymap.set('n', 'p', api.fs.paste, opts('Paste')) 69 | vim.keymap.set('n', 'P', api.node.navigate.parent, opts('Parent Directory')) 70 | vim.keymap.set('n', 'q', api.tree.close, opts('Close')) 71 | vim.keymap.set('n', 'r', api.fs.rename, opts('Rename')) 72 | vim.keymap.set('n', 'R', api.tree.reload, opts('Refresh')) 73 | vim.keymap.set('n', 's', api.node.run.system, opts('Run System')) 74 | vim.keymap.set('n', 'S', api.tree.search_node, opts('Search')) 75 | vim.keymap.set('n', 'U', api.tree.toggle_custom_filter, opts('Toggle Hidden')) 76 | vim.keymap.set('n', 'W', api.tree.collapse_all, opts('Collapse')) 77 | vim.keymap.set('n', 'x', api.fs.cut, opts('Cut')) 78 | vim.keymap.set('n', 'y', api.fs.copy.filename, opts('Copy Name')) 79 | vim.keymap.set('n', 'Y', api.fs.copy.relative_path, opts('Copy Relative Path')) 80 | vim.keymap.set('n', '<2-LeftMouse>', api.node.open.edit, opts('Open')) 81 | vim.keymap.set('n', '<2-RightMouse>', api.tree.change_root_to_node, opts('CD')) 82 | -- END_DEFAULT_ON_ATTACH 83 | 84 | 85 | -- Mappings migrated from view.mappings.list 86 | -- 87 | -- You will need to insert "your code goes here" for any mappings with a custom action_cb 88 | vim.keymap.set('n', 'g?', api.tree.toggle_help, opts('Help')) 89 | 90 | end 91 | 92 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 93 | -- ━━━━━━━━━━━━━━━━━❰ end Mappings ❱━━━━━━━━━━━━━━━━ -- 94 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 95 | 96 | 97 | 98 | 99 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 100 | -- ━━━━━━━━━━━━━━━━━━━❰ configs ❱━━━━━━━━━━━━━━━━━━━ -- 101 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 102 | 103 | local import_ntree, nvim_tree = pcall(require, "nvim-tree") 104 | if not import_ntree then return end 105 | 106 | local import_treecb, tree_cb = pcall(require, "nvim-tree.config") 107 | if import_treecb then 108 | tree_cb = tree_cb.nvim_tree_callback 109 | end 110 | 111 | local cmd = vim.cmd -- execute Vim commands 112 | cmd('autocmd ColorScheme * highlight highlight NvimTreeBg guibg=None') 113 | cmd('autocmd FileType NvimTree setlocal winhighlight=Normal:NvimTreeBg') 114 | 115 | 116 | 117 | -- each of these are documented in `:help nvim-tree.OPTION_NAME` 118 | nvim_tree.setup ({ 119 | 120 | on_attach = on_attach, -- mappings 121 | 122 | disable_netrw = false, 123 | hijack_netrw = false, 124 | -- auto_close = false, 125 | open_on_tab = false, 126 | hijack_cursor = false, 127 | update_cwd = false, 128 | hijack_directories = {enable = true, auto_open = true}, 129 | diagnostics = { 130 | enable = false, 131 | icons = {hint = "", info = "", warning = "", error = ""}, 132 | }, 133 | git = {enable = false}, 134 | update_focused_file = {enable = true, update_cwd = false, ignore_list = {}}, 135 | system_open = {cmd = nil, args = {}}, 136 | filters = {dotfiles = false, custom = {}}, 137 | 138 | renderer = { 139 | indent_markers = { 140 | enable = true, -- show indent markers when folders are open 141 | }, 142 | -- highlight_opened_files = "all", -- Highlight icons and/or names for opened files. Value can be `"none"`, `"icon"`, `"name"` or `"all"`. 143 | }, 144 | 145 | view = { 146 | width = 25, 147 | hide_root_folder = false, 148 | side = 'left', 149 | signcolumn = "no", 150 | -- auto_resize = true, 151 | 152 | }, 153 | }) 154 | 155 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 156 | -- ━━━━━━━━━━━━━━━━━❰ end configs ❱━━━━━━━━━━━━━━━━━ -- 157 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 158 | -------------------------------------------------------------------------------- /lua/plugins/feline_nvim.lua: -------------------------------------------------------------------------------- 1 | 2 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 3 | -- ───────────────────────────────────────────────── -- 4 | -- Plugin: feline.nvim 5 | -- Github: github.com/feline-nvim/feline.nvim 6 | -- ───────────────────────────────────────────────── -- 7 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 8 | 9 | 10 | 11 | 12 | 13 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 14 | -- ━━━━━━━━━━━━━━━━━━━❰ configs ❱━━━━━━━━━━━━━━━━━━━ -- 15 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 16 | 17 | local import_feline, feline = pcall(require, 'feline') 18 | if not import_feline then return end 19 | 20 | local lsp = require('feline.providers.lsp') 21 | local vi_mode_utils = require('feline.providers.vi_mode') 22 | 23 | -- local lsp_status = require('lsp-status') 24 | -- lsp_status.register_progress() 25 | 26 | local b = vim.b 27 | local fn = vim.fn 28 | local api = vim.api 29 | 30 | local components = {active = {}, inactive = {}} 31 | 32 | vim.opt.termguicolors = true -- Enable GUI colors for the terminal to get truecolor 33 | 34 | components.active[1] = { 35 | {provider = ' ', hl = {fg = 'skyblue'}}, 36 | { 37 | provider = function () 38 | local mode = api.nvim_exec('echo mode()', true) 39 | if mode == "" then 40 | return "C" 41 | end 42 | return string.upper(mode) 43 | end, 44 | hl = function() 45 | return { 46 | name = vi_mode_utils.get_mode_highlight_name(), 47 | fg = vi_mode_utils.get_mode_color(), 48 | style = 'bold', 49 | } 50 | end, 51 | right_sep = '', 52 | }, 53 | { 54 | provider = { 55 | name = "file_info", 56 | opts = { type = "relative-short" } 57 | }, 58 | hl = {fg = 'black', bg = 'f_color', style = 'italic'}, 59 | left_sep = { 60 | ' ', 61 | 'slant_left_2', 62 | {str = ' ', hl = {bg = 'f_color', fg = 'NONE'}}, 63 | }, 64 | }, 65 | { 66 | provider = function () 67 | local filetype = vim.bo.filetype 68 | if filetype ~= "" and filetype ~= "alpha" then 69 | return " [" .. filetype .. "]" 70 | end 71 | return " " 72 | end, 73 | hl = {fg = 'black', bg = 'f_color', style = 'NONE'}, 74 | right_sep = {'slant_right_2', ' '}, 75 | }, 76 | { 77 | provider = 'file_size', 78 | enabled = function() return fn.getfsize(fn.expand('%:p')) > 0 end, 79 | right_sep = {' ', {str = ' ', hl = {fg = 'fg', bg = 'bg'}}}, 80 | }, 81 | { 82 | provider = function() 83 | local name_with_path = os.getenv('VIRTUAL_ENV') 84 | local venv = {}; 85 | for match in (name_with_path .. "/"):gmatch("(.-)" .. "/") do 86 | table.insert(venv, match); 87 | end 88 | return "" .. venv[#venv] 89 | end, 90 | enabled = function() return os.getenv('VIRTUAL_ENV') ~= nil end, 91 | right_sep = " ", 92 | }, 93 | { 94 | provider = 'git_branch', 95 | hl = {fg = 'cyan2', bg = 'bg', style = 'bold'}, 96 | right_sep = function() 97 | local val = {hl = {fg = 'NONE', bg = 'bg'}} 98 | if b.gitsigns_status_dict then 99 | val.str = ' ' 100 | else 101 | val.str = '' 102 | end 103 | return val 104 | end, 105 | }, 106 | { 107 | provider = 'git_diff_added', 108 | icon = {str = ' +', hl = {fg = 'green', style = 'bold'}}, 109 | hl = {fg = 'green', style = 'bold'}, 110 | }, 111 | { 112 | provider = 'git_diff_changed', 113 | icon = {str = ' ~', hl = {fg = 'orange', style = 'bold'}}, 114 | hl = {fg = 'orange', style = 'bold'}, 115 | }, 116 | { 117 | provider = 'git_diff_removed', 118 | icon = {str = ' -', hl = {fg = 'red', style = 'bold'}}, 119 | hl = {fg = 'red', style = 'bold'}, 120 | right_sep = function() 121 | local val = {hl = {fg = 'NONE', bg = 'bg'}} 122 | if b.gitsigns_status_dict then 123 | val.str = ' ' 124 | else 125 | val.str = '' 126 | end 127 | return val 128 | end, 129 | }, 130 | } 131 | 132 | components.active[2] = { 133 | { 134 | provider = 'diagnostic_errors', 135 | enabled = function() 136 | return lsp.diagnostics_exist(vim.diagnostic.severity.ERROR) 137 | end, 138 | hl = {fg = 'red'}, 139 | }, 140 | { 141 | provider = 'diagnostic_warnings', 142 | enabled = function() 143 | return lsp.diagnostics_exist(vim.diagnostic.severity.WARN) 144 | end, 145 | hl = {fg = 'yellow'}, 146 | }, 147 | { 148 | provider = 'diagnostic_hints', 149 | enabled = function() 150 | return lsp.diagnostics_exist(vim.diagnostic.severity.HINT) 151 | end, 152 | hl = {fg = 'cyan'}, 153 | }, 154 | { 155 | provider = 'diagnostic_info', 156 | enabled = function() 157 | return lsp.diagnostics_exist(vim.diagnostic.severity.INFO) 158 | end, 159 | hl = {fg = 'skyblue'}, 160 | }, 161 | { 162 | provider = function() 163 | local msg = '' 164 | local buf_ft = api.nvim_buf_get_option(0, 'filetype') 165 | local clients = vim.lsp.get_active_clients() 166 | if next(clients) == nil then return msg end 167 | for _, client in ipairs(clients) do 168 | local filetypes = client.config.filetypes 169 | if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then 170 | if client.name ~= "null-ls" then return "LSP[" .. client.name .. "]" end 171 | end 172 | end 173 | return msg 174 | end, 175 | -- hl = {style = 'italic'}, 176 | hl = {fg='black'}, 177 | left_sep = {' ', {str = ' ', hl = {fg = 'fg', bg = 'bg'}}}, 178 | }, 179 | -- { 180 | -- provider = function () 181 | -- return lsp_status.status() 182 | -- end 183 | -- }, 184 | 185 | } 186 | 187 | components.active[3] = { 188 | { 189 | provider = function() 190 | -- thanks: https://github.com/nvim-lualine/lualine.nvim/issues/186#issuecomment-1170637440 191 | local hlsearch = api.nvim_get_vvar("hlsearch") 192 | if hlsearch == nil then goto empty end 193 | if hlsearch == 1 then 194 | local result = fn.searchcount({ maxcount = 999, timeout = 1000 }) 195 | local total = result.total 196 | if total == nil then goto empty end 197 | if total > 0 then 198 | local search_string = fn.getreg("/") 199 | return string.format("%s %d/%d", search_string, result.current, total) 200 | end 201 | end 202 | ::empty:: 203 | return "" 204 | end, 205 | left_sep = ' ', 206 | hl = {fg = 'yellow'} 207 | }, 208 | { 209 | provider = '  %l:%-2c- %L ', 210 | left_sep = ' ', 211 | hl = {fg = 'black', bg = 'f_color'}, 212 | }, 213 | { 214 | -- provider = 'scroll_bar', 215 | provider = ' ', 216 | hl = { 217 | fg = 'black', 218 | bg = 'f_color', 219 | -- style = 'bold', 220 | left_sep = ' ', 221 | -- right_sep = ' ' 222 | }, 223 | }, 224 | } 225 | 226 | -- components.inactive[1] = { } 227 | 228 | -- This table is equal to the default colors table 229 | local colors = { 230 | fg = '#C8C8C8', 231 | bg = '#141414', 232 | black = "#b7b7b7", 233 | black1 = '#1B1B1B', 234 | skyblue = '#50B0F0', 235 | cyan2 = '#006c6c', 236 | cyan = '#009090', 237 | green = '#60A040', 238 | oceanblue = '#0066cc', 239 | magenta = '#C26BDB', 240 | orange = '#FF9000', 241 | red = '#D10000', 242 | violet = '#9E93E8', 243 | white = '#FFFFFF', 244 | f_color = '#072b2c', 245 | yellow = '#E1E120', 246 | } 247 | 248 | -- This table is equal to the default separators table 249 | local separators = { 250 | vertical_bar = '┃', 251 | vertical_bar_thin = '│', 252 | left = '', 253 | right = '', 254 | block = '█', 255 | right_filled = '', 256 | left_filled = '', 257 | slant_left = '', 258 | slant_right = '', 259 | slant_left_2 = '', 260 | slant_right_2 = '', 261 | slant_left_thin = '', 262 | slant_right_thin = '', 263 | slant_left_2_thin = '', 264 | slant_right_2_thin = '', 265 | left_rounded_thin = '', 266 | right_rounded_thin = '', 267 | left_rounded = '', 268 | right_rounded = '', 269 | circle = '●', 270 | } 271 | 272 | -- This table is equal to the default vi_mode_colors table 273 | local vi_mode_colors = { 274 | ['NORMAL'] = 'green', 275 | ['OP'] = 'green', 276 | ['INSERT'] = 'red', 277 | ['VISUAL'] = 'skyblue', 278 | ['LINES'] = 'skyblue', 279 | ['BLOCK'] = 'skyblue', 280 | ['REPLACE'] = 'violet', 281 | ['V-REPLACE'] = 'violet', 282 | ['ENTER'] = 'cyan', 283 | ['MORE'] = 'cyan', 284 | ['SELECT'] = 'orange', 285 | ['COMMAND'] = 'green', 286 | ['SHELL'] = 'green', 287 | ['TERM'] = 'green', 288 | ['NONE'] = 'yellow', 289 | } 290 | 291 | -- This table is equal to the default force_inactive table 292 | local force_inactive = { 293 | filetypes = { 294 | 'NvimTree', 295 | 'packer', 296 | 'startify', 297 | 'fugitive', 298 | 'fugitiveblame', 299 | 'qf', 300 | 'help', 301 | }, 302 | buftypes = {'terminal'}, 303 | bufnames = {}, 304 | } 305 | 306 | -- This table is equal to the default disable table 307 | local disable = {filetypes = {}, buftypes = {}, bufnames = {}} 308 | 309 | -- This table is equal to the default update_triggers table 310 | local update_triggers = { 311 | 'VimEnter', 312 | 'WinEnter', 313 | 'WinClosed', 314 | 'FileChangedShellPost', 315 | } 316 | 317 | feline.setup({ 318 | theme = colors, 319 | separators = separators, 320 | vi_mode_colors = vi_mode_colors, 321 | force_inactive = force_inactive, 322 | disable = disable, 323 | update_triggers = update_triggers, 324 | components = components, 325 | }) 326 | 327 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 328 | -- ━━━━━━━━━━━━━━━━━❰ end configs ❱━━━━━━━━━━━━━━━━━ -- 329 | -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- 330 | 331 | -------------------------------------------------------------------------------- /lua/plugins/windline_nvim.lua: -------------------------------------------------------------------------------- 1 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 2 | --─────────────────────────────────────────────────-- 3 | -- Plugin: windline.nvim 4 | -- Github: github.com/windwp/windline.nvim 5 | --─────────────────────────────────────────────────-- 6 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 7 | 8 | 9 | 10 | 11 | 12 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 13 | --━━━━━━━━━━━━━━━━━━━❰ configs ❱━━━━━━━━━━━━━━━━━━━-- 14 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 15 | 16 | 17 | local windline = require('windline') 18 | local helper = require('windline.helpers') 19 | local sep = helper.separators 20 | local vim_components = require('windline.components.vim') 21 | 22 | local b_components = require('windline.components.basic') 23 | local state = _G.WindLine.state 24 | 25 | local lsp_comps = require('windline.components.lsp') 26 | local git_comps = require('windline.components.git') 27 | 28 | local hl_list = { 29 | Black = { 'white', 'black' }, 30 | White = { 'black', 'white' }, 31 | Inactive = { 'InactiveFg', 'InactiveBg' }, 32 | Active = { 'ActiveFg', 'ActiveBg' }, 33 | } 34 | local basic = {} 35 | 36 | basic.divider = { b_components.divider, '' } 37 | basic.space = { ' ', '' } 38 | basic.bg = { ' ', 'StatusLine' } 39 | basic.file_name_inactive = { b_components.full_file_name, hl_list.Inactive } 40 | basic.line_col_inactive = { b_components.line_col, hl_list.Inactive } 41 | basic.progress_inactive = { b_components.progress, hl_list.Inactive } 42 | 43 | basic.vi_mode = { 44 | hl_colors = { 45 | Normal = { 'black', 'blue', 'bold' }, 46 | Insert = { 'black', 'red', 'bold' }, 47 | Visual = { 'black', 'white', 'bold' }, 48 | Replace = { 'black', 'blue_light', 'bold' }, 49 | Command = { 'black', 'magenta', 'bold' }, 50 | NormalBefore = { 'blue', 'black' }, 51 | InsertBefore = { 'red', 'black' }, 52 | VisualBefore = { 'white', 'black' }, 53 | ReplaceBefore = { 'blue_light', 'black' }, 54 | CommandBefore = { 'magenta', 'black' }, 55 | NormalAfter = { 'white', 'blue' }, 56 | InsertAfter = { 'white', 'red' }, 57 | VisualAfter = { 'white', 'white' }, 58 | ReplaceAfter = { 'white', 'blue_light' }, 59 | CommandAfter = { 'white', 'magenta' }, 60 | }, 61 | text = function() 62 | return { 63 | { sep.left_rounded, state.mode[2] .. 'Before' }, 64 | { state.mode[1] .. ' ', state.mode[2] }, 65 | } 66 | end, 67 | } 68 | 69 | basic.lsp_diagnos = { 70 | width = 90, 71 | hl_colors = { 72 | red = { 'red', 'black' }, 73 | yellow = { 'yellow', 'black' }, 74 | blue = { 'blue', 'black' }, 75 | }, 76 | text = function() 77 | if lsp_comps.check_lsp() then 78 | return { 79 | { lsp_comps.lsp_error({ format = '  %s' }), 'red' }, 80 | { lsp_comps.lsp_warning({ format = '  %s' }), 'yellow' }, 81 | { lsp_comps.lsp_hint({ format = '  %s' }), 'blue' }, 82 | } 83 | end 84 | return '' 85 | end, 86 | } 87 | 88 | 89 | local icon_comp = b_components.cache_file_icon({ default = '', hl_colors = {'white','black_light'} }) 90 | 91 | basic.file = { 92 | hl_colors = { 93 | default = { 'white', 'black_light' }, 94 | }, 95 | text = function(bufnr) 96 | return { 97 | { ' ', 'default' }, 98 | icon_comp(bufnr), 99 | { ' ', 'default' }, 100 | { b_components.cache_file_name('[No Name]', ''), '' }, 101 | { b_components.file_modified(' '), '' }, 102 | -- { b_components.cache_file_size(), '' }, 103 | } 104 | end, 105 | } 106 | basic.right = { 107 | hl_colors = { 108 | sep_before = { 'black_light', 'white_light' }, 109 | sep_after = { 'white_light', 'black' }, 110 | text = { 'black', 'white_light' }, 111 | }, 112 | text = function() 113 | return { 114 | -- { b_components.line_col, 'text' }, 115 | { b_components.progress, 'text' }, 116 | { sep.right_rounded, 'sep_after' }, 117 | } 118 | end, 119 | } 120 | basic.git = { 121 | width = 90, 122 | hl_colors = { 123 | green = { 'green', 'black' }, 124 | red = { 'red', 'black' }, 125 | blue = { 'blue', 'black' }, 126 | }, 127 | text = function() 128 | if git_comps.is_git() then 129 | return { 130 | { ' ', '' }, 131 | { git_comps.diff_added({ format = '+%s' }), 'green' }, 132 | { git_comps.diff_removed({ format = '-%s' }), 'red' }, 133 | { git_comps.diff_changed({ format = '~%s' }), 'blue' }, 134 | } 135 | end 136 | return '' 137 | end, 138 | } 139 | basic.logo = { 140 | hl_colors = { 141 | sep_before = { 'blue', 'black' }, 142 | default = { 'black', 'blue' }, 143 | }, 144 | text = function() 145 | return { 146 | { sep.left_rounded, 'sep_before' }, 147 | { ' ', 'default' }, 148 | } 149 | end, 150 | } 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | -- LSP status 161 | local lsp_status = require('lsp-status') 162 | lsp_status.register_progress() 163 | local lsp_config = require('lspconfig') 164 | 165 | 166 | -- Lsp server name . 167 | function lspservername() 168 | local msg = '' 169 | local buf_ft = vim.api.nvim_buf_get_option(0, 'filetype') 170 | local clients = vim.lsp.get_active_clients() 171 | if next(clients) == nil then return msg end 172 | for _, client in ipairs(clients) do 173 | local filetypes = client.config.filetypes 174 | if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then 175 | return "LSP[" .. client.name .. "]" 176 | end 177 | end 178 | return msg 179 | end 180 | 181 | 182 | basic.lsp = { 183 | width = 90, 184 | hl_colors = { 185 | red = { 'red', 'black' }, 186 | yellow = { 'yellow', 'black' }, 187 | blue = { 'blue', 'black' }, 188 | }, 189 | text = function() 190 | return { 191 | { lsp_status.status, 'red' }, 192 | {" ", ""}, 193 | { lspservername(), 'red' }, 194 | } 195 | end, 196 | } 197 | 198 | 199 | 200 | 201 | basic.git_branch = { 202 | 203 | text = function() 204 | return { 205 | { git_comps.git_branch(), { 'green', 'black', '' }, 90 }, 206 | } 207 | end, 208 | } 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | local default = { 220 | filetypes = { 'default' }, 221 | active = { 222 | basic.vi_mode, 223 | { git_comps.git_branch(), { 'red', 'black', 'bold' }, 90 }, 224 | basic.git, 225 | basic.file, 226 | { vim_components.search_count(), { 'red', 'black_light' } }, 227 | { sep.right_rounded, { 'black_light', 'black' } }, 228 | basic.divider, 229 | basic.lsp_diagnos, 230 | basic.lsp, 231 | { ' ', hl_list.Black }, 232 | basic.right, 233 | -- { ' ', hl_list.Black }, 234 | }, 235 | in_active = { 236 | basic.file_name_inactive, 237 | basic.divider, 238 | basic.divider, 239 | basic.line_col_inactive, 240 | { '', { 'white', 'InactiveBg' } }, 241 | basic.progress_inactive, 242 | }, 243 | } 244 | 245 | local quickfix = { 246 | filetypes = { 'qf', 'Trouble' }, 247 | active = { 248 | { '🚦 Quickfix ', { 'white', 'black' } }, 249 | { helper.separators.slant_right, { 'black', 'black_light' } }, 250 | { 251 | function() 252 | return vim.fn.getqflist({ title = 0 }).title 253 | end, 254 | { 'cyan', 'black_light' }, 255 | }, 256 | { ' Total : %L ', { 'cyan', 'black_light' } }, 257 | { helper.separators.slant_right, { 'black_light', 'InactiveBg' } }, 258 | { ' ', { 'InactiveFg', 'InactiveBg' } }, 259 | basic.divider, 260 | { helper.separators.slant_right, { 'InactiveBg', 'black' } }, 261 | { '🧛 ', { 'white', 'black' } }, 262 | }, 263 | show_in_active = true, 264 | } 265 | 266 | local explorer = { 267 | filetypes = { 'fern', 'NvimTree', 'lir' }, 268 | active = { 269 | { '  ', { 'white', 'black' } }, 270 | { helper.separators.slant_right, { 'black', 'black_light' } }, 271 | { b_components.divider, '' }, 272 | { b_components.file_name(''), { 'white', 'black_light' } }, 273 | }, 274 | show_in_active = true, 275 | } 276 | windline.setup({ 277 | colors_name = function(colors) 278 | -- ADD MORE COLOR HERE ---- 279 | return colors 280 | end, 281 | statuslines = { 282 | default, 283 | quickfix, 284 | explorer, 285 | }, 286 | }) 287 | 288 | 289 | 290 | 291 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 292 | --━━━━━━━━━━━━━━━━━❰ end configs ❱━━━━━━━━━━━━━━━━━-- 293 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 294 | 295 | 296 | 297 | 298 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 299 | --━━━━━━━━━━━━━━━━━━━❰ Mappings ❱━━━━━━━━━━━━━━━━━━━-- 300 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 301 | 302 | 303 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 304 | --━━━━━━━━━━━━━━━━━❰ end Mappings ❱━━━━━━━━━━━━━━━━-- 305 | --━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━-- 306 | 307 | -------------------------------------------------------------------------------- /lua/plugins/galaxyline_nvim.lua: -------------------------------------------------------------------------------- 1 | 2 | --[[ 3 | --copied and modified from https://github.com/zootedb0t/dotfiles/blob/master/.config/nvim/lua/plugins/nvim-galaxyline.lua 4 | --]] 5 | 6 | 7 | local gl = require('galaxyline') 8 | 9 | local colors = { 10 | bg = '#292D38', 11 | yellow = '#DCDCAA', 12 | dark_yellow = '#D7BA7D', 13 | cyan = '#4EC9B0', 14 | green = '#608B4E', 15 | light_green = '#B5CEA8', 16 | string_orange = '#CE9178', 17 | orange = '#FF8800', 18 | purple = '#C586C0', 19 | magenta = '#D16D9E', 20 | grey = '#43454F', 21 | -- blue = '#569CD6', 22 | blue = '#178c94', 23 | 24 | vivid_blue = '#4FC1FF', 25 | light_blue = '#9CDCFE', 26 | red = '#D16969', 27 | error_red = '#F44747', 28 | 29 | info_yellow = '#FFCC66', 30 | fg_green = '#65a380', 31 | line_bg = '#202733', 32 | fg = '#8FBCBB', 33 | 34 | darkblue = '#83A598', 35 | } 36 | local condition = require('galaxyline.condition') 37 | local gls = gl.section 38 | gl.short_line_list = {'NvimTree', 'packer', 'undotree'} 39 | 40 | 41 | -- Lsp server name . 42 | local function lspservername() 43 | local msg = '' 44 | local buf_ft = vim.api.nvim_buf_get_option(0, 'filetype') 45 | local clients = vim.lsp.get_active_clients() 46 | if next(clients) == nil then return msg end 47 | for _, client in ipairs(clients) do 48 | local filetypes = client.config.filetypes 49 | if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then 50 | return "LSP[" .. client.name .. "]" 51 | end 52 | end 53 | return msg 54 | end 55 | 56 | local mode_color = function() 57 | local mode_colors = { 58 | n = colors.blue, 59 | i = colors.red, 60 | c = colors.orange, 61 | V = colors.magenta, 62 | [''] = colors.magenta, 63 | v = colors.magenta, 64 | R = colors.red, 65 | } 66 | 67 | local color = mode_colors[vim.fn.mode()] 68 | 69 | if color == nil then 70 | color = colors.red 71 | end 72 | 73 | return color 74 | end 75 | 76 | gls.left[1] = { 77 | ViMode = { 78 | provider = function() 79 | local alias = { 80 | n = 'NORMAL', 81 | i = 'INSERT', 82 | c = 'COMMAND', 83 | V = 'VISUAL', 84 | [''] = 'VISUAL', 85 | v = 'VISUAL', 86 | Rv = 'R&V', 87 | R = 'REPLACE', 88 | C = 'C', 89 | ['r?'] = ':CONFIRM', 90 | rm = '--MORE', 91 | s = 'S', 92 | S = 'S', 93 | ['r'] = 'HIT-ENTER', 94 | t = 'T', 95 | ['!'] = 'SH', 96 | } 97 | vim.api.nvim_command('hi GalaxyViMode gui=bold guibg='..mode_color()) 98 | local alias_mode = alias[vim.fn.mode()] 99 | if alias_mode == nil then 100 | alias_mode = vim.fn.mode() 101 | end 102 | return ' '..alias_mode..' ' 103 | end, 104 | separator = '', 105 | highlight = { colors.bg, colors.section_bg }, 106 | -- separator_highlight = {colors.bg, colors.section_bg }, 107 | separator_highlight = {colors.bg, colors.blue }, 108 | }, 109 | } 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | --------------------------------------------------------------- 130 | 131 | gls.left[2] = { 132 | FileName = { 133 | provider = function () 134 | local file_name = vim.fn.expand('%f') 135 | local file_lenght = string.len(file_name) 136 | if file_lenght > 20 then 137 | return ' ..'..string.sub(file_name, -25)..' ' 138 | end 139 | return ' '..file_name..' ' 140 | end, 141 | condition = buffer_not_empty, 142 | separator = '', 143 | separator_highlight = {colors.orange, colors.bg}, 144 | highlight = {"#55ffff", colors.grey} 145 | } 146 | } 147 | gls.left[3] = { 148 | BufferType = { 149 | provider = 'FileIcon', 150 | condition = condition.buffer_not_empty, 151 | separator = '', 152 | separator_highlight = {colors.orange, colors.bg}, 153 | highlight = {"#55aaff", colors.grey} 154 | } 155 | } 156 | 157 | gls.left[4] = { 158 | FileSize = { 159 | provider = 'FileSize', 160 | condition = condition.buffer_not_empty, 161 | highlight = {"#ffaa7f", colors.grey} 162 | } 163 | } 164 | 165 | 166 | gls.left[5] = { 167 | FileEncode = { 168 | provider = 'FileEncode', 169 | condition = condition.buffer_not_empty, 170 | highlight = {"#fff66f", colors.grey}, 171 | separator = ' ', 172 | separator_highlight = {'NONE', colors.grey}, 173 | } 174 | } 175 | 176 | 177 | 178 | 179 | -- This function gives space on the right side 180 | gls.left[6] = { 181 | Space = { 182 | provider = function() return ' ' end, 183 | separator = ' ', 184 | separator_highlight = {'NONE', colors.bg}, 185 | highlight = {colors.orange, colors.bg} 186 | } 187 | } 188 | --------------------------------------------------------------- 189 | gls.left[7] = { 190 | GitIcon = { 191 | provider = function() return '' end, 192 | condition = condition.check_git_workspace, 193 | separator = ' ', 194 | separator_highlight = {'NONE', colors.bg}, 195 | highlight = {colors.orange, colors.bg} 196 | } 197 | } 198 | 199 | gls.left[8] = { 200 | GitBranch = { 201 | provider = 'GitBranch', 202 | condition = condition.check_git_workspace, 203 | separator = ' ', 204 | separator_highlight = {'NONE', colors.bg}, 205 | highlight = {"#55aaff", colors.bg} 206 | } 207 | } 208 | gls.left[9] = { 209 | DiffAdd = { 210 | provider = 'DiffAdd', 211 | condition = condition.hide_in_width, 212 | icon = ' +', 213 | highlight = {colors.green, colors.bg} 214 | } 215 | } 216 | gls.left[10] = { 217 | DiffModified = { 218 | provider = 'DiffModified', 219 | condition = condition.hide_in_width, 220 | icon = ' ~', 221 | highlight = {colors.yellow, colors.bg} 222 | } 223 | } 224 | 225 | gls.left[11] = { 226 | DiffRemove = { 227 | provider = 'DiffRemove', 228 | condition = condition.hide_in_width, 229 | icon = ' -', 230 | highlight = {colors.red, colors.bg} 231 | } 232 | } 233 | ---------------------------------------------------- 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | local lsp_status = require('lsp-status') 242 | lsp_status.register_progress() 243 | LspStat = lsp_status.status 244 | 245 | gls.mid[1] = { 246 | LspStat = { 247 | provider = LspStat, 248 | highlight = {colors.green,colors.bg}, 249 | } 250 | } 251 | 252 | 253 | 254 | 255 | ---------------------------------------------------- 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | ---------------------------------------------------- 264 | 265 | gls.right[1] = { 266 | DiagnosticError = { 267 | provider = 'DiagnosticError', 268 | icon = ' ✗ ', 269 | highlight = {colors.error_red, colors.bg} 270 | } 271 | } 272 | gls.right[2] = { 273 | DiagnosticWarn = { 274 | provider = 'DiagnosticWarn', 275 | icon = ' ⚠ ', 276 | highlight = {colors.orange, colors.bg} 277 | } 278 | } 279 | 280 | gls.right[3] = { 281 | DiagnosticHint = { 282 | provider = 'DiagnosticHint', 283 | icon = '  ', 284 | highlight = {colors.info_yellow, colors.bg} 285 | } 286 | } 287 | 288 | gls.right[4] = { 289 | DiagnosticInfo = { 290 | provider = 'DiagnosticInfo', 291 | icon = '  ', 292 | highlight = {colors.info_yellow, colors.bg} 293 | } 294 | } 295 | 296 | 297 | 298 | 299 | 300 | 301 | gls.right[5] = { 302 | ShowLspClient = { 303 | provider = function() 304 | local msg = '' 305 | local buf_ft = vim.api.nvim_buf_get_option(0, 'filetype') 306 | local clients = vim.lsp.get_active_clients() 307 | if next(clients) == nil then return msg end 308 | for _, client in ipairs(clients) do 309 | local filetypes = client.config.filetypes 310 | if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then 311 | return "LSP[" .. client.name .. "]" 312 | end 313 | end 314 | return msg end, 315 | highlight = {colors.cyan, colors.bg}, 316 | } 317 | } 318 | 319 | 320 | --------------------------------------------------- 321 | 322 | 323 | -- for line position and numbers 324 | gls.right[6] = { 325 | LineColumn = { 326 | provider = function () 327 | local max_lines = vim.fn.line('$') 328 | local line = vim.fn.line('.') 329 | local column = vim.fn.col('.') 330 | local ld = " " 331 | if string.len(max_lines) > 3 then 332 | ld = string.format(" %5d/%2d :%6d ", line, column, max_lines) 333 | end 334 | ld =string.format(" %3d/%2d :%2d ", line, column, max_lines) 335 | return ld 336 | end, 337 | highlight = {"#000000", colors.blue}, 338 | } 339 | } 340 | 341 | 342 | 343 | --------------------------------------------------- 344 | 345 | -- for inactive/focused window 346 | gls.short_line_left[1] = { 347 | FileName = { 348 | provider = 'FileName', 349 | separator =' ', 350 | highlight = { colors.fg, colors.bg_inactive }, 351 | separator_highlight = { colors.fg, colors.bg_inactive }, 352 | } 353 | } 354 | 355 | --------------------------------------------------------------------------------