Skip to content

Commit

Permalink
chore: adjust some structure
Browse files Browse the repository at this point in the history
  • Loading branch information
shubham-cpp committed Jan 1, 2025
1 parent b3fd4bc commit 3a73373
Show file tree
Hide file tree
Showing 68 changed files with 3,404 additions and 5,972 deletions.
1 change: 1 addition & 0 deletions .config/nvim-astro/lua/plugins/grapple.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ return {
},
keys = {
{ "<leader>A", "<cmd>Grapple toggle<cr>", desc = "Tag a file" },
{ "<leader>`", "<cmd>Grapple toggle<cr>", desc = "Tag a file" },
{ "<c-m>", "<cmd>Grapple toggle<cr>", desc = "Tag a file" },
{ "<c-e>", "<cmd>Grapple toggle_tags<cr>", desc = "Toggle tags menu" },

Expand Down
1 change: 1 addition & 0 deletions .config/nvim-astro/lua/plugins/mini/operators.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ return {
{ "gm", mode = { "n", "x" }, desc = "Duplicate" },
{ "x", mode = { "n", "x" }, desc = "Replace with register" },
{ "gs", mode = { "n", "x" }, desc = "Sort" },
"X",
},
opts = {
-- Exchange text regions
Expand Down
13 changes: 13 additions & 0 deletions .config/nvim-astro/lua/plugins/tpope.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---@type LazySpec
return {
{ 'tpope/vim-repeat', event = 'VeryLazy' },
{
'tpope/vim-abolish',
keys = { 'cr' },
cmd = { 'Abolish', 'Subvert', 'S' },
},
{
'tpope/vim-dispatch',
cmd = { 'Dispatch', 'Make', 'Focus', 'Start', 'FocusDispatch', 'Spawn', 'Copen', 'AbortDispatch' },
},
}
1 change: 1 addition & 0 deletions .config/nvim-lazy/lua/plugins/mini/operators.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ return {
{ "gm", mode = { "n", "x" }, desc = "Duplicate" },
{ "x", mode = { "n", "x" }, desc = "Replace with register" },
{ "gs", mode = { "n", "x" }, desc = "Sort" },
"X",
},
opts = {
-- Exchange text regions
Expand Down
13 changes: 13 additions & 0 deletions .config/nvim-lazy/lua/plugins/tpope.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---@type LazySpec
return {
{ 'tpope/vim-repeat', event = 'VeryLazy' },
{
'tpope/vim-abolish',
keys = { 'cr' },
cmd = { 'Abolish', 'Subvert', 'S' },
},
{
'tpope/vim-dispatch',
cmd = { 'Dispatch', 'Make', 'Focus', 'Start', 'FocusDispatch', 'Spawn', 'Copen', 'AbortDispatch' },
},
}
1 change: 1 addition & 0 deletions .config/nvim-vscode/after/plugin/flash.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ if ok_flash then
modes = { char = { enabled = false, autohide = false } },
})
vim.keymap.set({ "n", "x" }, "s", flash.jump, { desc = "Flash" })
vim.keymap.set({ "n", "o" }, "S", flash.treesitter, { desc = "Flash" })
vim.keymap.set("o", "r", flash.remote, { desc = "Remote Flash" })
vim.keymap.set("c", "<c-f>", flash.toggle, { desc = "Toggle Flash Search" })
end
27 changes: 27 additions & 0 deletions .config/nvim-vscode/after/plugin/mini-nvim.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
local ok, operators = pcall(require, "mini.operators")
if not ok then
return
end

require("mini.align").setup({})
require("mini.move").setup({
-- Move current line in Visual mode
mappings = {
left = "<",
right = ">",
down = "J",
up = "K",

-- Move current line in Normal mode
line_left = "<M-h>",
line_right = "<M-l>",
line_down = "<M-j>",
line_up = "<M-k>",
},
})

operators.setup({
exchange = { prefix = "ge" },
replace = { prefix = "x" },
})
vim.keymap.set("n", "X", "x$", { desc = "Replace to end of line", remap = true })
34 changes: 32 additions & 2 deletions .config/nvim-vscode/after/plugin/theme.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,37 @@ if vim.g.vscode == nil then
})
vim.cmd.colorscheme "tokyodark"
end
if vim.fn.isdirectory(vim.fn.stdpath('data') .. '/plugged/mono-jade') == 1 then
vim.cmd("colo mono-jade")
if vim.fn.isdirectory(vim.fn.stdpath "data" .. "/plugged/mono-jade") == 1 then
vim.cmd.colorscheme "mono-jade"
end
if vim.fn.isdirectory(vim.fn.stdpath "data" .. "/plugged/mellow.nvim") == 1 then
vim.cmd.colorscheme "mellow"
end
local ok_nordic, nordic = pcall(require, "nordic")
if ok_nordic then
nordic.setup({
transparent = { bg = true },
})
require("nordic").load()
end
local ok_gruber_darker, gruber_darker = pcall(require, "gruber-darker")
if ok_gruber_darker then
---@diagnostic disable-next-line: missing-fields
gruber_darker.setup({})
vim.cmd.colorscheme "gruber-darker"
local c = require "gruber-darker.palette"
vim.api.nvim_set_hl(0, "MatchParenCur", { bold = true })
vim.api.nvim_set_hl(0, "@lsp.type.keyword.lua", { fg = c["brown"]:to_string(), bold = false })
vim.api.nvim_set_hl(0, "@lsp.type.event.lua", { link = "GruberDarkerYellowBold" })
vim.api.nvim_set_hl(
0,
"QuickScopePrimary",
{ fg = c["yellow"]:to_string(), bg = c["bg+1"]:to_string(), underline = true, bold = true }
)
vim.api.nvim_set_hl(
0,
"QuickScopeSecondary",
{ fg = c["brown"]:to_string(), bg = c["bg+1"]:to_string(), underline = true, bold = true }
)
end
end
42 changes: 24 additions & 18 deletions .config/nvim-vscode/init.vim
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,26 @@ function! Cond(Cond, ...)
return a:Cond ? opts : extend(opts, { 'on': [], 'for': [] })
endfunction

