summaryrefslogtreecommitdiff
path: root/lua/talha
diff options
context:
space:
mode:
authortalha <talha@talhaamir.xyz>2024-01-04 00:05:58 +0500
committertalha <talha@talhaamir.xyz>2024-01-04 00:05:58 +0500
commit19ae0b8a623fcf2d5945d34484159ca6a7138806 (patch)
tree879ca6ecbb1ca91488a6a64af03c430e127478e0 /lua/talha
parenta2776ea78525cf4aeae8d099ff0b85dc3450374d (diff)
parentd17d01afef784a5277fa99b26bf7a9ba2ffa6357 (diff)
Merge branch 'main' of ta_git:/var/www/git/nvim
Diffstat (limited to 'lua/talha')
-rw-r--r--lua/talha/autocmds.lua14
-rw-r--r--lua/talha/functions.lua13
-rw-r--r--lua/talha/packer.lua10
-rw-r--r--lua/talha/remap.lua4
4 files changed, 25 insertions, 16 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 e17cada..b0e8020 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
@@ -61,6 +67,12 @@ function ToggleSpellCheck()
vim.opt.spelllang = 'en_us'
end
+function SetFocusColors(mode)
+ vim.o.background = "light"
+ vim.opt.cursorline = false
+ vim.cmd("colorscheme vscode")
+end
+
function GetHomeDir()
-- for linux/mac
local home = os.getenv("HOME")
@@ -72,6 +84,5 @@ function GetHomeDir()
elseif user_profile ~= nil then
return user_profile
end
-
return nil
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)