From 3865b28f6df055bd825a4d826de35e75096e7858 Mon Sep 17 00:00:00 2001 From: siduck76 Date: Tue, 6 Apr 2021 09:35:22 +0530 Subject: [PATCH 01/48] install.sh : prompt users for shell --- install.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/install.sh b/install.sh index fdce7d5..22ae84b 100755 --- a/install.sh +++ b/install.sh @@ -38,6 +38,13 @@ heading "old nvim config will be deleted so watchout :0" rm -rf ~/.config/nvim/ && mkdir -p ~/.config/nvim cp -r init.lua ~/.config/nvim && cp -r lua ~/.config/nvim +# change shell for nvim +read -p "which shell do you use?: " shellname +echo "$shellname" + +sed -i "s/bash/$shellname/g" ~/.config/nvim/lua/mappings/lua.lua +echo "shell changed to $shellname on nvim successfully!" + #for f in `find -E . -regex ".*\.vim$|.*\.lua$"`; do # p=${f#*/} # echo -e '\t' ${p} From 4d4622d2a0a2ad1b77624d7e239d68639f2a69b2 Mon Sep 17 00:00:00 2001 From: siduck76 Date: Tue, 6 Apr 2021 10:27:32 +0530 Subject: [PATCH 02/48] clean up --- init.lua | 74 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/init.lua b/init.lua index 50f7e69..e1ecc64 100644 --- a/init.lua +++ b/init.lua @@ -1,19 +1,17 @@ -- load all plugins -require("pluginsList.lua") -require("file-icons.lua") +require "pluginsList.lua" +require "file-icons.lua" -require("misc-utils.lua") -require("nvimTree.lua") -require("bufferline.lua") -require("statusline.lua") -require("telescope.lua") +require "misc-utils.lua" +require "bufferline.lua" +require "statusline.lua" -require("gitsigns.lua") -require "colorizer".setup() +require("colorizer").setup() +require("neoscroll").setup() -- smooth scroll -- lsp -require("lspconfig.lua") -require("compe.lua") +require "lspconfig.lua" +require "compe.lua" local cmd = vim.cmd local g = vim.g @@ -36,7 +34,7 @@ local indent = 2 g.indentLine_enabled = 1 g.indent_blankline_char = "▏" -cmd("hi IndentBlanklineChar guifg=#2a2e36") +cmd "hi IndentBlanklineChar guifg=#2a2e36" g.indent_blankline_filetype_exclude = {"help", "terminal"} g.indent_blankline_buftype_exclude = {"terminal"} @@ -48,30 +46,37 @@ require("treesitter.lua") require("mappings.lua") -- highlights -- -cmd("hi LineNr guifg=#383c44 guibg=NONE") -cmd("hi Comment guifg=#3d4149") - -cmd("hi SignColumn guibg=NONE") -cmd("hi VertSplit guibg=NONE guifg=#2a2e36") -cmd("hi DiffAdd guifg=#81A1C1 guibg = none") -cmd("hi DiffChange guifg =#3A3E44 guibg = none") -cmd("hi DiffModified guifg = #81A1C1 guibg = none") -cmd("hi EndOfBuffer guifg=#1e222a") +cmd "hi LineNr guifg=#383c44 guibg=NONE" +cmd "hi Comment guifg=#3d4149" +cmd "hi SignColumn guibg=NONE" +cmd "hi VertSplit guibg=NONE guifg=#2a2e36" +cmd "hi EndOfBuffer guifg=#1e222a" +cmd "hi PmenuSel guibg=#98c379" +cmd "hi Pmenu guibg=#282c34" -- telescope stuff and popupmenu -cmd("hi TelescopeBorder guifg=#2a2e36") -cmd("hi TelescopePromptBorder guifg=#2a2e36") -cmd("hi TelescopeResultsBorder guifg=#2a2e36") -cmd("hi TelescopePreviewBorder guifg=#525865") -cmd("hi PmenuSel guibg=#98c379") -cmd("hi Pmenu guibg=#282c34") +require "telescope.lua" --- tree folder name , icon color -cmd("hi NvimTreeFolderIcon guifg = #61afef") -cmd("hi NvimTreeFolderName guifg = #61afef") -cmd("hi NvimTreeIndentMarker guifg=#383c44") +cmd "hi TelescopeBorder guifg=#2a2e36" +cmd "hi TelescopePromptBorder guifg=#2a2e36" +cmd "hi TelescopeResultsBorder guifg=#2a2e36" +cmd "hi TelescopePreviewBorder guifg=#525865" -cmd("hi Normal guibg=NONE ctermbg=NONE") +-- nvim tree color for folder name and icon +require "nvimTree.lua" + +cmd "hi NvimTreeFolderIcon guifg = #61afef" +cmd "hi NvimTreeFolderName guifg = #61afef" +cmd "hi NvimTreeIndentMarker guifg=#383c44" + +cmd "hi Normal guibg=NONE ctermbg=NONE" + +-- git signs +require "gitsigns.lua" + +cmd "hi DiffAdd guifg=#81A1C1 guibg = none" +cmd "hi DiffChange guifg =#3A3E44 guibg = none" +cmd "hi DiffModified guifg = #81A1C1 guibg = none" require("nvim-autopairs").setup() require("lspkind").init( @@ -80,8 +85,6 @@ require("lspkind").init( } ) --- nvimTree bg color - -- hide line numbers in terminal windows vim.api.nvim_exec([[ au BufEnter term://* setlocal nonumber @@ -89,6 +92,3 @@ vim.api.nvim_exec([[ -- inactive statuslines as thin splitlines cmd("highlight! StatusLineNC gui=underline guibg=NONE guifg=#383c44") - --- smooth scroll -require("neoscroll").setup() From 58443f6d97599c049b3c571cd3a5b5f26a6c9304 Mon Sep 17 00:00:00 2001 From: siduck76 Date: Tue, 6 Apr 2021 10:50:23 +0530 Subject: [PATCH 03/48] minor changes to lspkind --- init.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index e1ecc64..a57f725 100644 --- a/init.lua +++ b/init.lua @@ -79,9 +79,13 @@ cmd "hi DiffChange guifg =#3A3E44 guibg = none" cmd "hi DiffModified guifg = #81A1C1 guibg = none" require("nvim-autopairs").setup() + require("lspkind").init( { - File = " " + with_text = true, + symbol_map = { + Folder = "" + } } ) From f5c59c574a3638c0ce9eb542d5fadc57b3848846 Mon Sep 17 00:00:00 2001 From: siduck76 Date: Thu, 8 Apr 2021 07:29:39 +0530 Subject: [PATCH 04/48] replace pyls with pyright --- install.sh | 44 +++++++++++++++++-------------------------- lua/lspconfig/lua.lua | 2 +- 2 files changed, 18 insertions(+), 28 deletions(-) diff --git a/install.sh b/install.sh index 8d6e76a..69a02fb 100755 --- a/install.sh +++ b/install.sh @@ -7,14 +7,12 @@ lsp_langs="" choose_langs() { read -p "Would you like to install $1 lsp?(y/n)" lang - if [ "$lang" = "y" ] - then + if [ "$lang" = "y" ]; then lsp_langs+="$1 " fi } -for lang in $default_lsp_langs -do +for lang in $default_lsp_langs; do choose_langs $lang done @@ -26,11 +24,11 @@ heading() { get_platform() { case "$(uname -s)" in - Linux*) platform=Linux;; - Darwin*) platform=Mac;; - CYGWIN*) platform=Cygwin;; - MINGW*) platform=MinGw;; - *) platform="UNKNOWN:${unameOut}" + Linux*) platform=Linux ;; + Darwin*) platform=Mac ;; + CYGWIN*) platform=Cygwin ;; + MINGW*) platform=MinGw ;; + *) platform="UNKNOWN:${unameOut}" ;; esac echo $platform } @@ -39,17 +37,17 @@ heading "installing packer" if [[ ! -e ~/.local/share/nvim/site/pack/packer/start/packer.nvim ]]; then heading "Installing packer" - git clone https://github.com/wbthomason/packer.nvim\ + git clone https://github.com/wbthomason/packer.nvim \ ~/.local/share/nvim/site/pack/packer/start/packer.nvim fi heading "Linking config" heading "old nvim config will be deleted so watchout :0" -# copying config +# copying config rm -rf ~/.config/nvim/ && mkdir -p ~/.config/nvim -cp -r init.lua ~/.config/nvim && cp -r lua ~/.config/nvim +cp -r init.lua ~/.config/nvim && cp -r lua ~/.config/nvim # change shell for nvim read -p "which shell do you use?: " shellname @@ -72,10 +70,10 @@ echo "shell changed to $shellname on nvim successfully!" #nvim --headless +TSUpdate +qa echo -fn_exists() { declare -F "$1" > /dev/null; } +fn_exists() { declare -F "$1" >/dev/null; } warn_path=false -install_node_deps () { +install_node_deps() { if [[ -z $(which npm) ]]; then echo "npm not installed" return @@ -83,14 +81,6 @@ install_node_deps () { sudo npm install -g $@ } -install_python_deps () { - if [[ -z $(which pip) && -z $(which pip3) ]]; then - echo "python/pip not installed" - return - fi - sudo python3 -m pip install $@ -} - install_ts() { install_node_deps typescript typescript-language-server prettier } @@ -114,21 +104,21 @@ install_rust() { fi } -install_python(){ - install_python_deps 'python-language-server[all]' +install_python() { + install_node_deps pyright } for lang in ${lsp_langs}; do - if fn_exists install_$lang ; then + if fn_exists install_$lang; then heading "Installing $lang language server" install_$lang else echo $lang setup not implemented - echo + echo fi done -if [[ ${warn_path} = true ]]; then +if [[ ${warn_path} == true ]]; then echo "" echo "Ensure ${LSP_BIN_PATH} is available in your \$PATH variable" fi diff --git a/lua/lspconfig/lua.lua b/lua/lspconfig/lua.lua index a5eb803..6ea9906 100644 --- a/lua/lspconfig/lua.lua +++ b/lua/lspconfig/lua.lua @@ -39,7 +39,7 @@ function on_attach(client) end end -local servers = {"tsserver", "cssls", "html" , "pyls"} +local servers = {"tsserver", "cssls", "html" , "pyright"} for _, lsp in ipairs(servers) do nvim_lsp[lsp].setup {on_attach = on_attach} end From c62616cfee4c092968df8cd0097c7d46ef468e04 Mon Sep 17 00:00:00 2001 From: siduck76 Date: Thu, 8 Apr 2021 07:32:47 +0530 Subject: [PATCH 05/48] lighter colors for lineNr,comments --- init.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index a57f725..1774b90 100644 --- a/init.lua +++ b/init.lua @@ -46,8 +46,9 @@ require("treesitter.lua") require("mappings.lua") -- highlights -- -cmd "hi LineNr guifg=#383c44 guibg=NONE" -cmd "hi Comment guifg=#3d4149" +cmd "hi LineNr guifg=#42464e guibg=NONE" +cmd "hi Comment guifg=#42464e" + cmd "hi SignColumn guibg=NONE" cmd "hi VertSplit guibg=NONE guifg=#2a2e36" cmd "hi EndOfBuffer guifg=#1e222a" From 14f5e2837403aac158fc1e7759562ee38941681b Mon Sep 17 00:00:00 2001 From: siduck76 Date: Thu, 8 Apr 2021 07:38:29 +0530 Subject: [PATCH 06/48] highlight current line number --- init.lua | 3 +++ lua/misc-utils/lua.lua | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/init.lua b/init.lua index 1774b90..f337feb 100644 --- a/init.lua +++ b/init.lua @@ -97,3 +97,6 @@ vim.api.nvim_exec([[ -- inactive statuslines as thin splitlines cmd("highlight! StatusLineNC gui=underline guibg=NONE guifg=#383c44") + +cmd "hi clear CursorLine" +cmd "hi cursorlinenr guibg=NONE guifg=#abb2bf" diff --git a/lua/misc-utils/lua.lua b/lua/misc-utils/lua.lua index 9286b5f..8ccdfd4 100644 --- a/lua/misc-utils/lua.lua +++ b/lua/misc-utils/lua.lua @@ -14,19 +14,19 @@ opt("o", "splitright", true) opt("o", "termguicolors", true) opt("w", "number", true) opt("o", "numberwidth", 2) +opt("w", "cul", true) opt("o", "mouse", "a") opt("w", "signcolumn", "yes") opt("o", "cmdheight", 1) -opt("o", "updatetime", 250) -- update interval for gitsigns +opt("o", "updatetime", 250) -- update interval for gitsigns opt("o", "clipboard", "unnamedplus") -- for indenline -opt("b", "expandtab", true ) -opt("b", "shiftwidth", 2 ) - +opt("b", "expandtab", true) +opt("b", "shiftwidth", 2) local M = {} From fe8277103710df9c3aa1da962b50858204a6df08 Mon Sep 17 00:00:00 2001 From: siduck76 Date: Thu, 8 Apr 2021 11:12:23 +0530 Subject: [PATCH 07/48] mapping for toggling line number --- README.md | 3 ++- lua/mappings/lua.lua | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5e51330..c41dbec 100644 --- a/README.md +++ b/README.md @@ -123,7 +123,7 @@ nvim-base16 doesnt even take time to load unlike base16-vim which was eating hal # Clone my setup - - Install neovim-nightly , also use a nerdfont on your terminal. -- run the install.sh (this might work only on nix systems) and open neovim , do :PackerInstall +- run the install.sh (this might work only on nix systems) and open neovim , do :PackerInstall - or do it manually : - Install packer.nvim @@ -159,6 +159,7 @@ I'd install it first and add its setup line : - Ctrl l Open terminal vertically over right - Ctrl x Open terminal horizontally below the current window - Ctrl n toggle neovim tree +- Shift n toggle line number - Ctrl a copies everything in the current file - select any text + y copies the selected text - leader + f b open all buffers , with telescope diff --git a/lua/mappings/lua.lua b/lua/mappings/lua.lua index aa3b5df..bd56831 100644 --- a/lua/mappings/lua.lua +++ b/lua/mappings/lua.lua @@ -15,3 +15,6 @@ map("n", "", [[ split term://bash | resize 10 ]], opt) -- open ter -- COPY EVERYTHING -- map("n", "", [[ %y+]], opt) + +-- toggle line number +map("n", "", [[ set nu! ]], opt) From 3ef65511c39097696612ba0f018c5c913940873c Mon Sep 17 00:00:00 2001 From: siduck76 Date: Fri, 9 Apr 2021 11:42:31 +0530 Subject: [PATCH 08/48] Update README.md --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c41dbec..c8a5dff 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,10 @@ nvim-base16 doesnt even take time to load unlike base16-vim which was eating hal ``` - The init.lua is used instead of init.vim. -- The lua folder contains modules , in the example above "foo" could be considered as a module and it contains a lua.lua file in which you could write your config in lua , its like splitting the overall config into small bit . To load/source that "foo" module , you need to specify it in init.lua like this : require('foo.lua'). + +- The lua folder contains modules ( config files ) , in the example above "foo" folder could be considered as a module and it contains a lua.lua. +- The lua.lua file is supposed to have any nvim config written in lua , its like splitting the overall config into small bits and make it more organized. +- To load or source that "foo" module (like making it load with init.lua ) , you need to load it in init.lua like this : require('foo.lua'). # Features From 3aadee1106dc70d87f6e25317f38b450baac0fec Mon Sep 17 00:00:00 2001 From: siduck76 Date: Sun, 11 Apr 2021 08:19:59 +0530 Subject: [PATCH 09/48] add telescope media extension required deps --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c8a5dff..2b426c8 100644 --- a/README.md +++ b/README.md @@ -127,7 +127,9 @@ nvim-base16 doesnt even take time to load unlike base16-vim which was eating hal - Install neovim-nightly , also use a nerdfont on your terminal. - run the install.sh (this might work only on nix systems) and open neovim , do :PackerInstall -- or do it manually : +- Install ripgrep , fd , ueberzug for telescope media extension to work. + +- Manual installation , incase the install.sh doesnt work for you : - Install packer.nvim @@ -178,7 +180,7 @@ I'd install it first and add its setup line : # TODO - add snippets support -- show statusline in inactive windows +- show better statusline in inactive windows # Contact - From b375c43dc3b30fe2d470a7bd2957adc3eee0a982 Mon Sep 17 00:00:00 2001 From: siduck76 Date: Sun, 11 Apr 2021 08:44:56 +0530 Subject: [PATCH 10/48] remove plugin highlights from init.lua --- init.lua | 22 +++------------------- lua/gitsigns/lua.lua | 6 ++++++ lua/mappings/lua.lua | 3 --- lua/nvimTree/lua.lua | 6 ++++++ lua/telescope/lua.lua | 9 +++++++++ 5 files changed, 24 insertions(+), 22 deletions(-) diff --git a/init.lua b/init.lua index f337feb..fea08aa 100644 --- a/init.lua +++ b/init.lua @@ -55,30 +55,14 @@ cmd "hi EndOfBuffer guifg=#1e222a" cmd "hi PmenuSel guibg=#98c379" cmd "hi Pmenu guibg=#282c34" --- telescope stuff and popupmenu -require "telescope.lua" - -cmd "hi TelescopeBorder guifg=#2a2e36" -cmd "hi TelescopePromptBorder guifg=#2a2e36" -cmd "hi TelescopeResultsBorder guifg=#2a2e36" -cmd "hi TelescopePreviewBorder guifg=#525865" - --- nvim tree color for folder name and icon -require "nvimTree.lua" - -cmd "hi NvimTreeFolderIcon guifg = #61afef" -cmd "hi NvimTreeFolderName guifg = #61afef" -cmd "hi NvimTreeIndentMarker guifg=#383c44" - cmd "hi Normal guibg=NONE ctermbg=NONE" +require "telescope.lua" +require "nvimTree.lua" + -- git signs require "gitsigns.lua" -cmd "hi DiffAdd guifg=#81A1C1 guibg = none" -cmd "hi DiffChange guifg =#3A3E44 guibg = none" -cmd "hi DiffModified guifg = #81A1C1 guibg = none" - require("nvim-autopairs").setup() require("lspkind").init( diff --git a/lua/gitsigns/lua.lua b/lua/gitsigns/lua.lua index 1fa4325..83bf7d7 100644 --- a/lua/gitsigns/lua.lua +++ b/lua/gitsigns/lua.lua @@ -25,3 +25,9 @@ require("gitsigns").setup { sign_priority = 5, status_formatter = nil -- Use default } + +local cmd = vim.cmd + +cmd "hi DiffAdd guifg=#81A1C1 guibg = none" +cmd "hi DiffChange guifg =#3A3E44 guibg = none" +cmd "hi DiffModified guifg = #81A1C1 guibg = none" diff --git a/lua/mappings/lua.lua b/lua/mappings/lua.lua index bd56831..aa3b5df 100644 --- a/lua/mappings/lua.lua +++ b/lua/mappings/lua.lua @@ -15,6 +15,3 @@ map("n", "", [[ split term://bash | resize 10 ]], opt) -- open ter -- COPY EVERYTHING -- map("n", "", [[ %y+]], opt) - --- toggle line number -map("n", "", [[ set nu! ]], opt) diff --git a/lua/nvimTree/lua.lua b/lua/nvimTree/lua.lua index 34e671f..30f2a39 100644 --- a/lua/nvimTree/lua.lua +++ b/lua/nvimTree/lua.lua @@ -84,3 +84,9 @@ g.nvim_tree_bindings = { ["-"] = get_lua_cb("dir_up"), ["q"] = get_lua_cb("close") } + +local cmd = vim.cmd + +cmd "hi NvimTreeFolderIcon guifg = #61afef" +cmd "hi NvimTreeFolderName guifg = #61afef" +cmd "hi NvimTreeIndentMarker guifg=#383c44" diff --git a/lua/telescope/lua.lua b/lua/telescope/lua.lua index b338935..744cb7b 100644 --- a/lua/telescope/lua.lua +++ b/lua/telescope/lua.lua @@ -73,3 +73,12 @@ vim.api.nvim_set_keymap("n", "fb", [[lua require('telescope.builtin vim.api.nvim_set_keymap("n", "fh", [[lua require('telescope.builtin').help_tags()]], opt) vim.api.nvim_set_keymap("n", "fo", [[lua require('telescope.builtin').oldfiles()]], opt) vim.api.nvim_set_keymap("n", "fm", [[ Neoformat]], opt) + +-- highlights + +local cmd = vim.cmd + +cmd "hi TelescopeBorder guifg=#2a2e36" +cmd "hi TelescopePromptBorder guifg=#2a2e36" +cmd "hi TelescopeResultsBorder guifg=#2a2e36" +cmd "hi TelescopePreviewBorder guifg=#525865" From ac6afa334b8f8d6cf7da4916188d6635cf054221 Mon Sep 17 00:00:00 2001 From: siduck76 Date: Mon, 12 Apr 2021 16:37:15 +0530 Subject: [PATCH 11/48] minor changes --- README.md | 6 +++--- install.sh | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2b426c8..39e538d 100644 --- a/README.md +++ b/README.md @@ -90,7 +90,7 @@ nvim-base16 doesnt even take time to load unlike base16-vim which was eating hal - The lua folder contains modules ( config files ) , in the example above "foo" folder could be considered as a module and it contains a lua.lua. - The lua.lua file is supposed to have any nvim config written in lua , its like splitting the overall config into small bits and make it more organized. -- To load or source that "foo" module (like making it load with init.lua ) , you need to load it in init.lua like this : require('foo.lua'). +- To load or source that "foo" module (like making it load with init.lua ) , you need to load it in init.lua like this : require('foo.lua'). # Features @@ -126,8 +126,8 @@ nvim-base16 doesnt even take time to load unlike base16-vim which was eating hal # Clone my setup - - Install neovim-nightly , also use a nerdfont on your terminal. -- run the install.sh (this might work only on nix systems) and open neovim , do :PackerInstall -- Install ripgrep , fd , ueberzug for telescope media extension to work. +- run the install.sh (this might work only on nix systems),this opens neovim (press enter or y to skip the errors , the errors will only show once). +- Install ripgrep , fd , ueberzug for telescope media extension to work. - Manual installation , incase the install.sh doesnt work for you : diff --git a/install.sh b/install.sh index 69a02fb..2249fc9 100755 --- a/install.sh +++ b/install.sh @@ -122,3 +122,7 @@ if [[ ${warn_path} == true ]]; then echo "" echo "Ensure ${LSP_BIN_PATH} is available in your \$PATH variable" fi + +# install all plugins via packer + +nvim +PackerInstall From 0cb84d3427e6c11ab714cb2cbc0297a7c9d7c16e Mon Sep 17 00:00:00 2001 From: siduck76 Date: Wed, 14 Apr 2021 07:29:42 +0530 Subject: [PATCH 12/48] Update README.md --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 39e538d..3f5bd18 100644 --- a/README.md +++ b/README.md @@ -179,8 +179,9 @@ I'd install it first and add its setup line : # TODO -- add snippets support -- show better statusline in inactive windows +- Add snippets support. +- Make the statusline more elegant. +- Add more themes. # Contact - From e45e3089d344cb5bae9b838c4322288021aea31c Mon Sep 17 00:00:00 2001 From: Aaditay <58261116+Aaditay@users.noreply.github.com> Date: Wed, 14 Apr 2021 13:23:10 +0530 Subject: [PATCH 13/48] aliases on the top Why not make an alias of cmd first and then use cmd instead of vim.cmd --- lua/nvimTree/lua.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lua/nvimTree/lua.lua b/lua/nvimTree/lua.lua index 30f2a39..851c8fa 100644 --- a/lua/nvimTree/lua.lua +++ b/lua/nvimTree/lua.lua @@ -1,8 +1,11 @@ -vim.cmd [[packadd nvim-tree.lua]] +local cmd = vim.cmd +local g = vim.g + +cmd [[packadd nvim-tree.lua]] vim.o.termguicolors = true -local g = vim.g + g.nvim_tree_side = "left" g.nvim_tree_width = 25 @@ -85,7 +88,7 @@ g.nvim_tree_bindings = { ["q"] = get_lua_cb("close") } -local cmd = vim.cmd + cmd "hi NvimTreeFolderIcon guifg = #61afef" cmd "hi NvimTreeFolderName guifg = #61afef" From ebff217665b989ee26997e2adb7bce50580942bb Mon Sep 17 00:00:00 2001 From: siduck76 Date: Sat, 17 Apr 2021 23:02:16 +0530 Subject: [PATCH 14/48] minor changes with lspconfig --- lua/lspconfig/lua.lua | 12 +++++++++--- lua/pluginsList/lua.lua | 3 --- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/lua/lspconfig/lua.lua b/lua/lspconfig/lua.lua index 6ea9906..ac7f1d2 100644 --- a/lua/lspconfig/lua.lua +++ b/lua/lspconfig/lua.lua @@ -39,7 +39,13 @@ function on_attach(client) end end -local servers = {"tsserver", "cssls", "html" , "pyright"} -for _, lsp in ipairs(servers) do - nvim_lsp[lsp].setup {on_attach = on_attach} +local lspconf = require "lspconfig" +local servers = {"html", "cssls", "tsserver", "pyright"} + +for k, lang in pairs(servers) do + lspconf[lang].setup { + root_dir = function() + return vim.loop.cwd() + end + } end diff --git a/lua/pluginsList/lua.lua b/lua/pluginsList/lua.lua index 0f4142c..55874d8 100644 --- a/lua/pluginsList/lua.lua +++ b/lua/pluginsList/lua.lua @@ -29,8 +29,5 @@ return require("packer").startup( use "nvim-telescope/telescope-media-files.nvim" use "nvim-lua/popup.nvim" use "karb94/neoscroll.nvim" - - use "nekonako/xresources-nvim" - end ) From 92591015e5a27f158e3d5b5c3efbd73073103ebb Mon Sep 17 00:00:00 2001 From: siduck76 Date: Sun, 18 Apr 2021 11:27:06 +0530 Subject: [PATCH 15/48] add sumneko_lua lspconfig --- lua/lspconfig/lua.lua | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/lua/lspconfig/lua.lua b/lua/lspconfig/lua.lua index ac7f1d2..ff2887d 100644 --- a/lua/lspconfig/lua.lua +++ b/lua/lspconfig/lua.lua @@ -49,3 +49,27 @@ for k, lang in pairs(servers) do end } end + +-- lua lsp settings +USER = "/home/" .. vim.fn.expand("$USER") + +local sumneko_root_path = USER .. "/.config/lua-language-server" +local sumneko_binary = USER .. "/.config/lua-language-server/bin/Linux/lua-language-server" + +require "lspconfig".sumneko_lua.setup { + cmd = {sumneko_binary, "-E", sumneko_root_path .. "/main.lua"}, + settings = { + Lua = { + runtime = { + version = "LuaJIT", + path = vim.split(package.path, ";") + }, + diagnostics = { + globals = {"vim"} + }, + workspace = { + library = {[vim.fn.expand("$VIMRUNTIME/lua")] = true, [vim.fn.expand("$VIMRUNTIME/lua/vim/lsp")] = true} + } + } + }, +} From 88e55565951bad7dd5ce573030803e6a86a48b65 Mon Sep 17 00:00:00 2001 From: siduck76 Date: Sun, 18 Apr 2021 11:43:10 +0530 Subject: [PATCH 16/48] disable telemetry sumneko_lua --- lua/lspconfig/lua.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lua/lspconfig/lua.lua b/lua/lspconfig/lua.lua index ff2887d..a7fc687 100644 --- a/lua/lspconfig/lua.lua +++ b/lua/lspconfig/lua.lua @@ -58,6 +58,9 @@ local sumneko_binary = USER .. "/.config/lua-language-server/bin/Linux/lua-langu require "lspconfig".sumneko_lua.setup { cmd = {sumneko_binary, "-E", sumneko_root_path .. "/main.lua"}, + root_dir = function() + return vim.loop.cwd() + end, settings = { Lua = { runtime = { @@ -69,7 +72,10 @@ require "lspconfig".sumneko_lua.setup { }, workspace = { library = {[vim.fn.expand("$VIMRUNTIME/lua")] = true, [vim.fn.expand("$VIMRUNTIME/lua/vim/lsp")] = true} + }, + telemetry = { + enable = false } } - }, + } } From 2c1af5727a0abd51fdd8a2188a239c45f92161f0 Mon Sep 17 00:00:00 2001 From: siduck76 Date: Sun, 18 Apr 2021 18:46:14 +0530 Subject: [PATCH 17/48] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 3f5bd18..e716f7b 100644 --- a/README.md +++ b/README.md @@ -126,6 +126,7 @@ nvim-base16 doesnt even take time to load unlike base16-vim which was eating hal # Clone my setup - - Install neovim-nightly , also use a nerdfont on your terminal. +- Use these [colors](https://github.com/siduck76/dotfiles/blob/master/thinkpad/.Xresources) for your terminal , Its in xresources format so it'd would be easier to use a terminal that supports xresources like st , urxvt , xterm , My [st build](https://github.com/siduck76/st). - run the install.sh (this might work only on nix systems),this opens neovim (press enter or y to skip the errors , the errors will only show once). - Install ripgrep , fd , ueberzug for telescope media extension to work. From 41e059ac2b90f4eb781d1552dd98fb1d90546371 Mon Sep 17 00:00:00 2001 From: siduck76 Date: Tue, 20 Apr 2021 09:45:14 +0530 Subject: [PATCH 18/48] add TrueZen.nvim plugin --- README.md | 2 ++ init.lua | 7 +++++-- lua/mappings/lua.lua | 6 ++++++ lua/nvimTree/lua.lua | 4 ---- lua/pluginsList/lua.lua | 31 ++++++++++++++++++++----------- lua/treesitter/lua.lua | 8 +++++--- lua/zenmode/lua.lua | 33 +++++++++++++++++++++++++++++++++ 7 files changed, 71 insertions(+), 20 deletions(-) create mode 100644 lua/zenmode/lua.lua diff --git a/README.md b/README.md index e716f7b..67ad166 100644 --- a/README.md +++ b/README.md @@ -168,6 +168,8 @@ I'd install it first and add its setup line : - Shift n toggle line number - Ctrl a copies everything in the current file - select any text + y copies the selected text +- leader + z toggle truezen.nvim's Ataraxis mode +- leader + n toggle line number - leader + f b open all buffers , with telescope - leader + f p search and preview images with telescope - leader + f f find files in the current DIR , with telescope diff --git a/init.lua b/init.lua index fea08aa..170dd09 100644 --- a/init.lua +++ b/init.lua @@ -42,8 +42,8 @@ g.indent_blankline_buftype_exclude = {"terminal"} g.indent_blankline_show_trailing_blankline_indent = false g.indent_blankline_show_first_indent_level = false -require("treesitter.lua") -require("mappings.lua") +require "treesitter.lua" +require "mappings.lua" -- highlights -- cmd "hi LineNr guifg=#42464e guibg=NONE" @@ -84,3 +84,6 @@ cmd("highlight! StatusLineNC gui=underline guibg=NONE guifg=#383c44") cmd "hi clear CursorLine" cmd "hi cursorlinenr guibg=NONE guifg=#abb2bf" + +-- setup for TrueZen.nvim +require "zenmode.lua" diff --git a/lua/mappings/lua.lua b/lua/mappings/lua.lua index aa3b5df..aef5e6e 100644 --- a/lua/mappings/lua.lua +++ b/lua/mappings/lua.lua @@ -15,3 +15,9 @@ map("n", "", [[ split term://bash | resize 10 ]], opt) -- open ter -- COPY EVERYTHING -- map("n", "", [[ %y+]], opt) + +-- toggle numbers --- +map("n", "n", [[ set nu!]], opt) + +-- toggle truezen.nvim's ataraxis mode +map("n", "z", [[ TZAtaraxis]], opt) diff --git a/lua/nvimTree/lua.lua b/lua/nvimTree/lua.lua index 851c8fa..4f2553e 100644 --- a/lua/nvimTree/lua.lua +++ b/lua/nvimTree/lua.lua @@ -5,8 +5,6 @@ cmd [[packadd nvim-tree.lua]] vim.o.termguicolors = true - - g.nvim_tree_side = "left" g.nvim_tree_width = 25 g.nvim_tree_ignore = {".git", "node_modules", ".cache"} @@ -88,8 +86,6 @@ g.nvim_tree_bindings = { ["q"] = get_lua_cb("close") } - - cmd "hi NvimTreeFolderIcon guifg = #61afef" cmd "hi NvimTreeFolderName guifg = #61afef" cmd "hi NvimTreeIndentMarker guifg=#383c44" diff --git a/lua/pluginsList/lua.lua b/lua/pluginsList/lua.lua index 55874d8..fbc106f 100644 --- a/lua/pluginsList/lua.lua +++ b/lua/pluginsList/lua.lua @@ -7,27 +7,36 @@ return require("packer").startup( use {"wbthomason/packer.nvim", opt = true} use {"lukas-reineke/indent-blankline.nvim", branch = "lua"} + -- color related stuff use "norcalli/nvim-base16.lua" - use "kyazdani42/nvim-web-devicons" - use "kyazdani42/nvim-tree.lua" + use "norcalli/nvim-colorizer.lua" + + -- lsp stuff + use "nvim-treesitter/nvim-treesitter" + use "neovim/nvim-lspconfig" + use "hrsh7th/nvim-compe" + use "onsails/lspkind-nvim" + use "sbdchd/neoformat" use "nvim-lua/plenary.nvim" + use "lewis6991/gitsigns.nvim" use "akinsho/nvim-bufferline.lua" use "glepnir/galaxyline.nvim" - use "907th/vim-auto-save" - use "nvim-treesitter/nvim-treesitter" - use "norcalli/nvim-colorizer.lua" - use "ryanoasis/vim-devicons" - use "sbdchd/neoformat" - use "neovim/nvim-lspconfig" - use "hrsh7th/nvim-compe" use "windwp/nvim-autopairs" use "alvan/vim-closetag" - use "tweekmonster/startuptime.vim" - use "onsails/lspkind-nvim" + + -- file managing , picker etc + use "kyazdani42/nvim-tree.lua" + use "kyazdani42/nvim-web-devicons" + use "ryanoasis/vim-devicons" use "nvim-telescope/telescope.nvim" use "nvim-telescope/telescope-media-files.nvim" use "nvim-lua/popup.nvim" + + -- misc + use "tweekmonster/startuptime.vim" + use "907th/vim-auto-save" + use "kdav5758/TrueZen.nvim" use "karb94/neoscroll.nvim" end ) diff --git a/lua/treesitter/lua.lua b/lua/treesitter/lua.lua index 1608a44..274668b 100644 --- a/lua/treesitter/lua.lua +++ b/lua/treesitter/lua.lua @@ -6,9 +6,11 @@ ts_config.setup { "html", "css", "bash", - "cpp", - "rust", - "lua" + "lua", + "json" + -- "cpp", + -- "rust", + -- "python" }, highlight = { enable = true, diff --git a/lua/zenmode/lua.lua b/lua/zenmode/lua.lua new file mode 100644 index 0000000..5843173 --- /dev/null +++ b/lua/zenmode/lua.lua @@ -0,0 +1,33 @@ +require("true-zen").setup( + { + true_false_commands = false, + cursor_by_mode = false, + bottom = { + hidden_laststatus = 0, + hidden_ruler = false, + hidden_showmode = false, + hidden_showcmd = false, + hidden_cmdheight = 1, + shown_laststatus = 2, + shown_ruler = true, + shown_showmode = false, + shown_showcmd = false, + shown_cmdheight = 1 + }, + top = { + hidden_showtabline = 0, + shown_showtabline = 2 + }, + left = { + hidden_number = false, + hidden_relativenumber = false, + hidden_signcolumn = "no", + shown_number = true, + shown_relativenumber = false, + shown_signcolumn = "no" + }, + ataraxis = { + left_right_padding = 40 + } + } +) From d36040544741e757e71f1f73f43b700e02c75851 Mon Sep 17 00:00:00 2001 From: siduck76 Date: Wed, 21 Apr 2021 12:46:24 +0530 Subject: [PATCH 19/48] mappings: dont copy deleted text --- init.lua | 2 +- lua/mappings/lua.lua | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 170dd09..70c2e5e 100644 --- a/init.lua +++ b/init.lua @@ -17,7 +17,7 @@ local cmd = vim.cmd local g = vim.g g.mapleader = " " -g.auto_save = 1 +g.auto_save = 0 -- colorscheme related stuff diff --git a/lua/mappings/lua.lua b/lua/mappings/lua.lua index aef5e6e..710e29a 100644 --- a/lua/mappings/lua.lua +++ b/lua/mappings/lua.lua @@ -6,6 +6,17 @@ local function map(mode, lhs, rhs, opts) vim.api.nvim_set_keymap(mode, lhs, rhs, options) end +local opt = {} + +-- dont copy any deleted text , this is disabled by default so uncomment the below mappings if you want them! +--[[ + +map("n", "dd", [=[ "_dd ]=], opt) +map("v", "dd", [=[ "_dd ]=], opt) +map("v", "x", [=[ "_x ]=], opt) + +]] + -- copy any selected text with pressing y map("", "c", '"+y') From 21fd0d6a9b02bda04a2845088059cad03b4646c9 Mon Sep 17 00:00:00 2001 From: siduck76 Date: Thu, 22 Apr 2021 08:50:17 +0530 Subject: [PATCH 20/48] minor changes --- lua/lspconfig/lua.lua | 2 -- 1 file changed, 2 deletions(-) diff --git a/lua/lspconfig/lua.lua b/lua/lspconfig/lua.lua index a7fc687..3aa1bc2 100644 --- a/lua/lspconfig/lua.lua +++ b/lua/lspconfig/lua.lua @@ -1,8 +1,6 @@ vim.cmd [[packadd nvim-lspconfig]] vim.cmd [[packadd nvim-compe]] -local nvim_lsp = require("lspconfig") - function on_attach(client) local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) From 86431978d9292632f97e485cf41a06ac61f3da93 Mon Sep 17 00:00:00 2001 From: siduck76 Date: Thu, 22 Apr 2021 18:57:36 +0530 Subject: [PATCH 21/48] TrueZen.nvim : add top & bottom padding --- lua/zenmode/lua.lua | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/lua/zenmode/lua.lua b/lua/zenmode/lua.lua index 5843173..398a001 100644 --- a/lua/zenmode/lua.lua +++ b/lua/zenmode/lua.lua @@ -1,7 +1,14 @@ -require("true-zen").setup( +local true_zen = require("true-zen") + +true_zen.setup( { true_false_commands = false, cursor_by_mode = false, + before_minimalist_mode_shown = true, + before_minimalist_mode_hidden = true, + after_minimalist_mode_shown = true, + after_minimalist_mode_hidden = true, + unknown_bkg_color_fix = true, bottom = { hidden_laststatus = 0, hidden_ruler = false, @@ -27,7 +34,14 @@ require("true-zen").setup( shown_signcolumn = "no" }, ataraxis = { - left_right_padding = 40 + just_do_it_for_me = true, + left_padding = 40, + right_padding = 40, + top_padding = 2, + bottom_padding = 2 + }, + integrations = { + integration_galaxyline = true } } ) From 5716759f40da7fe0cfa66232fb37d0ee43e8b559 Mon Sep 17 00:00:00 2001 From: siduck76 Date: Thu, 22 Apr 2021 23:13:06 +0530 Subject: [PATCH 22/48] clean lspconfig --- lua/lspconfig/lua.lua | 44 +++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/lua/lspconfig/lua.lua b/lua/lspconfig/lua.lua index 3aa1bc2..3b93643 100644 --- a/lua/lspconfig/lua.lua +++ b/lua/lspconfig/lua.lua @@ -2,9 +2,10 @@ vim.cmd [[packadd nvim-lspconfig]] vim.cmd [[packadd nvim-compe]] function on_attach(client) - local function buf_set_keymap(...) + local function map(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end + local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end @@ -12,28 +13,28 @@ function on_attach(client) buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc") -- Mappings. - local opts = {noremap = true, silent = true} - buf_set_keymap("n", "gD", "lua vim.lsp.buf.declaration()", opts) - buf_set_keymap("n", "gd", "lua vim.lsp.buf.definition()", opts) - buf_set_keymap("n", "K", "lua vim.lsp.buf.hover()", opts) - buf_set_keymap("n", "gi", "lua vim.lsp.buf.implementation()", opts) - buf_set_keymap("n", "", "lua vim.lsp.buf.signature_help()", opts) - buf_set_keymap("n", "wa", "lua vim.lsp.buf.add_workspace_folder()", opts) - buf_set_keymap("n", "wr", "lua vim.lsp.buf.remove_workspace_folder()", opts) - buf_set_keymap("n", "wl", "lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))", opts) - buf_set_keymap("n", "D", "lua vim.lsp.buf.type_definition()", opts) - buf_set_keymap("n", "rn", "lua vim.lsp.buf.rename()", opts) - buf_set_keymap("n", "gr", "lua vim.lsp.buf.references()", opts) - buf_set_keymap("n", "e", "lua vim.lsp.diagnostic.show_line_diagnostics()", opts) - buf_set_keymap("n", "[d", "lua vim.lsp.diagnostic.goto_prev()", opts) - buf_set_keymap("n", "]d", "lua vim.lsp.diagnostic.goto_next()", opts) - buf_set_keymap("n", "q", "lua vim.lsp.diagnostic.set_loclist()", opts) + local opts = {noremap = true, silent = true, normal = true} + map("gD", "lua vim.lsp.buf.declaration()", opts) + map("gd", "lua vim.lsp.buf.definition()", opts) + map("K", "lua vim.lsp.buf.hover()", opts) + map("gi", "lua vim.lsp.buf.implementation()", opts) + map("", "lua vim.lsp.buf.signature_help()", opts) + map("wa", "lua vim.lsp.buf.add_workspace_folder()", opts) + map("wr", "lua vim.lsp.buf.remove_workspace_folder()", opts) + map("wl", "lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))", opts) + map("D", "lua vim.lsp.buf.type_definition()", opts) + map("rn", "lua vim.lsp.buf.rename()", opts) + map("gr", "lua vim.lsp.buf.references()", opts) + map("e", "lua vim.lsp.diagnostic.show_line_diagnostics()", opts) + map("[d", "lua vim.lsp.diagnostic.goto_prev()", opts) + map("]d", "lua vim.lsp.diagnostic.goto_next()", opts) + map("q", "lua vim.lsp.diagnostic.set_loclist()", opts) -- Set some keybinds conditional on server capabilities if client.resolved_capabilities.document_formatting then - buf_set_keymap("n", "f", "lua vim.lsp.buf.formatting()", opts) + map("f", "lua vim.lsp.buf.formatting()", opts) elseif client.resolved_capabilities.document_range_formatting then - buf_set_keymap("n", "f", "lua vim.lsp.buf.range_formatting()", opts) + map("f", "lua vim.lsp.buf.range_formatting()", opts) end end @@ -69,7 +70,10 @@ require "lspconfig".sumneko_lua.setup { globals = {"vim"} }, workspace = { - library = {[vim.fn.expand("$VIMRUNTIME/lua")] = true, [vim.fn.expand("$VIMRUNTIME/lua/vim/lsp")] = true} + library = { + [vim.fn.expand("$VIMRUNTIME/lua")] = true, + [vim.fn.expand("$VIMRUNTIME/lua/vim/lsp")] = true + } }, telemetry = { enable = false From bbe48d229dcd4318ad79ce2830613c479c953032 Mon Sep 17 00:00:00 2001 From: siduck76 Date: Fri, 23 Apr 2021 18:14:23 +0530 Subject: [PATCH 23/48] lspconfig: clean up --- lua/lspconfig/lua.lua | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lua/lspconfig/lua.lua b/lua/lspconfig/lua.lua index 3b93643..0203a9e 100644 --- a/lua/lspconfig/lua.lua +++ b/lua/lspconfig/lua.lua @@ -43,9 +43,7 @@ local servers = {"html", "cssls", "tsserver", "pyright"} for k, lang in pairs(servers) do lspconf[lang].setup { - root_dir = function() - return vim.loop.cwd() - end + root_dir = vim.loop.cwd } end From c231dba0b6d097d478e6cc8c2e8ff0ab908d38c2 Mon Sep 17 00:00:00 2001 From: siduck76 Date: Sat, 24 Apr 2021 10:27:14 +0530 Subject: [PATCH 24/48] add mapping for minimalistc mode --- init.lua | 1 + lua/mappings/lua.lua | 4 +++- lua/zenmode/lua.lua | 8 ++++---- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/init.lua b/init.lua index 70c2e5e..7c88c6c 100644 --- a/init.lua +++ b/init.lua @@ -56,6 +56,7 @@ cmd "hi PmenuSel guibg=#98c379" cmd "hi Pmenu guibg=#282c34" cmd "hi Normal guibg=NONE ctermbg=NONE" +-- cmd "hi Normal guibg=#1e222a" require "telescope.lua" require "nvimTree.lua" diff --git a/lua/mappings/lua.lua b/lua/mappings/lua.lua index 710e29a..a4d9222 100644 --- a/lua/mappings/lua.lua +++ b/lua/mappings/lua.lua @@ -30,5 +30,7 @@ map("n", "", [[ %y+]], opt) -- toggle numbers --- map("n", "n", [[ set nu!]], opt) --- toggle truezen.nvim's ataraxis mode +-- toggle truezen.nvim's ataraxis and minimalist mode map("n", "z", [[ TZAtaraxis]], opt) +map("n", "m", [[ TZMinimalist]], opt) + diff --git a/lua/zenmode/lua.lua b/lua/zenmode/lua.lua index 398a001..8ad964b 100644 --- a/lua/zenmode/lua.lua +++ b/lua/zenmode/lua.lua @@ -8,7 +8,7 @@ true_zen.setup( before_minimalist_mode_hidden = true, after_minimalist_mode_shown = true, after_minimalist_mode_hidden = true, - unknown_bkg_color_fix = true, +-- unknown_bkg_color_fix = true, bottom = { hidden_laststatus = 0, hidden_ruler = false, @@ -34,9 +34,9 @@ true_zen.setup( shown_signcolumn = "no" }, ataraxis = { - just_do_it_for_me = true, - left_padding = 40, - right_padding = 40, + just_do_it_for_me = false, + left_padding = 37, + right_padding = 37, top_padding = 2, bottom_padding = 2 }, From 07ab4163c6f3203aaa3724689223892e13ca9c0e Mon Sep 17 00:00:00 2001 From: siduck76 Date: Sat, 24 Apr 2021 15:29:38 +0530 Subject: [PATCH 25/48] Readme: update mapping list --- README.md | 54 ++++++++++++++++++++++++++++++++---------- lua/bufferline/lua.lua | 4 ++-- 2 files changed, 44 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 67ad166..9233b32 100644 --- a/README.md +++ b/README.md @@ -158,28 +158,58 @@ I'd install it first and add its setup line : require'lspconfig'.clangd.setup{} `` -# Default Mappings to make stuffs easier! +# Default Mappings - space is the leader key + space is the **leader** key. +- Opening terminals! - Ctrl l Open terminal vertically over right - Ctrl x Open terminal horizontally below the current window + +- **File tree (nvim-tree)** + - Ctrl n toggle neovim tree -- Shift n toggle line number + +- Shift h show hidden files (use these keybinds when cursor's in the filetree, same for the keybinds below). +- Ctrl + v open files in vertical split +- Ctrl + x open files in horizontal split + +- **Toggling stuffs** + +- leader + n toggle line number +- leader + z toggle truezen.nvim's Ataraxis mode +- leader + m toggle truezen.nvim's minimalistic mode + +- **Copy text** + - Ctrl a copies everything in the current file - select any text + y copies the selected text -- leader + z toggle truezen.nvim's Ataraxis mode -- leader + n toggle line number -- leader + f b open all buffers , with telescope -- leader + f p search and preview images with telescope -- leader + f f find files in the current DIR , with telescope -- leader + f o open recently edited files , with telescope -- leader + f f find files in the current DIR , with telescope -- leader + f h opens up a manpage like thing but for all vim related things , with telescope + +- **Telescope** + +- leader + f b open all buffers +- leader + f f find files in the current DIR +- leader + f o open recently edited files +- leader + f f find files in the current DIR +- leader + f h opens up a help page like thing +- Ctrl + v open files in vertical split +- Ctrl + x open files in horizontal split + +- **Formatting code** + - leader + f m formats or beautifies the code in current window via neoformat - (currently only html ,css , js can be formatted . To be able to use this keybind you need to install the formatter locally for your language , in my case prettier was required only so I installed it. check this https://github.com/sbdchd/neoformat). + (currently only html ,css , js can be formatted . To be able to use this keybind you need to install the formatter locally for your language , in my case prettier was required only so I installed it. check (this)[https://github.com/sbdchd/neoformat]. + +- **Neoscroll** + - ``, ``, ``, ``, `` and `` : Smooth scrolling for window movement commands. +- **Managing tabs with bufferline!** + +- Shift l or s cycle through opened tabs +- Shift d close current tab +- Shift b open new tab + # TODO - Add snippets support. diff --git a/lua/bufferline/lua.lua b/lua/bufferline/lua.lua index c661f69..b94440e 100644 --- a/lua/bufferline/lua.lua +++ b/lua/bufferline/lua.lua @@ -63,10 +63,10 @@ vim.g.mapleader = " " --command that adds new buffer and moves to it vim.api.nvim_command "com -nargs=? -complete=file_in_path New badd | blast" -vim.api.nvim_set_keymap("n", "", ":New ", opt) +vim.api.nvim_set_keymap("n", "", [[tabnew]], opt) --removing a buffer -vim.api.nvim_set_keymap("n", "", [[bdelete]], opt) +vim.api.nvim_set_keymap("n", "", [[bdelete]], opt) -- tabnew and tabprev vim.api.nvim_set_keymap("n", "", [[BufferLineCycleNext]], opt) From 7dd473df13e0aad5537556c449ca173113fbb0c5 Mon Sep 17 00:00:00 2001 From: siduck76 Date: Sat, 24 Apr 2021 15:33:37 +0530 Subject: [PATCH 26/48] fix packer.nvim install link #30 --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9233b32..4664614 100644 --- a/README.md +++ b/README.md @@ -134,9 +134,11 @@ nvim-base16 doesnt even take time to load unlike base16-vim which was eating hal - Install packer.nvim -```shell +``` + git clone https://github.com/wbthomason/packer.nvim\ ~/.local/share/nvim/site/pack/packer/start/packer.nvim + ``` - copy lua folder and init.lua into ~/.config/nvim From aafea2b6f4d49c541a33119fc5299adea09fb91e Mon Sep 17 00:00:00 2001 From: mTvare <57838468+mTvare6@users.noreply.github.com> Date: Sat, 24 Apr 2021 18:21:13 +0530 Subject: [PATCH 27/48] use gnu sed in mac --- install.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 2249fc9..a0295e1 100755 --- a/install.sh +++ b/install.sh @@ -53,7 +53,12 @@ cp -r init.lua ~/.config/nvim && cp -r lua ~/.config/nvim read -p "which shell do you use?: " shellname echo "$shellname" -sed -i "s/bash/$shellname/g" ~/.config/nvim/lua/mappings/lua.lua +if [ "$(get_platform)" = "Mac" ]; then + gsed -i "s/bash/$shellname/g" ~/.config/nvim/lua/mappings/lua.lua +else + sed -i "s/bash/$shellname/g" ~/.config/nvim/lua/mappings/lua.lua +fi + echo "shell changed to $shellname on nvim successfully!" #for f in `find -E . -regex ".*\.vim$|.*\.lua$"`; do From 5c44978f4723aec8037fa04c0fbe3df43eb11dfc Mon Sep 17 00:00:00 2001 From: siduck76 Date: Sun, 25 Apr 2021 11:57:24 +0530 Subject: [PATCH 28/48] bufferline: add highlights --- lua/bufferline/lua.lua | 49 ++++++++++++++++++++++++++---------------- lua/treesitter/lua.lua | 5 +++-- 2 files changed, 33 insertions(+), 21 deletions(-) diff --git a/lua/bufferline/lua.lua b/lua/bufferline/lua.lua index b94440e..902cb1a 100644 --- a/lua/bufferline/lua.lua +++ b/lua/bufferline/lua.lua @@ -1,6 +1,10 @@ vim.o.termguicolors = true --- colors for active , inactive uffer tabs +-- colors + +local bar_fg = "#565c64" +local activeBuffer_fg = "#c8ccd4" + require "bufferline".setup { options = { buffer_close_icon = "", @@ -18,40 +22,47 @@ require "bufferline".setup { }, highlights = { background = { - guifg = comment_fg, + guifg = bar_fg, guibg = "#1e222a" }, fill = { - guifg = comment_fg, + guifg = bar_fg, guibg = "#1e222a" }, + + -- focused window buffer_selected = { - guifg = normal_fg, - guibg = "#282c34", + guifg = activeBuffer_fg, + guibg = "#353b45", gui = "bold" }, + separator_selected = { + guifg = "#353b45", + guibg = "#353b45" + }, + + -- unfocused opened window buffer_visible = { - guifg = "#3e4451", - guibg = "#1e222a" + guifg = "#9298a0", + guibg = "#282c34" }, separator_visible = { - guifg = "#1e222a", - guibg = "#1e222a" - }, - separator_selected = { - guifg = "#1e222a", - guibg = "#1e222a" + guifg = "#282c34", + guibg = "#282c34" }, + separator = { guifg = "#1e222a", guibg = "#1e222a" }, + indicator_selected = { guifg = "#1e222a", guibg = "#1e222a" }, + modified_selected = { - guifg = string_fg, + guifg = bar_fg, guibg = "#353b45" } } @@ -59,15 +70,15 @@ require "bufferline".setup { local opt = {silent = true} +local map = vim.api.nvim_set_keymap vim.g.mapleader = " " --command that adds new buffer and moves to it -vim.api.nvim_command "com -nargs=? -complete=file_in_path New badd | blast" -vim.api.nvim_set_keymap("n", "", [[tabnew]], opt) +map("n", "", [[tabnew]], opt) --removing a buffer -vim.api.nvim_set_keymap("n", "", [[bdelete]], opt) +map("n", "", [[bdelete]], opt) -- tabnew and tabprev -vim.api.nvim_set_keymap("n", "", [[BufferLineCycleNext]], opt) -vim.api.nvim_set_keymap("n", "", [[BufferLineCyclePrev]], opt) +map("n", "", [[BufferLineCycleNext]], opt) +map("n", "", [[BufferLineCyclePrev]], opt) diff --git a/lua/treesitter/lua.lua b/lua/treesitter/lua.lua index 274668b..701a27e 100644 --- a/lua/treesitter/lua.lua +++ b/lua/treesitter/lua.lua @@ -7,11 +7,12 @@ ts_config.setup { "css", "bash", "lua", - "json" + "json", + "python" -- "cpp", -- "rust", - -- "python" }, + highlight = { enable = true, use_languagetree = true From f69d8f61732943b60e5e4e95f7ab3da2a15edf13 Mon Sep 17 00:00:00 2001 From: siduck76 Date: Sun, 25 Apr 2021 20:42:24 +0530 Subject: [PATCH 29/48] git add . --- lua/bufferline/lua.lua | 7 +------ lua/treesitter/lua.lua | 1 - 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/lua/bufferline/lua.lua b/lua/bufferline/lua.lua index 902cb1a..369ddf7 100644 --- a/lua/bufferline/lua.lua +++ b/lua/bufferline/lua.lua @@ -29,7 +29,6 @@ require "bufferline".setup { guifg = bar_fg, guibg = "#1e222a" }, - -- focused window buffer_selected = { guifg = activeBuffer_fg, @@ -40,7 +39,6 @@ require "bufferline".setup { guifg = "#353b45", guibg = "#353b45" }, - -- unfocused opened window buffer_visible = { guifg = "#9298a0", @@ -50,17 +48,14 @@ require "bufferline".setup { guifg = "#282c34", guibg = "#282c34" }, - separator = { guifg = "#1e222a", guibg = "#1e222a" }, - indicator_selected = { guifg = "#1e222a", guibg = "#1e222a" }, - modified_selected = { guifg = bar_fg, guibg = "#353b45" @@ -74,7 +69,7 @@ local map = vim.api.nvim_set_keymap vim.g.mapleader = " " --command that adds new buffer and moves to it -map("n", "", [[tabnew]], opt) +map("n", "", [[tabnew]], opt) --removing a buffer map("n", "", [[bdelete]], opt) diff --git a/lua/treesitter/lua.lua b/lua/treesitter/lua.lua index 701a27e..cebde4f 100644 --- a/lua/treesitter/lua.lua +++ b/lua/treesitter/lua.lua @@ -12,7 +12,6 @@ ts_config.setup { -- "cpp", -- "rust", }, - highlight = { enable = true, use_languagetree = true From 928adbe21a739adc01aeb097c74545657e77405e Mon Sep 17 00:00:00 2001 From: siduck76 Date: Sun, 25 Apr 2021 20:42:24 +0530 Subject: [PATCH 30/48] bufferline: rm mapping overriding with defaults --- lua/bufferline/lua.lua | 7 +------ lua/treesitter/lua.lua | 1 - 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/lua/bufferline/lua.lua b/lua/bufferline/lua.lua index 902cb1a..369ddf7 100644 --- a/lua/bufferline/lua.lua +++ b/lua/bufferline/lua.lua @@ -29,7 +29,6 @@ require "bufferline".setup { guifg = bar_fg, guibg = "#1e222a" }, - -- focused window buffer_selected = { guifg = activeBuffer_fg, @@ -40,7 +39,6 @@ require "bufferline".setup { guifg = "#353b45", guibg = "#353b45" }, - -- unfocused opened window buffer_visible = { guifg = "#9298a0", @@ -50,17 +48,14 @@ require "bufferline".setup { guifg = "#282c34", guibg = "#282c34" }, - separator = { guifg = "#1e222a", guibg = "#1e222a" }, - indicator_selected = { guifg = "#1e222a", guibg = "#1e222a" }, - modified_selected = { guifg = bar_fg, guibg = "#353b45" @@ -74,7 +69,7 @@ local map = vim.api.nvim_set_keymap vim.g.mapleader = " " --command that adds new buffer and moves to it -map("n", "", [[tabnew]], opt) +map("n", "", [[tabnew]], opt) --removing a buffer map("n", "", [[bdelete]], opt) diff --git a/lua/treesitter/lua.lua b/lua/treesitter/lua.lua index 701a27e..cebde4f 100644 --- a/lua/treesitter/lua.lua +++ b/lua/treesitter/lua.lua @@ -12,7 +12,6 @@ ts_config.setup { -- "cpp", -- "rust", }, - highlight = { enable = true, use_languagetree = true From ee05f20f4350915b67ea0dd7e0a883eabfc0f5f0 Mon Sep 17 00:00:00 2001 From: siduck76 Date: Mon, 26 Apr 2021 13:44:51 +0530 Subject: [PATCH 31/48] bufferline: minor changes --- lua/bufferline/lua.lua | 10 ++++++---- lua/pluginsList/lua.lua | 3 +++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/lua/bufferline/lua.lua b/lua/bufferline/lua.lua index 369ddf7..f708fbc 100644 --- a/lua/bufferline/lua.lua +++ b/lua/bufferline/lua.lua @@ -1,5 +1,3 @@ -vim.o.termguicolors = true - -- colors local bar_fg = "#565c64" @@ -8,7 +6,7 @@ local activeBuffer_fg = "#c8ccd4" require "bufferline".setup { options = { buffer_close_icon = "", - modified_icon = "●", + modified_icon = "", close_icon = "", left_trunc_marker = "", right_trunc_marker = "", @@ -29,6 +27,7 @@ require "bufferline".setup { guifg = bar_fg, guibg = "#1e222a" }, + -- focused window buffer_selected = { guifg = activeBuffer_fg, @@ -39,6 +38,7 @@ require "bufferline".setup { guifg = "#353b45", guibg = "#353b45" }, + -- unfocused opened window buffer_visible = { guifg = "#9298a0", @@ -48,16 +48,18 @@ require "bufferline".setup { guifg = "#282c34", guibg = "#282c34" }, + separator = { guifg = "#1e222a", guibg = "#1e222a" }, + indicator_selected = { guifg = "#1e222a", guibg = "#1e222a" }, modified_selected = { - guifg = bar_fg, + guifg = "#d0f5c2", guibg = "#353b45" } } diff --git a/lua/pluginsList/lua.lua b/lua/pluginsList/lua.lua index fbc106f..ada6499 100644 --- a/lua/pluginsList/lua.lua +++ b/lua/pluginsList/lua.lua @@ -1,6 +1,9 @@ -- check if packer is installed (~/local/share/nvim/site/pack) local packer_exists = pcall(vim.cmd, [[packadd packer.nvim]]) +local packer = require("packer") +local use = packer.use + -- using { } when using a different branch of the plugin or loading the plugin with certain commands return require("packer").startup( function() From 81801c8c331e1bf55cd8ceafb3581970ec1153fe Mon Sep 17 00:00:00 2001 From: siduck76 Date: Mon, 26 Apr 2021 13:51:36 +0530 Subject: [PATCH 32/48] nvim-webdevicons: add icons for deb and rpm filetypes --- lua/file-icons/lua.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lua/file-icons/lua.lua b/lua/file-icons/lua.lua index 52acffe..29307fa 100644 --- a/lua/file-icons/lua.lua +++ b/lua/file-icons/lua.lua @@ -96,6 +96,16 @@ require "nvim-web-devicons".setup { icon = "", color = "#EBCB8B", name = "xz" + }, + deb = { + icon = "", + color = "#a3b8ef", + name = "deb" + }, + rpm = { + icon = "", + color = "#fca2aa", + name = "rpm" } } } From c09c0ebc3a10d045265e1a8c6b9db96d5740abdd Mon Sep 17 00:00:00 2001 From: siduck76 Date: Mon, 26 Apr 2021 13:56:27 +0530 Subject: [PATCH 33/48] lspconfig : add bash lsp --- install.sh | 12 +++++++++--- lua/bufferline/lua.lua | 2 -- lua/lspconfig/lua.lua | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/install.sh b/install.sh index a0295e1..5bd9fc8 100755 --- a/install.sh +++ b/install.sh @@ -2,7 +2,7 @@ BASE=$(git rev-parse --show-toplevel) LSP_BIN_PATH=$HOME/.local/bin -default_lsp_langs="css html ts rust python" +default_lsp_langs="css html ts rust python bash" lsp_langs="" choose_langs() { @@ -54,9 +54,9 @@ read -p "which shell do you use?: " shellname echo "$shellname" if [ "$(get_platform)" = "Mac" ]; then - gsed -i "s/bash/$shellname/g" ~/.config/nvim/lua/mappings/lua.lua + gsed -i "s/bash/$shellname/g" ~/.config/nvim/lua/mappings/lua.lua else - sed -i "s/bash/$shellname/g" ~/.config/nvim/lua/mappings/lua.lua + sed -i "s/bash/$shellname/g" ~/.config/nvim/lua/mappings/lua.lua fi echo "shell changed to $shellname on nvim successfully!" @@ -86,6 +86,8 @@ install_node_deps() { sudo npm install -g $@ } +# install languages + install_ts() { install_node_deps typescript typescript-language-server prettier } @@ -113,6 +115,10 @@ install_python() { install_node_deps pyright } +install_bash() { + install_node_deps bash-language-server +} + for lang in ${lsp_langs}; do if fn_exists install_$lang; then heading "Installing $lang language server" diff --git a/lua/bufferline/lua.lua b/lua/bufferline/lua.lua index f708fbc..b77fa93 100644 --- a/lua/bufferline/lua.lua +++ b/lua/bufferline/lua.lua @@ -48,12 +48,10 @@ require "bufferline".setup { guifg = "#282c34", guibg = "#282c34" }, - separator = { guifg = "#1e222a", guibg = "#1e222a" }, - indicator_selected = { guifg = "#1e222a", guibg = "#1e222a" diff --git a/lua/lspconfig/lua.lua b/lua/lspconfig/lua.lua index 0203a9e..f0d7000 100644 --- a/lua/lspconfig/lua.lua +++ b/lua/lspconfig/lua.lua @@ -39,7 +39,7 @@ function on_attach(client) end local lspconf = require "lspconfig" -local servers = {"html", "cssls", "tsserver", "pyright"} +local servers = {"html", "cssls", "tsserver", "pyright" , "bashls"} for k, lang in pairs(servers) do lspconf[lang].setup { From 38d780b50268c7da13340c2537c3d1757210f246 Mon Sep 17 00:00:00 2001 From: siduck76 Date: Tue, 27 Apr 2021 15:27:07 +0530 Subject: [PATCH 34/48] bufferline: avoid using vanilla vim mappings --- lua/bufferline/lua.lua | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lua/bufferline/lua.lua b/lua/bufferline/lua.lua index b77fa93..707a8a2 100644 --- a/lua/bufferline/lua.lua +++ b/lua/bufferline/lua.lua @@ -27,7 +27,6 @@ require "bufferline".setup { guifg = bar_fg, guibg = "#1e222a" }, - -- focused window buffer_selected = { guifg = activeBuffer_fg, @@ -38,7 +37,6 @@ require "bufferline".setup { guifg = "#353b45", guibg = "#353b45" }, - -- unfocused opened window buffer_visible = { guifg = "#9298a0", @@ -72,8 +70,8 @@ vim.g.mapleader = " " map("n", "", [[tabnew]], opt) --removing a buffer -map("n", "", [[bdelete]], opt) +map("n", "", [[bdelete]], opt) -- tabnew and tabprev map("n", "", [[BufferLineCycleNext]], opt) -map("n", "", [[BufferLineCyclePrev]], opt) +map("n", "", [[BufferLineCyclePrev]], opt) From 60e7353ee6a5b4a23437ef9c5bd977f194332d4f Mon Sep 17 00:00:00 2001 From: siduck76 Date: Tue, 27 Apr 2021 22:13:44 +0530 Subject: [PATCH 35/48] zenmode : add custombg to ataraxis --- lua/pluginsList/lua.lua | 2 +- lua/zenmode/lua.lua | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/pluginsList/lua.lua b/lua/pluginsList/lua.lua index ada6499..4e97992 100644 --- a/lua/pluginsList/lua.lua +++ b/lua/pluginsList/lua.lua @@ -39,7 +39,7 @@ return require("packer").startup( -- misc use "tweekmonster/startuptime.vim" use "907th/vim-auto-save" - use "kdav5758/TrueZen.nvim" use "karb94/neoscroll.nvim" + use "kdav5758/TrueZen.nvim" end ) diff --git a/lua/zenmode/lua.lua b/lua/zenmode/lua.lua index 8ad964b..6f985db 100644 --- a/lua/zenmode/lua.lua +++ b/lua/zenmode/lua.lua @@ -8,7 +8,6 @@ true_zen.setup( before_minimalist_mode_hidden = true, after_minimalist_mode_shown = true, after_minimalist_mode_hidden = true, --- unknown_bkg_color_fix = true, bottom = { hidden_laststatus = 0, hidden_ruler = false, @@ -38,7 +37,8 @@ true_zen.setup( left_padding = 37, right_padding = 37, top_padding = 2, - bottom_padding = 2 + bottom_padding = 2, + custome_bg = "#1e222a" }, integrations = { integration_galaxyline = true From 84d039b0c8d92f6788d805225418c2e2fbc4435b Mon Sep 17 00:00:00 2001 From: siduck76 Date: Thu, 29 Apr 2021 19:36:22 +0530 Subject: [PATCH 36/48] webdevicons : add icon for vala filetype --- lua/file-icons/lua.lua | 5 +++++ lua/pluginsList/lua.lua | 1 + 2 files changed, 6 insertions(+) diff --git a/lua/file-icons/lua.lua b/lua/file-icons/lua.lua index 29307fa..5d3e80b 100644 --- a/lua/file-icons/lua.lua +++ b/lua/file-icons/lua.lua @@ -106,6 +106,11 @@ require "nvim-web-devicons".setup { icon = "", color = "#fca2aa", name = "rpm" + }, + vala = { + icon = "", + color = "#ccaced", + name = "vala" } } } diff --git a/lua/pluginsList/lua.lua b/lua/pluginsList/lua.lua index 4e97992..233c584 100644 --- a/lua/pluginsList/lua.lua +++ b/lua/pluginsList/lua.lua @@ -41,5 +41,6 @@ return require("packer").startup( use "907th/vim-auto-save" use "karb94/neoscroll.nvim" use "kdav5758/TrueZen.nvim" + end ) From b87a354dda2aeb484c370f7439ea8dbdd29f58a6 Mon Sep 17 00:00:00 2001 From: siduck76 Date: Thu, 29 Apr 2021 20:55:03 +0530 Subject: [PATCH 37/48] Update README.md --- README.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/README.md b/README.md index 4664614..90947ee 100644 --- a/README.md +++ b/README.md @@ -59,12 +59,9 @@ Lua fork of vim devicons which lets me change icons of filetypes ### nvim-treesitter Better syntax highlighting for programming languages ( my config just has html,css,js support for now ). -without Treesitter : +without / with Treesitter : -with Treesitter : -
- ### nvim-base16 - contains a collection of all base16 themes for vim , plugin written in lua (comparison of base16-vim and nvim-base16): From 92312377df6ea85cdd9633c15029c813a0c3c63f Mon Sep 17 00:00:00 2001 From: siduck76 Date: Fri, 30 Apr 2021 12:56:26 +0530 Subject: [PATCH 38/48] remove unneeded stuff --- init.lua | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/init.lua b/init.lua index 7c88c6c..7554268 100644 --- a/init.lua +++ b/init.lua @@ -61,19 +61,10 @@ cmd "hi Normal guibg=NONE ctermbg=NONE" require "telescope.lua" require "nvimTree.lua" --- git signs +-- git signs , lsp symbols etc require "gitsigns.lua" - require("nvim-autopairs").setup() - -require("lspkind").init( - { - with_text = true, - symbol_map = { - Folder = "" - } - } -) +require("lspkind").init() -- hide line numbers in terminal windows vim.api.nvim_exec([[ From 852a7f6b1e1ec5c546d158b8a975586809f308eb Mon Sep 17 00:00:00 2001 From: siduck76 Date: Fri, 30 Apr 2021 12:58:47 +0530 Subject: [PATCH 39/48] remove unneeded packadds --- lua/compe/lua.lua | 3 --- lua/file-icons/lua.lua | 7 ------- lua/lspconfig/lua.lua | 3 --- lua/nvimTree/lua.lua | 2 -- lua/pluginsList/lua.lua | 9 +++------ 5 files changed, 3 insertions(+), 21 deletions(-) diff --git a/lua/compe/lua.lua b/lua/compe/lua.lua index d65845b..8303669 100644 --- a/lua/compe/lua.lua +++ b/lua/compe/lua.lua @@ -1,6 +1,3 @@ -vim.cmd [[packadd nvim-lspconfig]] -vim.cmd [[packadd nvim-compe]] - vim.o.completeopt = "menuone,noselect" require "compe".setup { diff --git a/lua/file-icons/lua.lua b/lua/file-icons/lua.lua index 5d3e80b..59807a9 100644 --- a/lua/file-icons/lua.lua +++ b/lua/file-icons/lua.lua @@ -1,5 +1,3 @@ -vim.cmd [[packadd nvim-web-devicons]] - require "nvim-web-devicons".setup { override = { html = { @@ -106,11 +104,6 @@ require "nvim-web-devicons".setup { icon = "", color = "#fca2aa", name = "rpm" - }, - vala = { - icon = "", - color = "#ccaced", - name = "vala" } } } diff --git a/lua/lspconfig/lua.lua b/lua/lspconfig/lua.lua index f0d7000..e0d6a1c 100644 --- a/lua/lspconfig/lua.lua +++ b/lua/lspconfig/lua.lua @@ -1,6 +1,3 @@ -vim.cmd [[packadd nvim-lspconfig]] -vim.cmd [[packadd nvim-compe]] - function on_attach(client) local function map(...) vim.api.nvim_buf_set_keymap(bufnr, ...) diff --git a/lua/nvimTree/lua.lua b/lua/nvimTree/lua.lua index 4f2553e..3090289 100644 --- a/lua/nvimTree/lua.lua +++ b/lua/nvimTree/lua.lua @@ -1,8 +1,6 @@ local cmd = vim.cmd local g = vim.g -cmd [[packadd nvim-tree.lua]] - vim.o.termguicolors = true g.nvim_tree_side = "left" diff --git a/lua/pluginsList/lua.lua b/lua/pluginsList/lua.lua index 233c584..507cdce 100644 --- a/lua/pluginsList/lua.lua +++ b/lua/pluginsList/lua.lua @@ -1,14 +1,10 @@ --- check if packer is installed (~/local/share/nvim/site/pack) -local packer_exists = pcall(vim.cmd, [[packadd packer.nvim]]) - local packer = require("packer") local use = packer.use --- using { } when using a different branch of the plugin or loading the plugin with certain commands +-- using { } for using different branch , loading plugin with certain commands etc return require("packer").startup( function() - use {"wbthomason/packer.nvim", opt = true} - use {"lukas-reineke/indent-blankline.nvim", branch = "lua"} + use "wbthomason/packer.nvim" -- color related stuff use "norcalli/nvim-base16.lua" @@ -42,5 +38,6 @@ return require("packer").startup( use "karb94/neoscroll.nvim" use "kdav5758/TrueZen.nvim" + use {"lukas-reineke/indent-blankline.nvim", branch = "lua"} end ) From 5e8e124b4e15ac75d8cc7c10aabc870abd4d1a31 Mon Sep 17 00:00:00 2001 From: siduck76 Date: Sat, 1 May 2021 12:02:40 +0530 Subject: [PATCH 40/48] install npm pkgs globally by local prefix --- install.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 5bd9fc8..a71fa3d 100755 --- a/install.sh +++ b/install.sh @@ -16,6 +16,8 @@ for lang in $default_lsp_langs; do choose_langs $lang done +npm config set prefix=~/.node_modules # for global npm pkg installation + pfx="~~~~~ " heading() { echo @@ -83,7 +85,7 @@ install_node_deps() { echo "npm not installed" return fi - sudo npm install -g $@ + npm install -g $@ } # install languages @@ -134,6 +136,8 @@ if [[ ${warn_path} == true ]]; then echo "Ensure ${LSP_BIN_PATH} is available in your \$PATH variable" fi +echo "add ~/.node_modules/bin at PATH!" + # install all plugins via packer nvim +PackerInstall From c557e8fc94a0a5670bc80e6e1cdb6010a0194d30 Mon Sep 17 00:00:00 2001 From: siduck76 Date: Sat, 1 May 2021 20:48:13 +0530 Subject: [PATCH 41/48] Update README.md --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 90947ee..c706e64 100644 --- a/README.md +++ b/README.md @@ -143,7 +143,10 @@ git clone https://github.com/wbthomason/packer.nvim\ - Install language servers and prettier ( for autocompletion etc and code formatting , nodejs should be installed too!) , this usually depends on the language support you want to add in your neovim config. ``` -sudo npm install -g vscode-html-languageserver-bin typescript typescript-language-server vscode-css-languageserver-bin prettier +npm config set prefix=~/.node_modules +npm install -g vscode-html-languageserver-bin typescript typescript-language-server vscode-css-languageserver-bin prettier + +(ADD ~/.node_modules at your PATH) ``` To setup any language server , follow this guide https://github.com/neovim/nvim-lspconfig/blob/master/CONFIG.md and search up the needed LSP. For example if I needed clangd's lsp server : From adef2de8d55aa60a93523d448722f4f1256b3051 Mon Sep 17 00:00:00 2001 From: Henri <52706578+Vanderscycle@users.noreply.github.com> Date: Mon, 3 May 2021 12:28:54 -0700 Subject: [PATCH 42/48] Update README.md Corrected a small repetition. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index c706e64..593c8ca 100644 --- a/README.md +++ b/README.md @@ -192,7 +192,6 @@ I'd install it first and add its setup line : - leader + f b open all buffers - leader + f f find files in the current DIR - leader + f o open recently edited files -- leader + f f find files in the current DIR - leader + f h opens up a help page like thing - Ctrl + v open files in vertical split - Ctrl + x open files in horizontal split From 615c391d5d9a798b2801164216f565b469659bfc Mon Sep 17 00:00:00 2001 From: Henri <52706578+Vanderscycle@users.noreply.github.com> Date: Mon, 3 May 2021 14:57:54 -0700 Subject: [PATCH 43/48] Update lua.lua Added snippet support for a later merge should the author decides that this type of snippet support fits his needs. --- lua/pluginsList/lua.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lua/pluginsList/lua.lua b/lua/pluginsList/lua.lua index 507cdce..09b2536 100644 --- a/lua/pluginsList/lua.lua +++ b/lua/pluginsList/lua.lua @@ -23,6 +23,10 @@ return require("packer").startup( use "glepnir/galaxyline.nvim" use "windwp/nvim-autopairs" use "alvan/vim-closetag" + + -- snippet support + use "hrsh7th/vim-vsnip" + use "rafamadriz/friendly-snippets" -- file managing , picker etc use "kyazdani42/nvim-tree.lua" From 4d3138e75b147dddd22718e77673ce1b97d9a97c Mon Sep 17 00:00:00 2001 From: siduck76 Date: Tue, 4 May 2021 09:36:09 +0530 Subject: [PATCH 44/48] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 593c8ca..1136a9a 100644 --- a/README.md +++ b/README.md @@ -213,7 +213,6 @@ I'd install it first and add its setup line : # TODO -- Add snippets support. - Make the statusline more elegant. - Add more themes. From 2430a4e1b228386485a5bbc8bc9fb4d1ca7d3688 Mon Sep 17 00:00:00 2001 From: Henri Vandersleyen Date: Tue, 4 May 2021 10:34:12 -0700 Subject: [PATCH 45/48] Small change to the readme.md mentioning vsnip and what are snips are avail already. Changed one line in compe/lua.lua to indicate vsnip better. --- README.md | 5 ++++- lua/compe/lua.lua | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1136a9a..7b77f90 100644 --- a/README.md +++ b/README.md @@ -109,7 +109,8 @@ nvim-base16 doesnt even take time to load unlike base16-vim which was eating hal - packer.nvim as package manager - indent-blankline.Nvim for indentlines - smooth scrolling - +- Snip support from VSCode through vsnip supporting custom and predefined snips (friendly-snippets) + # Guides to migrate your nvim configs to init.lua - - https://github.com/nanotee/nvim-lua-guide @@ -120,6 +121,8 @@ nvim-base16 doesnt even take time to load unlike base16-vim which was eating hal - https://icyphox.sh/blog/nvim-lua/ +- https://github.com/rafamadriz/friendly-snippets/wiki + # Clone my setup - - Install neovim-nightly , also use a nerdfont on your terminal. diff --git a/lua/compe/lua.lua b/lua/compe/lua.lua index 8303669..1e0ec99 100644 --- a/lua/compe/lua.lua +++ b/lua/compe/lua.lua @@ -17,7 +17,7 @@ require "compe".setup { path = true, buffer = true, calc = true, - vsnip = true, + vsnip = {kind = "﬌"}, --replace to what sign you prefer nvim_lsp = true, nvim_lua = true, spell = true, From 0f3ed9f54c24a10b49ade2baac942e4653f44099 Mon Sep 17 00:00:00 2001 From: Henri Vandersleyen Date: Tue, 4 May 2021 13:28:08 -0700 Subject: [PATCH 46/48] changed the default lsp letters to symbols. --- lua/lspconfig/lua.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lua/lspconfig/lua.lua b/lua/lspconfig/lua.lua index e0d6a1c..0c1b86e 100644 --- a/lua/lspconfig/lua.lua +++ b/lua/lspconfig/lua.lua @@ -76,3 +76,9 @@ require "lspconfig".sumneko_lua.setup { } } } + +-- replace the default lsp diagnostic letters with prettier symbols +vim.fn.sign_define("LspDiagnosticsSignError", {text = "", numhl = "LspDiagnosticsDefaultError"}) +vim.fn.sign_define("LspDiagnosticsSignWarning", {text = "", numhl = "LspDiagnosticsDefaultWarning"}) +vim.fn.sign_define("LspDiagnosticsSignInformation", {text = "", numhl = "LspDiagnosticsDefaultInformation"}) +vim.fn.sign_define("LspDiagnosticsSignHint", {text = "", numhl = "LspDiagnosticsDefaultHint"}) From 503dc5b1c8a511ebbfaecee96381af7bc70de7cf Mon Sep 17 00:00:00 2001 From: siduck76 Date: Wed, 5 May 2021 06:51:04 +0530 Subject: [PATCH 47/48] better config structure --- README.md | 16 +++++------- init.lua | 26 +++++++++---------- lua/{compe/lua.lua => compe-completion.lua} | 0 lua/{file-icons/lua.lua => file-icons.lua} | 0 lua/{gitsigns/lua.lua => gitsigns-nvim.lua} | 0 lua/{mappings/lua.lua => mappings.lua} | 0 lua/{misc-utils/lua.lua => misc-utils.lua} | 0 lua/{lspconfig/lua.lua => nvim-lspconfig.lua} | 0 lua/{nvimTree/lua.lua => nvimTree.lua} | 0 lua/{pluginsList/lua.lua => pluginList.lua} | 0 lua/{statusline/lua.lua => statusline.lua} | 0 lua/{telescope/lua.lua => telescope-nvim.lua} | 0 .../lua.lua => top-bufferline.lua} | 0 .../lua.lua => treesitter-nvim.lua} | 0 lua/{zenmode/lua.lua => zenmode.lua} | 0 15 files changed, 20 insertions(+), 22 deletions(-) rename lua/{compe/lua.lua => compe-completion.lua} (100%) rename lua/{file-icons/lua.lua => file-icons.lua} (100%) rename lua/{gitsigns/lua.lua => gitsigns-nvim.lua} (100%) rename lua/{mappings/lua.lua => mappings.lua} (100%) rename lua/{misc-utils/lua.lua => misc-utils.lua} (100%) rename lua/{lspconfig/lua.lua => nvim-lspconfig.lua} (100%) rename lua/{nvimTree/lua.lua => nvimTree.lua} (100%) rename lua/{pluginsList/lua.lua => pluginList.lua} (100%) rename lua/{statusline/lua.lua => statusline.lua} (100%) rename lua/{telescope/lua.lua => telescope-nvim.lua} (100%) rename lua/{bufferline/lua.lua => top-bufferline.lua} (100%) rename lua/{treesitter/lua.lua => treesitter-nvim.lua} (100%) rename lua/{zenmode/lua.lua => zenmode.lua} (100%) diff --git a/README.md b/README.md index 7b77f90..8cc96b0 100644 --- a/README.md +++ b/README.md @@ -79,15 +79,13 @@ nvim-base16 doesnt even take time to load unlike base16-vim which was eating hal nvim ├──init.lua └──lua - └──foo - └──lua.lua + └──anything.lua ``` - The init.lua is used instead of init.vim. - -- The lua folder contains modules ( config files ) , in the example above "foo" folder could be considered as a module and it contains a lua.lua. -- The lua.lua file is supposed to have any nvim config written in lua , its like splitting the overall config into small bits and make it more organized. -- To load or source that "foo" module (like making it load with init.lua ) , you need to load it in init.lua like this : require('foo.lua'). +- The lua folder contains modules ( config files ) , in the example above anything.lua file in lua folder could be considered as a module. +- The anything.lua file is supposed to have any neovim config written in lua , its like splitting the overall config into small bits and make it more organized , like one module for highlights and colors , another one for statusline and so on!. +- To load or source that "anything" module (like making it load with init.lua ) ,add this is in init.lua : require "anything". # Features @@ -110,7 +108,7 @@ nvim-base16 doesnt even take time to load unlike base16-vim which was eating hal - indent-blankline.Nvim for indentlines - smooth scrolling - Snip support from VSCode through vsnip supporting custom and predefined snips (friendly-snippets) - + # Guides to migrate your nvim configs to init.lua - - https://github.com/nanotee/nvim-lua-guide @@ -138,7 +136,7 @@ nvim-base16 doesnt even take time to load unlike base16-vim which was eating hal git clone https://github.com/wbthomason/packer.nvim\ ~/.local/share/nvim/site/pack/packer/start/packer.nvim - + ``` - copy lua folder and init.lua into ~/.config/nvim @@ -146,7 +144,7 @@ git clone https://github.com/wbthomason/packer.nvim\ - Install language servers and prettier ( for autocompletion etc and code formatting , nodejs should be installed too!) , this usually depends on the language support you want to add in your neovim config. ``` -npm config set prefix=~/.node_modules +npm config set prefix=~/.node_modules npm install -g vscode-html-languageserver-bin typescript typescript-language-server vscode-css-languageserver-bin prettier (ADD ~/.node_modules at your PATH) diff --git a/init.lua b/init.lua index 7554268..82b9bda 100644 --- a/init.lua +++ b/init.lua @@ -1,17 +1,17 @@ -- load all plugins -require "pluginsList.lua" -require "file-icons.lua" +require "pluginList" +require "file-icons" -require "misc-utils.lua" -require "bufferline.lua" -require "statusline.lua" +require "misc-utils" +require "top-bufferline" +require "statusline" require("colorizer").setup() require("neoscroll").setup() -- smooth scroll -- lsp -require "lspconfig.lua" -require "compe.lua" +require "nvim-lspconfig" +require "compe-completion" local cmd = vim.cmd local g = vim.g @@ -42,8 +42,8 @@ g.indent_blankline_buftype_exclude = {"terminal"} g.indent_blankline_show_trailing_blankline_indent = false g.indent_blankline_show_first_indent_level = false -require "treesitter.lua" -require "mappings.lua" +require "treesitter-nvim" +require "mappings" -- highlights -- cmd "hi LineNr guifg=#42464e guibg=NONE" @@ -58,11 +58,11 @@ cmd "hi Pmenu guibg=#282c34" cmd "hi Normal guibg=NONE ctermbg=NONE" -- cmd "hi Normal guibg=#1e222a" -require "telescope.lua" -require "nvimTree.lua" +require "telescope-nvim" +require "nvimTree" -- git signs , lsp symbols etc -require "gitsigns.lua" +require "gitsigns-nvim" require("nvim-autopairs").setup() require("lspkind").init() @@ -78,4 +78,4 @@ cmd "hi clear CursorLine" cmd "hi cursorlinenr guibg=NONE guifg=#abb2bf" -- setup for TrueZen.nvim -require "zenmode.lua" +require "zenmode" diff --git a/lua/compe/lua.lua b/lua/compe-completion.lua similarity index 100% rename from lua/compe/lua.lua rename to lua/compe-completion.lua diff --git a/lua/file-icons/lua.lua b/lua/file-icons.lua similarity index 100% rename from lua/file-icons/lua.lua rename to lua/file-icons.lua diff --git a/lua/gitsigns/lua.lua b/lua/gitsigns-nvim.lua similarity index 100% rename from lua/gitsigns/lua.lua rename to lua/gitsigns-nvim.lua diff --git a/lua/mappings/lua.lua b/lua/mappings.lua similarity index 100% rename from lua/mappings/lua.lua rename to lua/mappings.lua diff --git a/lua/misc-utils/lua.lua b/lua/misc-utils.lua similarity index 100% rename from lua/misc-utils/lua.lua rename to lua/misc-utils.lua diff --git a/lua/lspconfig/lua.lua b/lua/nvim-lspconfig.lua similarity index 100% rename from lua/lspconfig/lua.lua rename to lua/nvim-lspconfig.lua diff --git a/lua/nvimTree/lua.lua b/lua/nvimTree.lua similarity index 100% rename from lua/nvimTree/lua.lua rename to lua/nvimTree.lua diff --git a/lua/pluginsList/lua.lua b/lua/pluginList.lua similarity index 100% rename from lua/pluginsList/lua.lua rename to lua/pluginList.lua diff --git a/lua/statusline/lua.lua b/lua/statusline.lua similarity index 100% rename from lua/statusline/lua.lua rename to lua/statusline.lua diff --git a/lua/telescope/lua.lua b/lua/telescope-nvim.lua similarity index 100% rename from lua/telescope/lua.lua rename to lua/telescope-nvim.lua diff --git a/lua/bufferline/lua.lua b/lua/top-bufferline.lua similarity index 100% rename from lua/bufferline/lua.lua rename to lua/top-bufferline.lua diff --git a/lua/treesitter/lua.lua b/lua/treesitter-nvim.lua similarity index 100% rename from lua/treesitter/lua.lua rename to lua/treesitter-nvim.lua diff --git a/lua/zenmode/lua.lua b/lua/zenmode.lua similarity index 100% rename from lua/zenmode/lua.lua rename to lua/zenmode.lua From 49c1f84e6e1cf0b026d1e0b2b910a40c19b56b76 Mon Sep 17 00:00:00 2001 From: siduck76 Date: Wed, 5 May 2021 07:20:42 +0530 Subject: [PATCH 48/48] better LspDiagnostics icons and colors --- lua/compe-completion.lua | 2 +- lua/nvim-lspconfig.lua | 26 +++++++++++++++++++++----- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/lua/compe-completion.lua b/lua/compe-completion.lua index 1e0ec99..0fa3ecd 100644 --- a/lua/compe-completion.lua +++ b/lua/compe-completion.lua @@ -15,7 +15,7 @@ require "compe".setup { documentation = true, source = { path = true, - buffer = true, + buffer = {kind = "﬘" , true}, calc = true, vsnip = {kind = "﬌"}, --replace to what sign you prefer nvim_lsp = true, diff --git a/lua/nvim-lspconfig.lua b/lua/nvim-lspconfig.lua index 0c1b86e..d8e2f59 100644 --- a/lua/nvim-lspconfig.lua +++ b/lua/nvim-lspconfig.lua @@ -36,7 +36,7 @@ function on_attach(client) end local lspconf = require "lspconfig" -local servers = {"html", "cssls", "tsserver", "pyright" , "bashls"} +local servers = {"html", "cssls", "tsserver", "pyright", "bashls"} for k, lang in pairs(servers) do lspconf[lang].setup { @@ -78,7 +78,23 @@ require "lspconfig".sumneko_lua.setup { } -- replace the default lsp diagnostic letters with prettier symbols -vim.fn.sign_define("LspDiagnosticsSignError", {text = "", numhl = "LspDiagnosticsDefaultError"}) -vim.fn.sign_define("LspDiagnosticsSignWarning", {text = "", numhl = "LspDiagnosticsDefaultWarning"}) -vim.fn.sign_define("LspDiagnosticsSignInformation", {text = "", numhl = "LspDiagnosticsDefaultInformation"}) -vim.fn.sign_define("LspDiagnosticsSignHint", {text = "", numhl = "LspDiagnosticsDefaultHint"}) +vim.fn.sign_define("LspDiagnosticsSignError", {text = "", numhl = "LspDiagnosticsDefaultError"}) +vim.fn.sign_define("LspDiagnosticsSignWarning", {text = "", numhl = "LspDiagnosticsDefaultWarning"}) +vim.fn.sign_define("LspDiagnosticsSignInformation", {text = "", numhl = "LspDiagnosticsDefaultInformation"}) +vim.fn.sign_define("LspDiagnosticsSignHint", {text = "", numhl = "LspDiagnosticsDefaultHint"}) + +-- diagnostics highlights + +local cmd = vim.cmd + +cmd "hi LspDiagnosticsSignError guifg=#f9929b" +cmd "hi LspDiagnosticsVirtualTextError guifg=#BF616A" + +cmd "hi LspDiagnosticsSignWarning guifg=#EBCB8B" +cmd "hi LspDiagnosticsVirtualTextWarning guifg=#EBCB8B" + +cmd "hi LspDiagnosticsSignInformation guifg=#A3BE8C" +cmd "hi LspDiagnosticsVirtualTextInformation guifg=#A3BE8C" + +cmd "hi LspDiagnosticsSignHint guifg=#b6bdca" +cmd "hi LspDiagnosticsVirtualTextHint guifg=#b6bdca"