let g:qs_highlight_on_keys = ['f', 'F', 't', 'T']
let g:qs_lazy_highlight = 1

call plug#begin(stdpath('data') . '/plugged')
Plug 'junegunn/vim-easy-align'
" Plug 'junegunn/vim-easy-align'
Plug 'tpope/vim-repeat'
Plug 'tpope/vim-commentary'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-abolish'
Plug 'unblevable/quick-scope'
Plug 'svermeulen/vim-subversive'
" Plug 'svermeulen/vim-subversive'
Plug 'machakann/vim-swap'
Plug 'folke/flash.nvim'
Plug 'monaqa/dial.nvim'
Plug 'tpope/vim-abolish'
Plug 'echasnovski/mini.nvim'
if !exists('g:vscode')
Plug 'masar3141/mono-jade'
" Plug 'masar3141/mono-jade'
" Plug 'AlexvZyl/nordic.nvim', { 'branch': 'main' }
" Plug 'mellow-theme/mellow.nvim', { 'branch': 'main' }
Plug 'blazkowolf/gruber-darker.nvim', { 'branch': 'main' }
Plug 'windwp/nvim-autopairs'
endif

Expand All @@ -30,7 +38,6 @@ set autoindent
set smartindent
set mouse=a
set iskeyword+=-
set clipboard+=unnamedplus
if !exists('g:vscode')
" filetype plugin indent on
" syntax on
Expand All @@ -56,13 +63,10 @@ set ignorecase
set smartcase
if executable('rg')
set grepprg=rg\ --vimgrep\ --no-heading\ --smart-case
set grepformat+=%f:%l:%c:%m
" set grepformat+=%f:%l:%c:%m
endif
let g:mapleader = " "

let g:qs_highlight_on_keys = ['f', 'F', 't', 'T']
let g:qs_lazy_highlight = 1

if exists('g:vscode')
map ze <Cmd>call VSCodeNotify('scrollLineDown')<CR>
map zy <Cmd>call VSCodeNotify('scrollLineUp')<CR>
Expand Down Expand Up @@ -162,12 +166,11 @@ else
nnoremap ,W <cmd>noautocmd w!<cr>
nnoremap zp vaBo^<Esc>
endif

