From d17d01afef784a5277fa99b26bf7a9ba2ffa6357 Mon Sep 17 00:00:00 2001 From: talha Date: Wed, 3 Jan 2024 19:34:10 +0500 Subject: Updated colorscheme, added ctags --- lua/talha/autocmds.lua | 14 ++------------ lua/talha/functions.lua | 12 ++++++++++++ lua/talha/packer.lua | 10 +++++++--- lua/talha/remap.lua | 4 ++++ 4 files changed, 25 insertions(+), 15 deletions(-) (limited to 'lua') 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", "s", [[:%s/\<\>//gI]]) + +-- remapping quickfix list navigation +vim.keymap.set("n", "l", vim.cmd.cnext) +vim.keymap.set("n", "h", vim.cmd.cprev) -- cgit v1.2.3