diff options
author | talha <talha@talhaamir.xyz> | 2024-01-04 00:05:58 +0500 |
---|---|---|
committer | talha <talha@talhaamir.xyz> | 2024-01-04 00:05:58 +0500 |
commit | 19ae0b8a623fcf2d5945d34484159ca6a7138806 (patch) | |
tree | 879ca6ecbb1ca91488a6a64af03c430e127478e0 | |
parent | a2776ea78525cf4aeae8d099ff0b85dc3450374d (diff) | |
parent | d17d01afef784a5277fa99b26bf7a9ba2ffa6357 (diff) |
Merge branch 'main' of ta_git:/var/www/git/nvim
-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 | 13 | ||||
-rw-r--r-- | lua/talha/packer.lua | 10 | ||||
-rw-r--r-- | lua/talha/remap.lua | 4 |
7 files changed, 33 insertions, 42 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 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) |