" for quick-scope plugin
highlight QuickScopePrimary guifg='#afff5f' gui=underline ctermfg=155 cterm=underline
highlight QuickScopeSecondary guifg='#5fffff' gui=underline ctermfg=81 cterm=underline

nmap x <plug>(SubversiveSubstitute)
nmap xx <plug>(SubversiveSubstituteLine)
nmap X <plug>(SubversiveSubstituteToEndOfLine)
nmap 0 ^
nnoremap <Esc> <cmd>nohl<cr>
Expand All @@ -178,21 +181,24 @@ nnoremap dl "_dl
nnoremap <silent> ,s :let @/='\<'.expand('<cword>').'\>'<CR>cgn
vnoremap ,s "sy:let @/=@s<CR>cgn
vnoremap <expr> p 'pgv"'.v:register.'y'
vnoremap J :m '>+1<CR>gv=gv
vnoremap K :m '<-2<CR>gv=gv
vnoremap > >gv
vnoremap < <gv
xmap ga <Plug>(EasyAlign)
nmap ga <Plug>(EasyAlign)
onoremap <silent> ie :exec "normal! ggVG"<cr>
onoremap <silent> iv :exec "normal! HVL"<cr>
" from vim-swap plugin
omap i, <Plug>(swap-textobject-i)
xmap i, <Plug>(swap-textobject-i)
omap a, <Plug>(swap-textobject-a)
xmap a, <Plug>(swap-textobject-a)
augroup highlight_yank
autocmd!
autocmd TextYankPost * silent! lua vim.highlight.on_yank { higroup="IncSearch", timeout=100 }
augroup END

" set clipboard+=unnamedplus
lua << EOF
vim.schedule(function()
vim.opt.clipboard:append(vim.env.SSH_TTY and '' or 'unnamedplus') -- Sync with system clipboard
end)
if vim.g.vscode == nil then
local o = vim.opt
o.undodir = { vim.fn.stdpath 'state' .. '/undodir//' }
Expand Down
40 changes: 1 addition & 39 deletions .config/nvim/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,4 @@ vim.g.base46_cache = vim.fn.stdpath 'data' .. '/base46_cache/'

vim.t['bufs'] = vim.t.bufs and vim.t.bufs or vim.api.nvim_list_bufs() -- initialize buffers for the current tab

local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
'git',
'clone',
'--filter=blob:none',
'https://github.com/folke/lazy.nvim.git',
'--branch=stable', -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)

require('lazy').setup({
{ import = 'plugins' },
{ import = 'plugins.mini' },
{ import = 'plugins.cmp' },
{ import = 'plugins.lsp' },
}, {
change_detection = {
enabled = true,
notify = false,
},
lockfile = vim.fn.stdpath 'state' .. '/lazy-lock.json', -- lockfile generated after running update.
performance = {
rtp = {
---@type string[] list any plugins you want to disable here
disabled_plugins = {
'gzip',
'matchit',
'netrwPlugin',
'tarPlugin',
'tohtml',
'tutor',
'zipPlugin',
},
},
},
})
require 'lazy_init'
38 changes: 38 additions & 0 deletions .config/nvim/lua/lazy_init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
'git',
'clone',
'--filter=blob:none',
'https://github.com/folke/lazy.nvim.git',
'--branch=stable', -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)

require('lazy').setup({
{ import = 'plugins' },
{ import = 'plugins.mini' },
{ import = 'plugins.lsp' },
}, {
change_detection = {
enabled = true,
notify = false,
},
lockfile = vim.fn.stdpath 'state' .. '/lazy-lock.json', -- lockfile generated after running update.
performance = {
rtp = {
---@type string[] list any plugins you want to disable here
disabled_plugins = {
'gzip',
'matchit',
'netrwPlugin',
'tarPlugin',
'tohtml',
'tutor',
'zipPlugin',
},
},
},
})
6 changes: 0 additions & 6 deletions .config/nvim/lua/plugins/align.lua

This file was deleted.

Loading

0 comments on commit 3a73373

Please sign in to comment.