From 652f703767cc6ddd8ce5d898395247fc9a0858e6 Mon Sep 17 00:00:00 2001 From: Galen Rowell Date: Thu, 22 Jul 2021 17:45:47 +1000 Subject: [PATCH 01/21] Fix term crash bug, no auto-close finished term anymore --- lua/utils.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/lua/utils.lua b/lua/utils.lua index f829114..9765f54 100644 --- a/lua/utils.lua +++ b/lua/utils.lua @@ -2,7 +2,6 @@ vim.api.nvim_exec( [[ au TermOpen term://* setlocal nonumber laststatus=0 - au TermClose term://* bd! au BufEnter,BufWinEnter,WinEnter,CmdwinEnter * if bufname('%') == "NvimTree" | set laststatus=0 | else | set laststatus=2 | endif ]], false From 0d69a528a8e2585f4feb6b61f23d393dc5d76300 Mon Sep 17 00:00:00 2001 From: Galen Rowell Date: Thu, 22 Jul 2021 18:04:21 +1000 Subject: [PATCH 02/21] Fix statusline issue --- lua/utils.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/utils.lua b/lua/utils.lua index 9765f54..f55bd59 100644 --- a/lua/utils.lua +++ b/lua/utils.lua @@ -1,7 +1,7 @@ -- hide line numbers , statusline in specific buffers! vim.api.nvim_exec( [[ - au TermOpen term://* setlocal nonumber laststatus=0 + au TermOpen term://* setlocal nonumber au BufEnter,BufWinEnter,WinEnter,CmdwinEnter * if bufname('%') == "NvimTree" | set laststatus=0 | else | set laststatus=2 | endif ]], false From f8727f16599093c646b735ad9815788ec3f379b8 Mon Sep 17 00:00:00 2001 From: siduck76 Date: Fri, 23 Jul 2021 18:03:04 +0530 Subject: [PATCH 03/21] Update utils.lua --- lua/utils.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/utils.lua b/lua/utils.lua index f55bd59..271928b 100644 --- a/lua/utils.lua +++ b/lua/utils.lua @@ -1,7 +1,7 @@ -- hide line numbers , statusline in specific buffers! vim.api.nvim_exec( [[ - au TermOpen term://* setlocal nonumber + au TermOpen term://* setlocal nonumber laststatus=0 au BufEnter,BufWinEnter,WinEnter,CmdwinEnter * if bufname('%') == "NvimTree" | set laststatus=0 | else | set laststatus=2 | endif ]], false From 3fc587b54d1e84a48f7fbdbfd51c82e4a62b7052 Mon Sep 17 00:00:00 2001 From: Akianonymus Date: Wed, 21 Jul 2021 14:33:50 +0530 Subject: [PATCH 04/21] install.sh: Use chsh instead of grep /etc/shells --- install.sh | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/install.sh b/install.sh index 9683ca4..ee5e2fe 100755 --- a/install.sh +++ b/install.sh @@ -21,7 +21,7 @@ _check_install_dependencies() { printf "%s\n" "Error: Install ${1} before proceeding." exit 1 } - _GIT="$(command -v git)" || _error_dependencies git + command -v git 1>/dev/null || _error_dependencies git _SED="$(command -v sed)" || _error_dependencies sed return 0 } @@ -71,26 +71,29 @@ _setup_terminal_shell() { _mappings_file="${_CONFIG_PATH}/lua/mappings.lua" # only ask for shellname if running in terminal if [ -t 1 ]; then - printf "\n%s\n" "Which shell do you want to use? (Eg. 2)" - printf "\t%s\n" "[ Enter nothing for current shell ( $_CURRENT_SHELL ) ]" - grep '^/bin/' '/etc/shells' | nl - read -r shellNUM + if chsh -l 2>/dev/null 1>&2; then + printf "\nAvailable Shells:\n" + chsh -l | nl + printf "\n%s\n" "Which shell do you want to use? (Eg. 2)" + printf "\t%s\n" "[ Enter nothing for current shell ( $_CURRENT_SHELL ) ]" + read -r shellnum + [ "${shellnum}" -gt 0 ] 2>/dev/null && _SHELLPATH="$(chsh -l | sed -n "$shellnum p")" + fi fi # don't try to do any changes user wants their default shell in nvim - if [ ! -z "$shellNUM" ]; then - shellpath=$(grep '^/bin/' '/etc/shells' | sed -n "$shellNUM p") + if [ -n "$_SHELLPATH" ]; then # Reference: https://stackoverflow.com/a/4247319 # \( & \) will use regex brackets (for later reference with \1) # ( & ) will match text brackets - if "${_SED}" --posix -i'.bak' -e "s=^\(map(.* \+*terminal\) \(.*)\)=\1$shellpath \2=g" "${_mappings_file}"; then - printf "%s\n" "=> Neovim shell changed to $shellpath successfully!" + if "${_SED}" --posix -i'.bak' -e "s=^\(map(.* \+*terminal\) \(.*)\)=\1$_SHELLPATH \2=g" "${_mappings_file}"; then + printf "%s\n" "=> Neovim shell changed to $_SHELLPATH successfully!" else - printf "%s\n" "Cannot edit with sed, edit ${_mappings_file} manually to replace bash with $shellpath." + printf "%s\n" "Cannot edit with sed, edit ${_mappings_file} manually to replace bash with $_SHELLPATH." fi rm -f "${_mappings_file}".bak # delete backup file created by sed fi - printf "%s\n\n" "=> Neovim shell will be ${shellpath:-${_CURRENT_SHELL}}" + printf "%s\n" "=> Neovim shell will be ${_SHELLPATH:-${_CURRENT_SHELL}}" return 0 } _setup_arguments() { From fcfb8145943fa374cbd7f3ed2ab2670273badd34 Mon Sep 17 00:00:00 2001 From: Akianonymus Date: Fri, 23 Jul 2021 12:14:39 +0530 Subject: [PATCH 05/21] init: Move bufferline config to pluginList.lua plugins.bufferline should be as config of nvim-bufferline and pluginList for packer --- init.lua | 1 - lua/pluginList.lua | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 13b4fe9..b3b7e50 100644 --- a/init.lua +++ b/init.lua @@ -2,7 +2,6 @@ require "options" local chad_modules = { "pluginList", - "plugins.bufferline", "mappings", "utils" } diff --git a/lua/pluginList.lua b/lua/pluginList.lua index 56f197f..0829a56 100644 --- a/lua/pluginList.lua +++ b/lua/pluginList.lua @@ -18,7 +18,10 @@ return packer.startup( use { "akinsho/nvim-bufferline.lua", - after = "nvim-base16.lua" + after = "nvim-base16.lua", + config = function() + require "plugins.bufferline" + end } use { From bb04ba07cb36f8ee23212e0e8e04361056313431 Mon Sep 17 00:00:00 2001 From: Akianonymus Date: Fri, 23 Jul 2021 13:22:53 +0530 Subject: [PATCH 06/21] mappings.lua: Code style fixes | Cleanup options.lua --- lua/mappings.lua | 42 +++++++++++++++++++++--------------------- lua/options.lua | 4 ---- 2 files changed, 21 insertions(+), 25 deletions(-) diff --git a/lua/mappings.lua b/lua/mappings.lua index f5cb5ea..0ff8a87 100644 --- a/lua/mappings.lua +++ b/lua/mappings.lua @@ -27,15 +27,15 @@ vim.api.nvim_set_keymap("t", "jk", "", {}) map("v", "p", '"_dP', opt) -- OPEN TERMINALS -- -map("n", "", [[ vnew +terminal | setlocal nobuflisted ]], opt) -- term over right -map("n", "", [[ 10new +terminal | setlocal nobuflisted ]], opt) -- term bottom -map("n", "t", [[ terminal ]], opt) -- term buffer +map("n", "", ":vnew +terminal | setlocal nobuflisted ", opt) -- term over right +map("n", "", ":10new +terminal | setlocal nobuflisted ", opt) -- term bottom +map("n", "t", ": terminal ", opt) -- term buffer -- copy whole file content -map("n", "", [[ %y+]], opt) +map("n", "", ":%y+", opt) -- toggle numbers -map("n", "n", [[ set nu!]], opt) +map("n", "n", ":set nu!", opt) -- Truezen.nvim map("n", "zz", ":TZAtaraxis", opt) @@ -113,24 +113,24 @@ map("i", "", "v:lua.completions()", {expr = true}) map("n", "", ":NvimTreeToggle", opt) -- format code -map("n", "fm", [[ Neoformat]], opt) +map("n", "fm", ":Neoformat", opt) -- dashboard stuff -map("n", "fw", [[ Telescope live_grep]], opt) -map("n", "db", [[ Dashboard]], opt) -map("n", "fn", [[ DashboardNewFile]], opt) -map("n", "bm", [[ DashboardJumpMarks]], opt) -map("n", "l", [[ SessionLoad]], opt) -map("n", "s", [[ SessionSave]], opt) +map("n", "db", ":Dashboard", opt) +map("n", "fn", ":DashboardNewFile", opt) +map("n", "bm", ":DashboardJumpMarks", opt) +map("n", "l", ":SessionLoad", opt) +map("n", "s", ":SessionSave", opt) -- Telescope -map("n", "gt", [[ Telescope git_status ]], opt) -map("n", "cm", [[ Telescope git_commits ]], opt) -map("n", "ff", [[ Telescope find_files ]], opt) -map("n", "fp", [[lua require('telescope').extensions.media_files.media_files()]], opt) -map("n", "fb", [[Telescope buffers]], opt) -map("n", "fh", [[Telescope help_tags]], opt) -map("n", "fo", [[Telescope oldfiles]], opt) +map("n", "fw", ":Telescope live_grep", opt) +map("n", "gt", ":Telescope git_status ", opt) +map("n", "cm", ":Telescope git_commits ", opt) +map("n", "ff", ":Telescope find_files ", opt) +map("n", "fp", ":lua require('telescope').extensions.media_files.media_files()", opt) +map("n", "fb", ":Telescope buffers", opt) +map("n", "fh", ":Telescope help_tags", opt) +map("n", "fo", ":Telescope oldfiles", opt) -- bufferline tab stuff map("n", "", ":enew", opt) -- new buffer @@ -138,8 +138,8 @@ map("n", "b", ":tabnew", opt) -- new tab map("n", "", ":bd!", opt) -- close tab -- move between tabs -map("n", "", [[BufferLineCycleNext]], opt) -map("n", "", [[BufferLineCyclePrev]], opt) +map("n", "", ":BufferLineCycleNext", opt) +map("n", "", ":BufferLineCyclePrev", opt) -- use ESC to turn off search highlighting map("n", "", ":noh", opt) diff --git a/lua/options.lua b/lua/options.lua index 704a4e8..cb62d38 100644 --- a/lua/options.lua +++ b/lua/options.lua @@ -71,9 +71,5 @@ for _, plugin in pairs(disabled_built_ins) do vim.g["loaded_" .. plugin] = 1 end -local M = {} - -- file extension specific tabbing -- vim.cmd([[autocmd Filetype python setlocal expandtab tabstop=4 shiftwidth=4 softtabstop=4]]) - -return M From 559acbd135e2a209fb0a4773046a2e8a684c6f81 Mon Sep 17 00:00:00 2001 From: siduck76 Date: Fri, 23 Jul 2021 18:17:31 +0530 Subject: [PATCH 07/21] rm unneeded error landing nvim by default shows stackrace path so I dont think we should be having this. --- init.lua | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/init.lua b/init.lua index 13b4fe9..0c4969e 100644 --- a/init.lua +++ b/init.lua @@ -13,11 +13,7 @@ async = vim.schedule_wrap( function() for i = 1, #chad_modules, 1 do - local ok, res = xpcall(require, debug.traceback, chad_modules[i]) - if not (ok) then - print("Error loading module : " .. chad_modules[i]) - print(res) -- print stack traceback of the error - end + pcall(require, chad_modules[i]) end async:close() end From 936f368036f56a84e66a5f1f55428c2ecc9211ea Mon Sep 17 00:00:00 2001 From: Akianonymus Date: Fri, 23 Jul 2021 20:19:33 +0530 Subject: [PATCH 08/21] Replace tweekmonster/startuptime.vim with dstein64/vim-startuptime because it's broken now --- lua/pluginList.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/pluginList.lua b/lua/pluginList.lua index 0829a56..8810417 100644 --- a/lua/pluginList.lua +++ b/lua/pluginList.lua @@ -198,7 +198,7 @@ return packer.startup( } use { - "tweekmonster/startuptime.vim", + "dstein64/vim-startuptime", cmd = "StartupTime" } From 6b4435caef3d2f5568896758f790890318500f08 Mon Sep 17 00:00:00 2001 From: Akianonymus Date: Fri, 23 Jul 2021 20:08:20 +0530 Subject: [PATCH 09/21] Don't use new_async It doesn't seem to be improving stuff as it is not supposed to Due to the half baked stats of the startuptime plugin, people were fooled no point in disabling filetype and whatenot See some discussion here: https://github.com/siduck76/NvChad/issues/175 --- init.lua | 19 ++++--------------- lua/options.lua | 7 ------- lua/theme.lua | 7 ------- 3 files changed, 4 insertions(+), 29 deletions(-) diff --git a/init.lua b/init.lua index 805fc32..0e533cc 100644 --- a/init.lua +++ b/init.lua @@ -1,21 +1,10 @@ -require "options" - local chad_modules = { + "options", "pluginList", "mappings", "utils" } -local async -async = - vim.loop.new_async( - vim.schedule_wrap( - function() - for i = 1, #chad_modules, 1 do - pcall(require, chad_modules[i]) - end - async:close() - end - ) -) -async:send() +for i = 1, #chad_modules, 1 do + pcall(require, chad_modules[i]) +end diff --git a/lua/options.lua b/lua/options.lua index cb62d38..a8ad934 100644 --- a/lua/options.lua +++ b/lua/options.lua @@ -1,13 +1,6 @@ local opt = vim.opt local g = vim.g --- Turn these off at startup, will be enabled later just before loading the theme -vim.cmd([[ - syntax off - filetype off - filetype plugin indent off -]]) - opt.ruler = false opt.hidden = true opt.ignorecase = true diff --git a/lua/theme.lua b/lua/theme.lua index 85bf895..5356706 100644 --- a/lua/theme.lua +++ b/lua/theme.lua @@ -3,13 +3,6 @@ vim.g.nvchad_theme = "onedark" local present, base16 = pcall(require, "base16") if present then - -- enabled these options, was disabled in options.lua - vim.cmd([[ - syntax on - filetype on - filetype plugin indent on - ]]) - base16(base16.themes["onedark"], true) require "highlights" return true From 92eb5ca7404081e916b2f58ba15450a5a4870440 Mon Sep 17 00:00:00 2001 From: Akianonymus Date: Fri, 23 Jul 2021 20:41:09 +0530 Subject: [PATCH 10/21] Do not load packer on startup Actually saved some milliseconds, can be observed in benchmarks too from packer readme ``` To optimize startup time, packer.nvim compiles code to perform the lazy-loading operations you specify. This means that you do not need to load packer.nvim unless you want to perform some plugin management operations. ``` Add packer commands manually to mappings.lua, but with basic functionalty By this, we don't losr the packer commands and don't even load at startup After some command is actually executed, it will load the PackerCommands as they were --- init.lua | 1 - lua/mappings.lua | 7 +++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 0e533cc..49bc3ed 100644 --- a/init.lua +++ b/init.lua @@ -1,6 +1,5 @@ local chad_modules = { "options", - "pluginList", "mappings", "utils" } diff --git a/lua/mappings.lua b/lua/mappings.lua index 0ff8a87..c59592f 100644 --- a/lua/mappings.lua +++ b/lua/mappings.lua @@ -146,3 +146,10 @@ map("n", "", ":noh", opt) -- get out of terminal with jk map("t", "jk", "", opt) + +-- Packer commands till because we are not loading it at startup +vim.cmd("silent! command PackerCompile lua require 'pluginList' require('packer').compile()") +vim.cmd("silent! command PackerInstall lua require 'pluginList' require('packer').install()") +vim.cmd("silent! command PackerStatus lua require 'pluginList' require('packer').status()") +vim.cmd("silent! command PackerSync lua require 'pluginList' require('packer').sync()") +vim.cmd("silent! command PackerUpdate lua require 'pluginList' require('packer').update()") From 472278f2e38bb8825b39aac18ab06372082865e5 Mon Sep 17 00:00:00 2001 From: Tavo Annus Date: Fri, 23 Jul 2021 20:22:09 +0300 Subject: [PATCH 11/21] Add vim-fugitive plugin --- lua/mappings.lua | 6 ++++++ lua/pluginList.lua | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/lua/mappings.lua b/lua/mappings.lua index 0ff8a87..5321a3b 100644 --- a/lua/mappings.lua +++ b/lua/mappings.lua @@ -146,3 +146,9 @@ map("n", "", ":noh", opt) -- get out of terminal with jk map("t", "jk", "", opt) + +-- Vim Fugitive +map("n", "gs", ":Git", opt) +map("n", "gh", ":diffget //2", opt) +map("n", "gl", ":diffget //3", opt) +map("n", "gb", ":Git blame", opt) diff --git a/lua/pluginList.lua b/lua/pluginList.lua index 0829a56..568f008 100644 --- a/lua/pluginList.lua +++ b/lua/pluginList.lua @@ -243,5 +243,12 @@ return packer.startup( require("plugins.others").blankline() end } + + use { + "tpope/vim-fugitive", + cmd = { + "Git" + } + } end ) From c98334ae0821bdb51a20a38875673d907cf79b46 Mon Sep 17 00:00:00 2001 From: siduck76 Date: Sat, 24 Jul 2021 09:59:39 +0530 Subject: [PATCH 12/21] lspconfig : update diagnostics in insert mode --- lua/plugins/lspconfig.lua | 6 ++++-- nn.lua | 0 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 nn.lua diff --git a/lua/plugins/lspconfig.lua b/lua/plugins/lspconfig.lua index 8e94849..18c07ae 100644 --- a/lua/plugins/lspconfig.lua +++ b/lua/plugins/lspconfig.lua @@ -104,12 +104,14 @@ vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.diagnostic.on_publish_diagnostics, { virtual_text = { - -- prefix = "", prefix = "", spacing = 0 }, signs = true, - underline = true + underline = true, + + -- set this to true if you want diagnostics to show in insert mode + update_in_insert = false } ) diff --git a/nn.lua b/nn.lua new file mode 100644 index 0000000..e69de29 From bdd63eeedc4ed5fe864e29d305c1666b465976a6 Mon Sep 17 00:00:00 2001 From: siduck76 Date: Sat, 24 Jul 2021 10:25:33 +0530 Subject: [PATCH 13/21] Delete nn.lua --- nn.lua | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 nn.lua diff --git a/nn.lua b/nn.lua deleted file mode 100644 index e69de29..0000000 From a31d8fb22845666c80b7957f1cf7740038c5bb04 Mon Sep 17 00:00:00 2001 From: siduck76 Date: Sat, 24 Jul 2021 10:11:21 +0530 Subject: [PATCH 14/21] fix telescope media files mapping #183 --- lua/mappings.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/mappings.lua b/lua/mappings.lua index cfd6e1b..815bf4d 100644 --- a/lua/mappings.lua +++ b/lua/mappings.lua @@ -127,7 +127,7 @@ map("n", "fw", ":Telescope live_grep", opt) map("n", "gt", ":Telescope git_status ", opt) map("n", "cm", ":Telescope git_commits ", opt) map("n", "ff", ":Telescope find_files ", opt) -map("n", "fp", ":lua require('telescope').extensions.media_files.media_files()", opt) +map("n", "fp", ":Telescope media_files ", opt) map("n", "fb", ":Telescope buffers", opt) map("n", "fh", ":Telescope help_tags", opt) map("n", "fo", ":Telescope oldfiles", opt) From 9157cafb617a60830e5656f749d59e1a12944404 Mon Sep 17 00:00:00 2001 From: siduck76 Date: Sun, 25 Jul 2021 01:31:50 +0530 Subject: [PATCH 15/21] Update telescope.lua --- lua/plugins/telescope.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index 26f97e7..915689f 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -79,5 +79,6 @@ if print("After completion of PackerSync, restart neovim.") -- Trigger packer compile on PackerComplete, so it properly waits for PackerSync vim.cmd 'autocmd User PackerComplete ++once lua require("packer").compile()' + require "pluginList" require("packer").sync("telescope-fzf-native.nvim", "telescope-media-files.nvim") end From edbd88fdb7e7c24e8ca87ab7e76c2522324f2bbd Mon Sep 17 00:00:00 2001 From: gokul <33443763+JavaCafe01@users.noreply.github.com> Date: Sat, 24 Jul 2021 16:43:38 -0700 Subject: [PATCH 16/21] Added javacafe color scheme The javacafe color scheme is my custom smash of nord and pastel colors. --- lua/themes/javacafe.lua | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 lua/themes/javacafe.lua diff --git a/lua/themes/javacafe.lua b/lua/themes/javacafe.lua new file mode 100644 index 0000000..89e4364 --- /dev/null +++ b/lua/themes/javacafe.lua @@ -0,0 +1,33 @@ +local colors = { + white = "#F0F4FC", + darker_black = "#10171f", + black = "#131a21", -- nvim bg + black2 = "#29343d", + one_bg = "#2c333f", + one_bg2 = "#373e4c", + one_bg3 = "#434c5e", + grey = "#4c566a", + grey_fg = "#565c68", + grey_fg2 = "#606672", + light_grey = "#646a76", + red = "#f9929b", + baby_pink = "#fca2aa", + pink = "#fca2af", + line = "#3b4b58", -- for lines like vertsplit + green = "#7ed491", + vibrant_green = "#a5d4af", + blue = "#bac8ef", + nord_blue = "#a3b8ef", + yellow = "#fbdf90", + sun = "#fbdf9a", + purple = "#d7c1ed", + dark_purple = "#ccaced", + teal = "#9ce5c0", + orange = "#e39a83", + cyan = "#c7e5d6", + statusline_bg = "#29343d", + lightbg = "#373e4c", + lightbg2 = "#2c333f" +} + +return colors From 33422b0f3a7e8a7b70531e993e847e1be61845db Mon Sep 17 00:00:00 2001 From: siduck76 Date: Sun, 25 Jul 2021 13:18:48 +0530 Subject: [PATCH 17/21] better colors for javacafe theme --- lua/themes/javacafe.lua | 44 ++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/lua/themes/javacafe.lua b/lua/themes/javacafe.lua index 89e4364..c2bee1f 100644 --- a/lua/themes/javacafe.lua +++ b/lua/themes/javacafe.lua @@ -1,33 +1,33 @@ local colors = { - white = "#F0F4FC", - darker_black = "#10171f", - black = "#131a21", -- nvim bg - black2 = "#29343d", - one_bg = "#2c333f", - one_bg2 = "#373e4c", - one_bg3 = "#434c5e", - grey = "#4c566a", - grey_fg = "#565c68", - grey_fg2 = "#606672", - light_grey = "#646a76", - red = "#f9929b", + white = "#b5bcc9", + darker_black = "#121920", + black = "#181f26", -- nvim bg + black2 = "#1f262d", + one_bg = "#222930", + one_bg2 = "#272e35", + one_bg3 = "#2a3138", + grey = "#363d44", + grey_fg = "#4e555c", + grey_fg2 = "#51585f", + light_grey = "#545b62", + red = "#ef8891", baby_pink = "#fca2aa", pink = "#fca2af", - line = "#3b4b58", -- for lines like vertsplit - green = "#7ed491", + line = "#272e35", -- for lines like vertsplit + green = "#9ce5c0", vibrant_green = "#a5d4af", - blue = "#bac8ef", - nord_blue = "#a3b8ef", + blue = "#99aee5", + nord_blue = "#9aa8cf", yellow = "#fbdf90", sun = "#fbdf9a", purple = "#d7c1ed", dark_purple = "#ccaced", - teal = "#9ce5c0", - orange = "#e39a83", - cyan = "#c7e5d6", - statusline_bg = "#29343d", - lightbg = "#373e4c", - lightbg2 = "#2c333f" + teal = "#92dbb6", + orange = "#EDA685", + cyan = "#b5c3ea", + statusline_bg = "#1d242b", + lightbg = "#2c333f", + lightbg2 = "#21282f" } return colors From 11d75cf597720f87349cf3a02e71ec9d45a05f00 Mon Sep 17 00:00:00 2001 From: siduck76 Date: Sun, 25 Jul 2021 14:53:43 +0530 Subject: [PATCH 18/21] better colors for javacafe theme --- lua/highlights.lua | 5 ++--- lua/themes/javacafe.lua | 16 ++++++++-------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/lua/highlights.lua b/lua/highlights.lua index 08ad42b..42255d5 100644 --- a/lua/highlights.lua +++ b/lua/highlights.lua @@ -115,6 +115,5 @@ bg("NormalFloat", black2) bg("FloatBorder", black2) fg("FloatBorder", black2) --- set bg color for nvim ( so nvim wont use terminal bg) - -bg("Normal", black) +-- set bg color for nvim +-- bg("Normal", black) diff --git a/lua/themes/javacafe.lua b/lua/themes/javacafe.lua index c2bee1f..5785290 100644 --- a/lua/themes/javacafe.lua +++ b/lua/themes/javacafe.lua @@ -1,9 +1,9 @@ local colors = { white = "#b5bcc9", - darker_black = "#121920", - black = "#181f26", -- nvim bg - black2 = "#1f262d", - one_bg = "#222930", + darker_black = "#10171e", + black = "#131a21", -- nvim bg + black2 = "#1a2128", + one_bg = "#1e252c", one_bg2 = "#272e35", one_bg3 = "#2a3138", grey = "#363d44", @@ -13,7 +13,7 @@ local colors = { red = "#ef8891", baby_pink = "#fca2aa", pink = "#fca2af", - line = "#272e35", -- for lines like vertsplit + line = "#20272e", -- for lines like vertsplit green = "#9ce5c0", vibrant_green = "#a5d4af", blue = "#99aee5", @@ -25,9 +25,9 @@ local colors = { teal = "#92dbb6", orange = "#EDA685", cyan = "#b5c3ea", - statusline_bg = "#1d242b", - lightbg = "#2c333f", - lightbg2 = "#21282f" + statusline_bg = "#181f26", + lightbg = "#222930", + lightbg2 = "#1d242b" } return colors From 268c37e52f6ca99e248d5f1653fbffc1d1696b7d Mon Sep 17 00:00:00 2001 From: Akianonymus Date: Mon, 26 Jul 2021 14:32:29 +0530 Subject: [PATCH 19/21] mappings: Allow moving the cursor through wrapped lines normally This doesn't affect any other stuff like 10j or 10k --- lua/mappings.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lua/mappings.lua b/lua/mappings.lua index 815bf4d..17848db 100644 --- a/lua/mappings.lua +++ b/lua/mappings.lua @@ -26,6 +26,14 @@ vim.api.nvim_set_keymap("t", "jk", "", {}) -- Don't copy the replaced text after pasting in visual mode map("v", "p", '"_dP', opt) +-- Allow moving the cursor through wrapped lines with j, k, and +-- http://www.reddit.com/r/vim/comments/2k4cbr/problem_with_gj_and_gk/ +-- empty mode is same as using :map +map("", "j", 'v:count ? "j" : "gj"', {expr = true}) +map("", "k", 'v:count ? "k" : "gk"', {expr = true}) +map("", "", 'v:count ? "j" : "gj"', {expr = true}) +map("", "", 'v:count ? "k" : "gk"', {expr = true}) + -- OPEN TERMINALS -- map("n", "", ":vnew +terminal | setlocal nobuflisted ", opt) -- term over right map("n", "", ":10new +terminal | setlocal nobuflisted ", opt) -- term bottom From 3b05354337cfb026792b5e7f548ffc7d55e5dea5 Mon Sep 17 00:00:00 2001 From: G-Rowell Date: Mon, 26 Jul 2021 15:06:32 +0530 Subject: [PATCH 20/21] Use jdhao/better-escape.vim to handle jk as escape mappings only for insert mode ( so also works on terminal too ) remove visual mode key binding, till we find a proper solution, because it is super annoying right now Original pr here: https://github.com/siduck76/NvChad/pull/160 --- lua/mappings.lua | 5 ----- lua/pluginList.lua | 10 +++++++++- lua/plugins/others.lua | 5 +++++ 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/lua/mappings.lua b/lua/mappings.lua index 17848db..364a021 100644 --- a/lua/mappings.lua +++ b/lua/mappings.lua @@ -18,11 +18,6 @@ map("v", "x", [=[ "_x ]=], opt) this line too ]] -- --- escape with 'jk' mapping -vim.api.nvim_set_keymap("i", "jk", "", {}) -vim.api.nvim_set_keymap("v", "jk", "", {}) -vim.api.nvim_set_keymap("t", "jk", "", {}) - -- Don't copy the replaced text after pasting in visual mode map("v", "p", '"_dP', opt) diff --git a/lua/pluginList.lua b/lua/pluginList.lua index 6d476af..b7b79d8 100644 --- a/lua/pluginList.lua +++ b/lua/pluginList.lua @@ -16,6 +16,14 @@ return packer.startup( event = "VimEnter" } + use { + "jdhao/better-escape.vim", + event = "InsertEnter", + config = function() + require "plugins.others".escape() + end + } + use { "akinsho/nvim-bufferline.lua", after = "nvim-base16.lua", @@ -247,7 +255,7 @@ return packer.startup( use { "tpope/vim-fugitive", cmd = { - "Git" + "Git" } } end diff --git a/lua/plugins/others.lua b/lua/plugins/others.lua index 2278d09..0a060a6 100644 --- a/lua/plugins/others.lua +++ b/lua/plugins/others.lua @@ -15,6 +15,11 @@ M.comment = function() end end +M.escape = function() + vim.g.better_escape_interval = 300 + vim.g.better_escape_shortcut = {"jk"} +end + M.lspkind = function() local present, lspkind = pcall(require, "lspkind") if present then From 3f1e9cf37a2043ab7b4a2fd25f49df43e0e1586b Mon Sep 17 00:00:00 2001 From: Akianonymus Date: Mon, 26 Jul 2021 16:57:00 +0530 Subject: [PATCH 21/21] statusline: Show lsp icon only if client is active for current buffer --- lua/plugins/statusline.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lua/plugins/statusline.lua b/lua/plugins/statusline.lua index 8f543c8..07af61e 100644 --- a/lua/plugins/statusline.lua +++ b/lua/plugins/statusline.lua @@ -117,7 +117,14 @@ gls.right[1] = { provider = function() local clients = vim.lsp.get_active_clients() if next(clients) ~= nil then - return " " .. "  " .. " LSP " + local buf_ft = vim.api.nvim_buf_get_option(0, "filetype") + for _, client in ipairs(clients) do + local filetypes = client.config.filetypes + if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then + return " " .. "  " .. " LSP " + end + end + return "" else return "" end