From 138b0cbac3d8798c0201bc7ca72d0192d493c5da Mon Sep 17 00:00:00 2001 From: Alexander Serowy Date: Thu, 1 Apr 2021 13:40:38 +0200 Subject: [PATCH 01/20] added pip3 to validation --- install.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 938da78..658e10d 100755 --- a/install.sh +++ b/install.sh @@ -64,7 +64,11 @@ install_node_deps () { } install_python_deps () { - if [[ -z $(which pip) ]]; then + if [[ -z $(which pip) && $(which pip3) ]]; then + echo "python/pip not installed" + return + fi + sudo python3 -m pip install $@ ]]; then echo "python/pip not installed" return fi From 8996ff7f598d154483f3a6d61e8c41f83ae1ff07 Mon Sep 17 00:00:00 2001 From: Alexander Serowy Date: Thu, 1 Apr 2021 13:54:10 +0200 Subject: [PATCH 02/20] fixed paste bug --- install.sh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/install.sh b/install.sh index 658e10d..e3928ee 100755 --- a/install.sh +++ b/install.sh @@ -60,7 +60,7 @@ install_node_deps () { echo "npm not installed" return fi - sudo npm install -g $@ + sudo npm install -g $@ } install_python_deps () { @@ -68,11 +68,7 @@ install_python_deps () { echo "python/pip not installed" return fi - sudo python3 -m pip install $@ ]]; then - echo "python/pip not installed" - return - fi - sudo python3 -m pip install $@ + sudo python3 -m pip install $@ } install_ts() { From 43b1289a82c51d1d4c3e187fd128d445b4d610b3 Mon Sep 17 00:00:00 2001 From: Alexander Serowy Date: Thu, 1 Apr 2021 13:57:15 +0200 Subject: [PATCH 03/20] fixed --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index e3928ee..aaa0e0b 100755 --- a/install.sh +++ b/install.sh @@ -64,7 +64,7 @@ install_node_deps () { } install_python_deps () { - if [[ -z $(which pip) && $(which pip3) ]]; then + if [[ -z $(which pip) && -z $(which pip3) ]]; then echo "python/pip not installed" return fi From 3a917ee68360e70c7dcacc7922e6d3e426dbb5bd Mon Sep 17 00:00:00 2001 From: Alexander Serowy Date: Thu, 1 Apr 2021 14:00:32 +0200 Subject: [PATCH 04/20] made mkdir more robust --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index aaa0e0b..fdce7d5 100755 --- a/install.sh +++ b/install.sh @@ -35,7 +35,7 @@ heading "old nvim config will be deleted so watchout :0" # copying config -rm -rf ~/.config/nvim/ && mkdir ~/.config/nvim +rm -rf ~/.config/nvim/ && mkdir -p ~/.config/nvim cp -r init.lua ~/.config/nvim && cp -r lua ~/.config/nvim #for f in `find -E . -regex ".*\.vim$|.*\.lua$"`; do From 446c8f899c9395d6c9a1e6aac55d92aef7d7509f Mon Sep 17 00:00:00 2001 From: siduck76 Date: Fri, 2 Apr 2021 00:23:12 +0530 Subject: [PATCH 05/20] clean up --- lua/bufferline/lua.lua | 2 ++ lua/mappings/lua.lua | 13 +++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/lua/bufferline/lua.lua b/lua/bufferline/lua.lua index 2f6d37d..81d65f4 100644 --- a/lua/bufferline/lua.lua +++ b/lua/bufferline/lua.lua @@ -60,8 +60,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) + --removing a buffer vim.api.nvim_set_keymap("n","",[[bdelete]], opt) + -- tabnew and tabprev vim.api.nvim_set_keymap("n", "", [[BufferLineCycleNext]], opt) vim.api.nvim_set_keymap("n", "", [[BufferLineCyclePrev]], opt) diff --git a/lua/mappings/lua.lua b/lua/mappings/lua.lua index da92370..dc4df5a 100644 --- a/lua/mappings/lua.lua +++ b/lua/mappings/lua.lua @@ -6,9 +6,14 @@ local function map(mode, lhs, rhs, opts) vim.api.nvim_set_keymap(mode, lhs, rhs, options) end --- keybind list +-- copy any selected text with pressing y map("", "c", '"+y') --- open terminals -map("n", "" , [[ vnew term://bash]] , opt) -- split term vertically , over the right -map("n", "" , [[ split term://bash | resize 10 ]] , opt) -- split term vertically , over the right + +-- OPEN TERMINALS -- + +-- split term vertically , over the right +map("n", "", [[vnew term://bash ]], opt) + +-- split term vertically , over the right +map("n", "", [[ split term://bash | resize 10 ]], opt) From 49b63d38bc710ff522c24f32ad1571a4bd33f81c Mon Sep 17 00:00:00 2001 From: siduck76 Date: Fri, 2 Apr 2021 00:24:26 +0530 Subject: [PATCH 06/20] typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 78aac09..f7f8433 100644 --- a/README.md +++ b/README.md @@ -130,7 +130,7 @@ I'd install it first and add its setup line : space is the leader key -- Ctrl b Open terminal vertically over right +- Ctrl l Open terminal vertically over right - Ctrl x Open terminal horizontally below the current window - Ctrl n toggle neovim tree - Ctrl a copies everything in the current file From aff50c8c15fb589904cd2a6acab7b8bd3d45810a Mon Sep 17 00:00:00 2001 From: siduck76 Date: Fri, 2 Apr 2021 11:06:20 +0530 Subject: [PATCH 07/20] add better comments and clean up --- lua/mappings/lua.lua | 12 +++---- lua/nvim-compe/lua.lua | 1 + lua/nvim-lspconfig/lua.lua | 71 ++++++++++++++++++++------------------ lua/nvimTree/lua.lua | 34 +++++++++--------- lua/pluginsList/lua.lua | 1 + lua/statusline/lua.lua | 7 ++-- lua/telescope-nvim/lua.lua | 5 ++- 7 files changed, 68 insertions(+), 63 deletions(-) diff --git a/lua/mappings/lua.lua b/lua/mappings/lua.lua index dc4df5a..aa3b5df 100644 --- a/lua/mappings/lua.lua +++ b/lua/mappings/lua.lua @@ -9,11 +9,9 @@ end -- copy any selected text with pressing y map("", "c", '"+y') +-- OPEN TERMINALS -- +map("n", "", [[vnew term://bash ]], opt) -- open term over right +map("n", "", [[ split term://bash | resize 10 ]], opt) -- open term bottom --- OPEN TERMINALS -- - --- split term vertically , over the right -map("n", "", [[vnew term://bash ]], opt) - --- split term vertically , over the right -map("n", "", [[ split term://bash | resize 10 ]], opt) +-- COPY EVERYTHING -- +map("n", "", [[ %y+]], opt) diff --git a/lua/nvim-compe/lua.lua b/lua/nvim-compe/lua.lua index df6b263..0eb539c 100644 --- a/lua/nvim-compe/lua.lua +++ b/lua/nvim-compe/lua.lua @@ -43,6 +43,7 @@ local check_back_space = function() end end +-- tab completion _G.tab_complete = function() if vim.fn.pumvisible() == 1 then diff --git a/lua/nvim-lspconfig/lua.lua b/lua/nvim-lspconfig/lua.lua index b77f9e8..304d7fd 100644 --- a/lua/nvim-lspconfig/lua.lua +++ b/lua/nvim-lspconfig/lua.lua @@ -1,42 +1,45 @@ vim.cmd [[packadd nvim-lspconfig]] vim.cmd [[packadd nvim-compe]] -local nvim_lsp = require('lspconfig') + +local nvim_lsp = require("lspconfig") + function on_attach(client) + local function buf_set_keymap(...) + vim.api.nvim_buf_set_keymap(bufnr, ...) + end + local function buf_set_option(...) + vim.api.nvim_buf_set_option(bufnr, ...) + end + buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc") - local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end - local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end + -- 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) - buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc') + -- 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) + elseif client.resolved_capabilities.document_range_formatting then + buf_set_keymap("n", "f", "lua vim.lsp.buf.range_formatting()", opts) + end +end - -- 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) - - -- 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) - elseif client.resolved_capabilities.document_range_formatting then - buf_set_keymap("n", "f", "lua vim.lsp.buf.range_formatting()", opts) - end - -end - -local servers = { "tsserver", "cssls", "pyls", "html" } +local servers = {"tsserver", "cssls", "pyls", "html"} for _, lsp in ipairs(servers) do - nvim_lsp[lsp].setup { on_attach = on_attach } -end \ No newline at end of file + nvim_lsp[lsp].setup {on_attach = on_attach} +end diff --git a/lua/nvimTree/lua.lua b/lua/nvimTree/lua.lua index 4ec583e..34e671f 100644 --- a/lua/nvimTree/lua.lua +++ b/lua/nvimTree/lua.lua @@ -2,27 +2,29 @@ vim.cmd [[packadd nvim-tree.lua]] vim.o.termguicolors = true -vim.g.nvim_tree_side = "left" -vim.g.nvim_tree_width = 25 -vim.g.nvim_tree_ignore = {".git", "node_modules", ".cache"} -vim.g.nvim_tree_auto_open = 0 -vim.g.nvim_tree_auto_close = 0 -vim.g.nvim_tree_quit_on_open = 0 -vim.g.nvim_tree_follow = 1 -vim.g.nvim_tree_indent_markers = 1 -vim.g.nvim_tree_hide_dotfiles = 1 -vim.g.nvim_tree_git_hl = 1 -vim.g.nvim_tree_root_folder_modifier = ":~" -vim.g.nvim_tree_tab_open = 1 -vim.g.nvim_tree_allow_resize = 1 +local g = vim.g -vim.g.nvim_tree_show_icons = { +g.nvim_tree_side = "left" +g.nvim_tree_width = 25 +g.nvim_tree_ignore = {".git", "node_modules", ".cache"} +g.nvim_tree_auto_open = 0 +g.nvim_tree_auto_close = 0 +g.nvim_tree_quit_on_open = 0 +g.nvim_tree_follow = 1 +g.nvim_tree_indent_markers = 1 +g.nvim_tree_hide_dotfiles = 1 +g.nvim_tree_git_hl = 1 +g.nvim_tree_root_folder_modifier = ":~" +g.nvim_tree_tab_open = 1 +g.nvim_tree_allow_resize = 1 + +g.nvim_tree_show_icons = { git = 1, folders = 1, files = 1 } -vim.g.nvim_tree_icons = { +g.nvim_tree_icons = { default = " ", symlink = " ", git = { @@ -55,7 +57,7 @@ vim.api.nvim_set_keymap( } ) -vim.g.nvim_tree_bindings = { +g.nvim_tree_bindings = { [""] = get_lua_cb("edit"), ["o"] = get_lua_cb("edit"), ["<2-LeftMouse>"] = get_lua_cb("edit"), diff --git a/lua/pluginsList/lua.lua b/lua/pluginsList/lua.lua index a4f894d..e400346 100644 --- a/lua/pluginsList/lua.lua +++ b/lua/pluginsList/lua.lua @@ -1,6 +1,7 @@ -- check if packer is installed (~/local/share/nvim/site/pack) local packer_exists = pcall(vim.cmd, [[packadd packer.nvim]]) +-- add { } , when the plugin needs a different branch, loading the plugin with certain commands return require("packer").startup( function() use {"wbthomason/packer.nvim", opt = true} diff --git a/lua/statusline/lua.lua b/lua/statusline/lua.lua index 63a5267..9096a9e 100644 --- a/lua/statusline/lua.lua +++ b/lua/statusline/lua.lua @@ -1,6 +1,7 @@ local gl = require("galaxyline") local gls = gl.section -gl.short_line_list = {" "} + +gl.short_line_list = {" "} -- keeping this table { } as empty will show inactive statuslines local colors = { bg = "#282c34", @@ -31,7 +32,7 @@ gls.left[1] = { } gls.left[2] = { - ViMode = { + statusIcon = { provider = function() return "  " end, @@ -168,7 +169,7 @@ gls.right[3] = { } gls.right[4] = { - SiMode = { + ViMode = { provider = function() local alias = { n = "NORMAL", diff --git a/lua/telescope-nvim/lua.lua b/lua/telescope-nvim/lua.lua index 460298f..b338935 100644 --- a/lua/telescope-nvim/lua.lua +++ b/lua/telescope-nvim/lua.lua @@ -60,7 +60,7 @@ local opt = {noremap = true, silent = true} vim.g.mapleader = " " --- mappings +-- mappings vim.api.nvim_set_keymap("n", "ff", [[lua require('telescope.builtin').find_files()]], opt) vim.api.nvim_set_keymap( "n", @@ -68,9 +68,8 @@ vim.api.nvim_set_keymap( [[lua require('telescope').extensions.media_files.media_files()]], opt ) + vim.api.nvim_set_keymap("n", "fb", [[lua require('telescope.builtin').buffers()]], opt) 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) - -vim.api.nvim_set_keymap("n", "", [[ %y+]], opt) From cb64b0ef44c97f3370357af79404675feb3e7f4d Mon Sep 17 00:00:00 2001 From: siduck76 Date: Fri, 2 Apr 2021 11:18:34 +0530 Subject: [PATCH 08/20] avoid using default plugin names for plugin configs --- init.lua | 10 +++++----- lua/{nvim-compe => compe}/lua.lua | 0 lua/{web-devicons => file-icons}/lua.lua | 0 lua/{nvim-lspconfig => lspconfig}/lua.lua | 0 lua/{utils => misc-utils}/lua.lua | 0 lua/pluginsList/lua.lua | 2 +- lua/{telescope-nvim => telescope}/lua.lua | 0 7 files changed, 6 insertions(+), 6 deletions(-) rename lua/{nvim-compe => compe}/lua.lua (100%) rename lua/{web-devicons => file-icons}/lua.lua (100%) rename lua/{nvim-lspconfig => lspconfig}/lua.lua (100%) rename lua/{utils => misc-utils}/lua.lua (100%) rename lua/{telescope-nvim => telescope}/lua.lua (100%) diff --git a/init.lua b/init.lua index 790183a..8035737 100644 --- a/init.lua +++ b/init.lua @@ -1,19 +1,19 @@ -- load all plugins require("pluginsList.lua") -require("web-devicons.lua") +require("file-icons.lua") -require("utils.lua") +require("misc-utils.lua") require("nvimTree.lua") require("bufferline.lua") require("statusline.lua") -require("telescope-nvim.lua") +require("telescope.lua") require("gitsigns.lua") require "colorizer".setup() -- lsp -require("nvim-lspconfig.lua") -require("nvim-compe.lua") +require("lspconfig.lua") +require("compe.lua") local cmd = vim.cmd local g = vim.g diff --git a/lua/nvim-compe/lua.lua b/lua/compe/lua.lua similarity index 100% rename from lua/nvim-compe/lua.lua rename to lua/compe/lua.lua diff --git a/lua/web-devicons/lua.lua b/lua/file-icons/lua.lua similarity index 100% rename from lua/web-devicons/lua.lua rename to lua/file-icons/lua.lua diff --git a/lua/nvim-lspconfig/lua.lua b/lua/lspconfig/lua.lua similarity index 100% rename from lua/nvim-lspconfig/lua.lua rename to lua/lspconfig/lua.lua diff --git a/lua/utils/lua.lua b/lua/misc-utils/lua.lua similarity index 100% rename from lua/utils/lua.lua rename to lua/misc-utils/lua.lua diff --git a/lua/pluginsList/lua.lua b/lua/pluginsList/lua.lua index e400346..1758e23 100644 --- a/lua/pluginsList/lua.lua +++ b/lua/pluginsList/lua.lua @@ -1,7 +1,7 @@ -- check if packer is installed (~/local/share/nvim/site/pack) local packer_exists = pcall(vim.cmd, [[packadd packer.nvim]]) --- add { } , when the plugin needs a different branch, loading the plugin with certain commands +-- using { } when using a different branch of the plugin or loading the plugin with certain commands return require("packer").startup( function() use {"wbthomason/packer.nvim", opt = true} diff --git a/lua/telescope-nvim/lua.lua b/lua/telescope/lua.lua similarity index 100% rename from lua/telescope-nvim/lua.lua rename to lua/telescope/lua.lua From 7adcc2a55d6bf4a3f1c1ccfee3f81330873d5efa Mon Sep 17 00:00:00 2001 From: siduck76 Date: Fri, 2 Apr 2021 12:18:44 +0530 Subject: [PATCH 09/20] config structure --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index f7f8433..40c161d 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,19 @@ without Treesitter : with Treesitter :
+#Config structure + +``` + nvim + ├──init.lua + └──lua + └──foo + └──lua.lua +``` + +- 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'). + # Features - File navigation with Nvimtree From 32763ab304d1159a1b47432ea20784178ea189db Mon Sep 17 00:00:00 2001 From: siduck76 Date: Fri, 2 Apr 2021 12:34:46 +0530 Subject: [PATCH 10/20] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 40c161d..3ad362b 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ without Treesitter : with Treesitter :
-#Config structure +# Config structure ``` nvim From f7e027085b20d601890083b9556bb16ceb3142b1 Mon Sep 17 00:00:00 2001 From: siduck76 Date: Fri, 2 Apr 2021 13:05:54 +0530 Subject: [PATCH 11/20] use nvim-base16 instead of base16-vim cuz its fast --- README.md | 2 +- init.lua | 6 ++++-- lua/pluginsList/lua.lua | 3 +-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 40c161d..3ad362b 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ without Treesitter : with Treesitter :
-#Config structure +# Config structure ``` nvim diff --git a/init.lua b/init.lua index 8035737..c74b2f4 100644 --- a/init.lua +++ b/init.lua @@ -21,12 +21,14 @@ local g = vim.g g.mapleader = " " g.auto_save = 1 --- colorscheme +-- colorscheme related stuff -cmd "colorscheme base16-onedark" cmd "syntax enable" cmd "syntax on" +local base16 = require "base16" +base16(base16.themes["onedark"], true) + -- blankline local indent = 2 diff --git a/lua/pluginsList/lua.lua b/lua/pluginsList/lua.lua index 1758e23..d26fad6 100644 --- a/lua/pluginsList/lua.lua +++ b/lua/pluginsList/lua.lua @@ -7,15 +7,14 @@ return require("packer").startup( use {"wbthomason/packer.nvim", opt = true} use {"lukas-reineke/indent-blankline.nvim", branch = "lua"} + use "norcalli/nvim-base16.lua" use "kyazdani42/nvim-web-devicons" use "kyazdani42/nvim-tree.lua" use "nvim-lua/plenary.nvim" use "lewis6991/gitsigns.nvim" - use "glepnir/galaxyline.nvim" use "akinsho/nvim-bufferline.lua" use "907th/vim-auto-save" use "nvim-treesitter/nvim-treesitter" - use "chriskempson/base16-vim" use "norcalli/nvim-colorizer.lua" use "ryanoasis/vim-devicons" use "sbdchd/neoformat" From 4647a847e3f52808be4ec357daf5930ff010c62d Mon Sep 17 00:00:00 2001 From: siduck76 Date: Fri, 2 Apr 2021 13:23:32 +0530 Subject: [PATCH 12/20] Update lua.lua --- lua/pluginsList/lua.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lua/pluginsList/lua.lua b/lua/pluginsList/lua.lua index d26fad6..2bb7659 100644 --- a/lua/pluginsList/lua.lua +++ b/lua/pluginsList/lua.lua @@ -13,6 +13,7 @@ return require("packer").startup( 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" @@ -28,5 +29,6 @@ return require("packer").startup( use "nvim-telescope/telescope-media-files.nvim" use "nvim-lua/popup.nvim" use "karb94/neoscroll.nvim" + end ) From 7c07bb8c8c17d146d80f3185ab46be13209d7d15 Mon Sep 17 00:00:00 2001 From: siduck76 Date: Sat, 3 Apr 2021 23:36:25 +0530 Subject: [PATCH 13/20] rm plugin folder since it gets automatically created whenever updating plugins --- README.md | 27 ++++--- plugin/packer_compiled.vim | 141 ------------------------------------- 2 files changed, 16 insertions(+), 152 deletions(-) delete mode 100644 plugin/packer_compiled.vim diff --git a/README.md b/README.md index 3ad362b..cd8caf3 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,17 @@ without 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): + +nvim-base16 doesnt even take time to load unlike base16-vim which was eating half of the loadup time! ( the below screenshot was taken and tested on my old pentium laptop , so results might differ) +
+ +(neovim loads pretty fast on ssds) + +
+ # Config structure ``` @@ -112,7 +123,8 @@ with Treesitter : # Clone my setup - - Install neovim-nightly , also use a nerdfont on your terminal. -- run the install.sh script as root or copy the configs manually : +- run the install.sh (this might work only on nix systems) or do it manually : + - Install packer.nvim ```shell @@ -120,9 +132,9 @@ git clone https://github.com/wbthomason/packer.nvim\ ~/.local/share/nvim/site/pack/packer/start/packer.nvim ``` -- copy all config files in from this repo except ( plugin folder as it has config related to my system's username! ) -- Open neovim and install all plugins , :PackerInstall and :TSUpdate -- Install language servers and prettier ( for autocompletion etc and code formatting , nodejs should be installed too!) +- copy lua folder and init.lua into ~/.config/nvim +- Open neovim and install all plugins , :PackerInstall (let treesitter install all its extensionsm +- 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 @@ -163,13 +175,6 @@ I'd install it first and add its setup line : - add snippets support - show statusline in inactive windows -# Troubleshooting - - -![image](https://user-images.githubusercontent.com/59060246/111059898-f096cf00-84be-11eb-977a-f91d622ee5b9.png) - -if you get any errors with packer.nvim , then remove the ~/.config/nvim/plugin/packer_nvim.vim file since it just has file paths for my system -and re-install packer.nvim - # Contact - - My linux / unix related ricing community: https://t.me/DE_WM (telegram) diff --git a/plugin/packer_compiled.vim b/plugin/packer_compiled.vim deleted file mode 100644 index 3831e12..0000000 --- a/plugin/packer_compiled.vim +++ /dev/null @@ -1,141 +0,0 @@ -" Automatically generated packer.nvim plugin loader code - -if !has('nvim-0.5') - echohl WarningMsg - echom "Invalid Neovim version for packer.nvim!" - echohl None - finish -endif - -packadd packer.nvim - -try - -lua << END -local package_path_str = "/home/sid/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?.lua;/home/sid/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?/init.lua;/home/sid/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?.lua;/home/sid/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?/init.lua" -local install_cpath_pattern = "/home/sid/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/?.so" -if not string.find(package.path, package_path_str, 1, true) then - package.path = package.path .. ';' .. package_path_str -end - -if not string.find(package.cpath, install_cpath_pattern, 1, true) then - package.cpath = package.cpath .. ';' .. install_cpath_pattern -end - -local function try_loadstring(s, component, name) - local success, result = pcall(loadstring(s)) - if not success then - print('Error running ' .. component .. ' for ' .. name) - error(result) - end - return result -end - -_G.packer_plugins = { - ["base16-vim"] = { - loaded = true, - path = "/home/sid/.local/share/nvim/site/pack/packer/start/base16-vim" - }, - ["galaxyline.nvim"] = { - loaded = true, - path = "/home/sid/.local/share/nvim/site/pack/packer/start/galaxyline.nvim" - }, - ["gitsigns.nvim"] = { - loaded = true, - path = "/home/sid/.local/share/nvim/site/pack/packer/start/gitsigns.nvim" - }, - ["indent-blankline.nvim"] = { - loaded = true, - path = "/home/sid/.local/share/nvim/site/pack/packer/start/indent-blankline.nvim" - }, - indentLine = { - loaded = true, - path = "/home/sid/.local/share/nvim/site/pack/packer/start/indentLine" - }, - ["lspkind-nvim"] = { - loaded = true, - path = "/home/sid/.local/share/nvim/site/pack/packer/start/lspkind-nvim" - }, - neoformat = { - loaded = true, - path = "/home/sid/.local/share/nvim/site/pack/packer/start/neoformat" - }, - ["nvim-autopairs"] = { - loaded = true, - path = "/home/sid/.local/share/nvim/site/pack/packer/start/nvim-autopairs" - }, - ["nvim-bufferline.lua"] = { - loaded = true, - path = "/home/sid/.local/share/nvim/site/pack/packer/start/nvim-bufferline.lua" - }, - ["nvim-colorizer.lua"] = { - loaded = true, - path = "/home/sid/.local/share/nvim/site/pack/packer/start/nvim-colorizer.lua" - }, - ["nvim-compe"] = { - loaded = true, - path = "/home/sid/.local/share/nvim/site/pack/packer/start/nvim-compe" - }, - ["nvim-lspconfig"] = { - loaded = true, - path = "/home/sid/.local/share/nvim/site/pack/packer/start/nvim-lspconfig" - }, - ["nvim-tree.lua"] = { - loaded = true, - path = "/home/sid/.local/share/nvim/site/pack/packer/start/nvim-tree.lua" - }, - ["nvim-treesitter"] = { - loaded = true, - path = "/home/sid/.local/share/nvim/site/pack/packer/start/nvim-treesitter" - }, - ["nvim-web-devicons"] = { - loaded = true, - path = "/home/sid/.local/share/nvim/site/pack/packer/start/nvim-web-devicons" - }, - ["packer.nvim"] = { - loaded = false, - needs_bufread = false, - path = "/home/sid/.local/share/nvim/site/pack/packer/opt/packer.nvim" - }, - ["plenary.nvim"] = { - loaded = true, - path = "/home/sid/.local/share/nvim/site/pack/packer/start/plenary.nvim" - }, - ["popup.nvim"] = { - loaded = true, - path = "/home/sid/.local/share/nvim/site/pack/packer/start/popup.nvim" - }, - ["startuptime.vim"] = { - loaded = true, - path = "/home/sid/.local/share/nvim/site/pack/packer/start/startuptime.vim" - }, - ["telescope-media-files.nvim"] = { - loaded = true, - path = "/home/sid/.local/share/nvim/site/pack/packer/start/telescope-media-files.nvim" - }, - ["telescope.nvim"] = { - loaded = true, - path = "/home/sid/.local/share/nvim/site/pack/packer/start/telescope.nvim" - }, - ["vim-auto-save"] = { - loaded = true, - path = "/home/sid/.local/share/nvim/site/pack/packer/start/vim-auto-save" - }, - ["vim-closetag"] = { - loaded = true, - path = "/home/sid/.local/share/nvim/site/pack/packer/start/vim-closetag" - }, - ["vim-devicons"] = { - loaded = true, - path = "/home/sid/.local/share/nvim/site/pack/packer/start/vim-devicons" - } -} - -END - -catch - echohl ErrorMsg - echom "Error in packer_compiled: " .. v:exception - echom "Please check your config for correctness" - echohl None -endtry From aecb9e6a6c8cb6f02c4769c4f16e13529c08442b Mon Sep 17 00:00:00 2001 From: siduck76 Date: Sun, 4 Apr 2021 06:50:22 +0530 Subject: [PATCH 14/20] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index cd8caf3..5e51330 100644 --- a/README.md +++ b/README.md @@ -123,7 +123,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) or do it manually : +- run the install.sh (this might work only on nix systems) and open neovim , do :PackerInstall +- or do it manually : - Install packer.nvim From 0cca21ffeabb0b2660e5585d8fe2a2c6b8ee7624 Mon Sep 17 00:00:00 2001 From: siduck76 Date: Sun, 4 Apr 2021 11:35:37 +0530 Subject: [PATCH 15/20] hide line numbers for terminal --- init.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/init.lua b/init.lua index c74b2f4..d1d37c7 100644 --- a/init.lua +++ b/init.lua @@ -86,3 +86,7 @@ augroup NvimTree ]], false ) + +vim.api.nvim_exec([[ + au BufEnter term://* setlocal nonumber +]], false) From 425eb4cbb58408393a41f4591e384f62391bb74f Mon Sep 17 00:00:00 2001 From: siduck76 Date: Sun, 4 Apr 2021 14:56:15 +0530 Subject: [PATCH 16/20] make ugly fat inactive StatusLineNC look good --- init.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/init.lua b/init.lua index d1d37c7..610659a 100644 --- a/init.lua +++ b/init.lua @@ -87,6 +87,10 @@ augroup NvimTree false ) +-- remove line n.os from terminal vim.api.nvim_exec([[ au BufEnter term://* setlocal nonumber ]], false) + +-- make inactive statuslines look thin +cmd("highlight! StatusLineNC gui=underline guibg=NONE guifg=#3e4451") From a57b352db8a9e89ac4839c624f4dec101119afaf Mon Sep 17 00:00:00 2001 From: siduck76 Date: Sun, 4 Apr 2021 17:17:11 +0530 Subject: [PATCH 17/20] remove blankline from terminal --- init.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/init.lua b/init.lua index 610659a..667acca 100644 --- a/init.lua +++ b/init.lua @@ -39,21 +39,24 @@ g.indent_blankline_char = "▏" cmd("hi IndentBlanklineChar guifg=#373b43") g.indent_blankline_filetype_exclude = {"help", "terminal"} +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") --- highlights +-- highlights -- cmd("hi LineNr guibg=NONE") cmd("hi SignColumn guibg=NONE") -cmd("hi VertSplit guibg=NONE") +cmd("hi VertSplit guibg=NONE guifg=#3e4451") 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=#282c34") +-- telescope stuff and popupmenu cmd("hi TelescopeBorder guifg=#3e4451") cmd("hi TelescopePromptBorder guifg=#3e4451") cmd("hi TelescopeResultsBorder guifg=#3e4451") @@ -87,10 +90,8 @@ augroup NvimTree false ) --- remove line n.os from terminal vim.api.nvim_exec([[ au BufEnter term://* setlocal nonumber ]], false) --- make inactive statuslines look thin cmd("highlight! StatusLineNC gui=underline guibg=NONE guifg=#3e4451") From afff99e54561689f4dbaa60f7cce81cf9698dd22 Mon Sep 17 00:00:00 2001 From: siduck76 Date: Sun, 4 Apr 2021 17:29:05 +0530 Subject: [PATCH 18/20] better comments --- init.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/init.lua b/init.lua index 667acca..627187f 100644 --- a/init.lua +++ b/init.lua @@ -90,8 +90,10 @@ augroup NvimTree false ) +-- hide line numbers in terminal windows vim.api.nvim_exec([[ au BufEnter term://* setlocal nonumber ]], false) +-- inactive statuslines as thin splitlines cmd("highlight! StatusLineNC gui=underline guibg=NONE guifg=#3e4451") From e948f32cd5b26d8c179eb18be9a1c47ea26b4e55 Mon Sep 17 00:00:00 2001 From: siduck76 Date: Tue, 6 Apr 2021 08:29:37 +0530 Subject: [PATCH 19/20] customization: darker colors --- init.lua | 37 ++++++++++++++++--------------------- lua/bufferline/lua.lua | 34 +++++++++++++++++++--------------- lua/compe/lua.lua | 20 ++++++++++---------- lua/lspconfig/lua.lua | 2 +- lua/pluginsList/lua.lua | 2 ++ lua/statusline/lua.lua | 6 +++--- 6 files changed, 51 insertions(+), 50 deletions(-) diff --git a/init.lua b/init.lua index 627187f..50f7e69 100644 --- a/init.lua +++ b/init.lua @@ -36,7 +36,7 @@ local indent = 2 g.indentLine_enabled = 1 g.indent_blankline_char = "▏" -cmd("hi IndentBlanklineChar guifg=#373b43") +cmd("hi IndentBlanklineChar guifg=#2a2e36") g.indent_blankline_filetype_exclude = {"help", "terminal"} g.indent_blankline_buftype_exclude = {"terminal"} @@ -48,25 +48,28 @@ require("treesitter.lua") require("mappings.lua") -- highlights -- -cmd("hi LineNr guibg=NONE") +cmd("hi LineNr guifg=#383c44 guibg=NONE") +cmd("hi Comment guifg=#3d4149") + cmd("hi SignColumn guibg=NONE") -cmd("hi VertSplit guibg=NONE guifg=#3e4451") +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=#282c34") +cmd("hi EndOfBuffer guifg=#1e222a") -- telescope stuff and popupmenu -cmd("hi TelescopeBorder guifg=#3e4451") -cmd("hi TelescopePromptBorder guifg=#3e4451") -cmd("hi TelescopeResultsBorder guifg=#3e4451") +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 PmenuSel guibg=#98c379") +cmd("hi Pmenu guibg=#282c34") -- tree folder name , icon color cmd("hi NvimTreeFolderIcon guifg = #61afef") cmd("hi NvimTreeFolderName guifg = #61afef") -cmd("hi NvimTreeIndentMarker guifg=#545862") +cmd("hi NvimTreeIndentMarker guifg=#383c44") cmd("hi Normal guibg=NONE ctermbg=NONE") @@ -78,17 +81,6 @@ require("lspkind").init( ) -- nvimTree bg color -cmd("hi CustomExplorerBg guibg=#242830") - -vim.api.nvim_exec( - [[ -augroup NvimTree - au! - au FileType NvimTree setlocal winhighlight=Normal:CustomExplorerBg - augroup END - ]], - false -) -- hide line numbers in terminal windows vim.api.nvim_exec([[ @@ -96,4 +88,7 @@ vim.api.nvim_exec([[ ]], false) -- inactive statuslines as thin splitlines -cmd("highlight! StatusLineNC gui=underline guibg=NONE guifg=#3e4451") +cmd("highlight! StatusLineNC gui=underline guibg=NONE guifg=#383c44") + +-- smooth scroll +require("neoscroll").setup() diff --git a/lua/bufferline/lua.lua b/lua/bufferline/lua.lua index 81d65f4..c661f69 100644 --- a/lua/bufferline/lua.lua +++ b/lua/bufferline/lua.lua @@ -1,6 +1,6 @@ vim.o.termguicolors = true --- colors for active , inactive buffer tabs +-- colors for active , inactive uffer tabs require "bufferline".setup { options = { buffer_close_icon = "", @@ -19,36 +19,40 @@ require "bufferline".setup { highlights = { background = { guifg = comment_fg, - guibg = "#282c34" + guibg = "#1e222a" }, fill = { guifg = comment_fg, - guibg = "#282c34" + guibg = "#1e222a" }, buffer_selected = { guifg = normal_fg, - guibg = "#3A3E44", + guibg = "#282c34", gui = "bold" }, + buffer_visible = { + guifg = "#3e4451", + guibg = "#1e222a" + }, separator_visible = { - guifg = "#282c34", - guibg = "#282c34" + guifg = "#1e222a", + guibg = "#1e222a" }, separator_selected = { - guifg = "#282c34", - guibg = "#282c34" + guifg = "#1e222a", + guibg = "#1e222a" }, separator = { - guifg = "#282c34", - guibg = "#282c34" + guifg = "#1e222a", + guibg = "#1e222a" }, indicator_selected = { - guifg = "#282c34", - guibg = "#282c34" + guifg = "#1e222a", + guibg = "#1e222a" }, modified_selected = { guifg = string_fg, - guibg = "#3A3E44" + guibg = "#353b45" } } } @@ -59,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", "", ":New ", 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) diff --git a/lua/compe/lua.lua b/lua/compe/lua.lua index 0eb539c..d65845b 100644 --- a/lua/compe/lua.lua +++ b/lua/compe/lua.lua @@ -35,24 +35,24 @@ local t = function(str) end local check_back_space = function() - local col = vim.fn.col('.') - 1 - if col == 0 or vim.fn.getline('.'):sub(col, col):match('%s') then + local col = vim.fn.col(".") - 1 + if col == 0 or vim.fn.getline("."):sub(col, col):match("%s") then return true else return false end end --- tab completion +-- tab completion _G.tab_complete = function() - if vim.fn.pumvisible() == 1 then - return t "" - elseif check_back_space() then - return t "" - else - return vim.fn['compe#complete']() - end + if vim.fn.pumvisible() == 1 then + return t "" + elseif check_back_space() then + return t "" + else + return vim.fn["compe#complete"]() + end end _G.s_tab_complete = function() if vim.fn.pumvisible() == 1 then diff --git a/lua/lspconfig/lua.lua b/lua/lspconfig/lua.lua index 304d7fd..24b84a7 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", "pyls", "html"} +local servers = {"tsserver", "cssls", "html"} for _, lsp in ipairs(servers) do nvim_lsp[lsp].setup {on_attach = on_attach} end diff --git a/lua/pluginsList/lua.lua b/lua/pluginsList/lua.lua index 2bb7659..0f4142c 100644 --- a/lua/pluginsList/lua.lua +++ b/lua/pluginsList/lua.lua @@ -29,6 +29,8 @@ 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 ) diff --git a/lua/statusline/lua.lua b/lua/statusline/lua.lua index 9096a9e..ad3d9df 100644 --- a/lua/statusline/lua.lua +++ b/lua/statusline/lua.lua @@ -4,8 +4,8 @@ local gls = gl.section gl.short_line_list = {" "} -- keeping this table { } as empty will show inactive statuslines local colors = { - bg = "#282c34", - line_bg = "#282c34", + bg = "#1e222a", + line_bg = "#1e222a", fg = "#D8DEE9", fg_green = "#65a380", yellow = "#A3BE8C", @@ -17,7 +17,7 @@ local colors = { magenta = "#c678dd", blue = "#22262C", red = "#DF8890", - lightbg = "#3C4048", + lightbg = "#282c34", nord = "#81A1C1", greenYel = "#EBCB8B" } From e9d27bda68d74b8c32d70092b9e151a7ab04562d Mon Sep 17 00:00:00 2001 From: siduck76 Date: Tue, 6 Apr 2021 08:30:07 +0530 Subject: [PATCH 20/20] pyls support --- lua/lspconfig/lua.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lspconfig/lua.lua b/lua/lspconfig/lua.lua index 24b84a7..a5eb803 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"} +local servers = {"tsserver", "cssls", "html" , "pyls"} for _, lsp in ipairs(servers) do nvim_lsp[lsp].setup {on_attach = on_attach} end