diff options
-rw-r--r-- | after/plugin/colors.lua | 27 | ||||
-rw-r--r-- | after/plugin/lsp.lua | 1 | ||||
-rw-r--r-- | after/plugin/vim-gutentags.lua | 6 | ||||
-rw-r--r-- | lua/talha/autocmds.lua | 14 | ||||
-rw-r--r-- | lua/talha/functions.lua | 12 | ||||
-rw-r--r-- | lua/talha/packer.lua | 10 | ||||
-rw-r--r-- | lua/talha/remap.lua | 4 | ||||
-rw-r--r-- | plugin/packer_compiled.lua | 25 |
8 files changed, 53 insertions, 46 deletions
diff --git a/after/plugin/colors.lua b/after/plugin/colors.lua index b32344f..6757b21 100644 --- a/after/plugin/colors.lua +++ b/after/plugin/colors.lua @@ -1,26 +1,3 @@ -require("gruvbox").setup({ - terminal_colors = true, -- add neovim terminal colors - undercurl = true, - underline = true, - bold = true, - italic = { - strings = true, - emphasis = true, - comments = true, - operators = false, - folds = true, - }, - strikethrough = true, - invert_selection = false, - invert_signs = false, - invert_tabline = false, - invert_intend_guides = false, - inverse = true, -- invert background for search, diffs, statuslines and errors - contrast = "", -- can be "hard", "soft" or empty string - palette_overrides = {}, - overrides = {}, - dim_inactive = false, - transparent_mode = false, -}) +vim.o.background = "dark" -vim.cmd("colorscheme nightfly") +vim.cmd("colorscheme vscode") diff --git a/after/plugin/lsp.lua b/after/plugin/lsp.lua index 642328c..f8dae3c 100644 --- a/after/plugin/lsp.lua +++ b/after/plugin/lsp.lua @@ -20,7 +20,6 @@ lsp.on_attach(function(client, bufnr) vim.keymap.set("n", "<leader>vrr", function() vim.lsp.buf.references() end, opts) vim.keymap.set("n", "<leader>vrn", function() vim.lsp.buf.rename() end, opts) vim.keymap.set("i", "<C-h>", function() vim.lsp.buf.signature_help() end, opts) - lsp.buffer_autoformat() end) lsp.setup() diff --git a/after/plugin/vim-gutentags.lua b/after/plugin/vim-gutentags.lua new file mode 100644 index 0000000..40bd630 --- /dev/null +++ b/after/plugin/vim-gutentags.lua @@ -0,0 +1,6 @@ +vim.opt.tags = './tags' +vim.g.gutentags_ctags_exclude_wildignore = 1 +vim.g.gutentags_ctags_exclude = { + 'node_modules', '_build', 'build', 'CMakeFiles', '.mypy_cache', 'venv', + '*.md', '*.tex', '*.css', '*.html', '*.json', '*.xml', '*.xmls', '*.ui', + '*.py', '*.sh', '*.sql', '*.wsgi'} diff --git a/lua/talha/autocmds.lua b/lua/talha/autocmds.lua index a892fa2..4ce8ae4 100644 --- a/lua/talha/autocmds.lua +++ b/lua/talha/autocmds.lua @@ -1,19 +1,9 @@ local autocmd_group = vim.api.nvim_create_augroup("Custom auto-commands", { clear = true }) -vim.api.nvim_create_autocmd({ "BufWritePost" }, { - pattern = { "*.py" }, - desc = "Auto-format python files after saving", - callback = function() - local filename = vim.api.nvim_buf_get_name(0) - vim.cmd(":silent !autopep8 -i " .. filename) - vim.cmd(":silent !isort " .. filename) - end, - group = autocmd_group, -}) - vim.api.nvim_create_autocmd({ "CursorHold" }, { desc = "reload the file on changes", - command = "checktime", + command = "silent! checktime", group = autocmd_group, }) + diff --git a/lua/talha/functions.lua b/lua/talha/functions.lua index 946bfd8..2a4570e 100644 --- a/lua/talha/functions.lua +++ b/lua/talha/functions.lua @@ -1,5 +1,11 @@ local Path = require"plenary.path" +function FormatFile() + local filename = vim.api.nvim_buf_get_name(0) + vim.cmd(":silent !autopep8 -i " .. filename) + vim.cmd(":silent !isort " .. filename) +end + function CreateDailyNote() local file_path = vim.api.nvim_buf_get_name(0) local dir_path = file_path @@ -60,3 +66,9 @@ function ToggleSpellCheck() vim.opt.spell = not(vim.opt.spell:get()) vim.opt.spelllang = 'en_us' end + +function SetFocusColors(mode) + vim.o.background = "light" + vim.opt.cursorline = false + vim.cmd("colorscheme vscode") +end diff --git a/lua/talha/packer.lua b/lua/talha/packer.lua index 7b97acf..c1980c5 100644 --- a/lua/talha/packer.lua +++ b/lua/talha/packer.lua @@ -14,9 +14,8 @@ return require('packer').startup(function(use) use({ 'nvim-treesitter/nvim-treesitter', run = ':TSUpdate' }) -- colorschemes - use { "ellisonleao/gruvbox.nvim" } - use {"bluz71/vim-nightfly-colors"} - use {"dasupradyumna/midnight.nvim"} + use {'Mofiqul/vscode.nvim'} + use {'aditya-azad/candle-grey'} use { "theprimeagen/harpoon" } @@ -24,6 +23,11 @@ return require('packer').startup(function(use) use('tpope/vim-fugitive') + use({ + 'ludovicchabant/vim-gutentags', + ft={'h', 'hpp', 'c', 'cpp'} + }) + use { 'VonHeikemen/lsp-zero.nvim', branch = 'v2.x', diff --git a/lua/talha/remap.lua b/lua/talha/remap.lua index 442ec9d..882d651 100644 --- a/lua/talha/remap.lua +++ b/lua/talha/remap.lua @@ -35,3 +35,7 @@ vim.keymap.set({"n", "x"}, "X", [["_d]]) -- global substitute the word cursor is on in current file vim.keymap.set("n", "<leader>s", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]]) + +-- remapping quickfix list navigation +vim.keymap.set("n", "<C-f>l", vim.cmd.cnext) +vim.keymap.set("n", "<C-f>h", vim.cmd.cprev) diff --git a/plugin/packer_compiled.lua b/plugin/packer_compiled.lua index 1663afb..9507539 100644 --- a/plugin/packer_compiled.lua +++ b/plugin/packer_compiled.lua @@ -79,16 +79,16 @@ _G.packer_plugins = { path = "/home/talha/.local/share/nvim/site/pack/packer/start/LuaSnip", url = "https://github.com/L3MON4D3/LuaSnip" }, + ["candle-grey"] = { + loaded = true, + path = "/home/talha/.local/share/nvim/site/pack/packer/start/candle-grey", + url = "https://github.com/aditya-azad/candle-grey" + }, ["cmp-nvim-lsp"] = { loaded = true, path = "/home/talha/.local/share/nvim/site/pack/packer/start/cmp-nvim-lsp", url = "https://github.com/hrsh7th/cmp-nvim-lsp" }, - ["gruvbox.nvim"] = { - loaded = true, - path = "/home/talha/.local/share/nvim/site/pack/packer/start/gruvbox.nvim", - url = "https://github.com/ellisonleao/gruvbox.nvim" - }, harpoon = { loaded = true, path = "/home/talha/.local/share/nvim/site/pack/packer/start/harpoon", @@ -144,10 +144,25 @@ _G.packer_plugins = { path = "/home/talha/.local/share/nvim/site/pack/packer/start/undotree", url = "https://github.com/mbbill/undotree" }, + ["vim-darkness"] = { + loaded = true, + path = "/home/talha/.local/share/nvim/site/pack/packer/start/vim-darkness", + url = "https://github.com/Jorengarenar/vim-darkness" + }, ["vim-fugitive"] = { loaded = true, path = "/home/talha/.local/share/nvim/site/pack/packer/start/vim-fugitive", url = "https://github.com/tpope/vim-fugitive" + }, + ["vim-gutentags"] = { + loaded = true, + path = "/home/talha/.local/share/nvim/site/pack/packer/start/vim-gutentags", + url = "https://github.com/ludovicchabant/vim-gutentags" + }, + ["vscode.nvim"] = { + loaded = true, + path = "/home/talha/.local/share/nvim/site/pack/packer/start/vscode.nvim", + url = "https://github.com/Mofiqul/vscode.nvim" } } |