summaryrefslogtreecommitdiff
path: root/lua/talha
diff options
context:
space:
mode:
Diffstat (limited to 'lua/talha')
-rw-r--r--lua/talha/autocmds.lua14
-rw-r--r--lua/talha/functions.lua12
-rw-r--r--lua/talha/packer.lua10
-rw-r--r--lua/talha/remap.lua4
4 files changed, 25 insertions, 15 deletions
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)