huge updates

This commit is contained in:
sankalp committed 2024-08-15 19:28:13 +05:45
1 parent d93e388067
commit c9d290595f
37 files changed
+1309 -601

No files matched your search

+4 -27
View File
@@ -1,27 +1,4 @@
require('preferences')
require('keymaps')
require('remaps')
local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim'
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = 'https://github.com/folke/lazy.nvim.git'
local out = vim.fn.system({ 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ 'Failed to clone lazy.nvim:\n', 'ErrorMsg' },
{ out, 'WarningMsg' },
{ '\nPress any key to exit...' },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(lazypath)
require('lazy').setup({
spec = {
{ import = 'plugins' },
},
})
vim.cmd('colorscheme onedark')
require('config.keymaps')
require('config.options')
require('config.lazy')
require('config.autocmd')
+19 -12
View File
@@ -2,42 +2,49 @@
"LuaSnip": { "branch": "master", "commit": "b84eeb3641b08324287587b426ec974b888390d9" },
"Navigator.nvim": { "branch": "master", "commit": "91d86506ac2a039504d5205d32a1d4bc7aa57072" },
"alpha-nvim": { "branch": "main", "commit": "355fbb81a59637a8963cf5847074f8c44dbef11f" },
"bufdelete.nvim": { "branch": "master", "commit": "f6bcea78afb3060b198125256f897040538bcb81" },
"bufferline.nvim": { "branch": "main", "commit": "2e3c8cc5a57ddd32f1edd2ffd2ccb10c09421f6c" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" },
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
"cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
"codeium.vim": { "branch": "main", "commit": "0b74f274b82c00eaad4b5b5cd8b2e76f872d19f1" },
"dressing.nvim": { "branch": "master", "commit": "6741f1062d3dc6e4755367a7e9b347b553623f04" },
"friendly-snippets": { "branch": "main", "commit": "00ebcaa159e817150bd83bfe2d51fa3b3377d5c4" },
"inc-rename.nvim": { "branch": "main", "commit": "8ba77017ca468f3029bf88ef409c2d20476ea66b" },
"lazy.nvim": { "branch": "main", "commit": "077102c5bfc578693f12377846d427f49bc50076" },
"lspkind.nvim": { "branch": "master", "commit": "cff4ae321a91ee3473a92ea1a8c637e3a9510aec" },
"lualine.nvim": { "branch": "master", "commit": "b431d228b7bbcdaea818bdc3e25b8cdbe861f056" },
"markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "f2acd4a21db1ca0a12559e7a9f7cdace3bdbfb09" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "3ed90180e70a6a50cd37ce7ecc3693bcdaa7b290" },
"mason-null-ls.nvim": { "branch": "main", "commit": "de19726de7260c68d94691afb057fa73d3cc53e7" },
"mason-tool-installer.nvim": { "branch": "main", "commit": "c5e07b8ff54187716334d585db34282e46fa2932" },
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
"mini.comment": { "branch": "main", "commit": "03c13e37318bdb18481311c0ac1adc9ed731caf1" },
"mini.surround": { "branch": "main", "commit": "57caca9525cec0ea771a67326b0ee637d056078a" },
"neo-tree.nvim": { "branch": "v3.x", "commit": "29f7c215332ba95e470811c380ddbce2cebe2af4" },
"nerdy.nvim": { "branch": "main", "commit": "b467d6609b78d6a5f1e12cbc08fcc1ac87af20f5" },
"none-ls.nvim": { "branch": "main", "commit": "cfa65d86e21eeb60544d5e823f6db43941322a53" },
"nui.nvim": { "branch": "main", "commit": "61574ce6e60c815b0a0c4b5655b8486ba58089a1" },
"nvim": { "branch": "main", "commit": "18bab5ec4c782cdf7d7525dbe89c60bfa02fc195" },
"nvim-autopairs": { "branch": "master", "commit": "48ca9aaee733911424646cb1605f27bc01dedbe3" },
"nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" },
"nvim-dbee": { "branch": "master", "commit": "21d2cc0844a16262bb6ea93ab3d0a0f20bd87853" },
"nvim-lspconfig": { "branch": "master", "commit": "a67bc39aaa4f1e13212c5022a561120846eaef27" },
"nvim-lspconfig": { "branch": "master", "commit": "037ea0901ce9a28cfcaa36302618f06d2e164fbf" },
"nvim-notify": { "branch": "master", "commit": "d333b6f167900f6d9d42a59005d82919830626bf" },
"nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" },
"nvim-treesitter": { "branch": "master", "commit": "047ce49ccf9a2dce22e1cf3843bef3b5682a8144" },
"nvim-ts-autotag": { "branch": "main", "commit": "dc5e1687ab76ee02e0f11c5ce137f530b36e98b3" },
"nvim-treesitter": { "branch": "master", "commit": "bfb50de9cb0673a3bff620d881f690fb7e0d1328" },
"nvim-treesitter-context": { "branch": "master", "commit": "0f3332788e0bd37716fbd25f39120dcfd557c90f" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "ced6375723b20616282f9f6a1018a63ae19b106a" },
"nvim-ts-autotag": { "branch": "main", "commit": "0cb76eea80e9c73b88880f0ca78fbd04c5bdcac7" },
"nvim-web-devicons": { "branch": "master", "commit": "3722e3d1fb5fe1896a104eb489e8f8651260b520" },
"oil.nvim": { "branch": "master", "commit": "fcca212c2e966fc3dec1d4baf888e670631d25d1" },
"onedark.nvim": { "branch": "master", "commit": "fae34f7c635797f4bf62fb00e7d0516efa8abe37" },
"persistence.nvim": { "branch": "main", "commit": "f6aad7dde7fcf54148ccfc5f622c6d5badd0cc3d" },
"plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" },
"refactoring.nvim": { "branch": "master", "commit": "c406fc5fb4d7ba5fce7b668637075fad6e75e9f8" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" },
"telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
"telescope.nvim": { "branch": "master", "commit": "5972437de807c3bc101565175da66a1aa4f8707a" },
"termim.nvim": { "branch": "main", "commit": "58344167abb97bcef9bf720a762ea653a94e9daa" },
"ultimate-autopair.nvim": { "branch": "v0.6", "commit": "1420fb9e07b1d80cc6d87e7d90827fb2c1109cb3" },
"vim-dadbod": { "branch": "master", "commit": "7888cb7164d69783d3dce4e0283decd26b82538b" },
"vim-dadbod-completion": { "branch": "master", "commit": "880f7e9f2959e567c718d52550f9fae1aa07aa81" },
"vim-dadbod-ui": { "branch": "master", "commit": "0f51d8de368c8c6220973e8acd156d17da746f4c" },
"wilder.nvim": { "branch": "master", "commit": "679f348dc90d80ff9ba0e7c470c40a4d038dcecf" }
}
+95
View File
@@ -0,0 +1,95 @@
-- don't auto comment new line
vim.api.nvim_create_autocmd('BufEnter', { command = [[set formatoptions-=cro]] })
-- to make border as same as neovim ColorScheme
vim.api.nvim_create_autocmd({ 'UIEnter', 'ColorScheme' }, {
callback = function()
local normal = vim.api.nvim_get_hl(0, { name = 'Normal' })
if not normal.bg then
return
end
io.write(string.format('\027Ptmux;\027\027]11;#%06x\007\027\\', normal.bg))
io.write(string.format('\027]11;#%06x\027\\', normal.bg))
end,
})
vim.api.nvim_create_autocmd('UILeave', {
callback = function()
io.write('\027Ptmux;\027\027]111;\007\027\\')
io.write('\027]111\027\\')
end,
})
-- Highlight on yank
vim.api.nvim_create_autocmd('TextYankPost', {
callback = function()
vim.highlight.on_yank()
end,
})
-- go to last loc when opening a buffer
-- this mean that when you open a file, you will be at the last position
vim.api.nvim_create_autocmd('BufReadPost', {
callback = function()
local mark = vim.api.nvim_buf_get_mark(0, '"')
local lcount = vim.api.nvim_buf_line_count(0)
if mark[1] > 0 and mark[1] <= lcount then
pcall(vim.api.nvim_win_set_cursor, 0, mark)
end
end,
})
-- auto close brackets
vim.api.nvim_create_autocmd('FileType', { pattern = 'man', command = [[nnoremap <buffer><silent> q :quit<CR>]] })
-- show cursor line only in active window
local cursorGrp = vim.api.nvim_create_augroup('CursorLine', { clear = true })
vim.api.nvim_create_autocmd({ 'InsertLeave', 'WinEnter' }, {
pattern = '*',
command = 'set cursorline',
group = cursorGrp,
})
vim.api.nvim_create_autocmd(
{ 'InsertEnter', 'WinLeave' },
{ pattern = '*', command = 'set nocursorline', group = cursorGrp }
)
-- Enable spell checking for certain file types
vim.api.nvim_create_autocmd(
{ 'BufRead', 'BufNewFile' },
-- { pattern = { "*.txt", "*.md", "*.tex" }, command = [[setlocal spell<cr> setlocal spelllang=en,de<cr>]] }
{
pattern = { '*.txt', '*.md', '*.tex' },
callback = function()
vim.opt.spell = true
vim.opt.spelllang = 'en,de'
end,
}
)
-- close some filetypes with <q>
vim.api.nvim_create_autocmd('FileType', {
group = vim.api.nvim_create_augroup('close_with_q', { clear = true }),
pattern = {
'PlenaryTestPopup',
'help',
'lspinfo',
'man',
'notify',
'qf',
'spectre_panel',
'startuptime',
'tsplayground',
'neotest-output',
'checkhealth',
'neotest-summary',
'neotest-output-panel',
},
callback = function(event)
vim.bo[event.buf].buflisted = false
vim.keymap.set('n', 'q', '<cmd>close<cr>', { buffer = event.buf, silent = true })
end,
})
-- resize neovim split when terminal is resized
vim.api.nvim_command('autocmd VimResized * wincmd =')
+158
View File
@@ -0,0 +1,158 @@
return {
kind = {
Array = '',
Boolean = '',
Class = '',
Color = '',
Constant = '',
Constructor = '',
Enum = '',
EnumMember = '',
Event = '',
Field = '',
File = '',
Folder = '󰉋',
Function = '',
Interface = '',
Key = '',
Keyword = '',
Method = '',
-- Module = " ",
Module = '',
Namespace = '',
Null = '󰟢',
Number = '',
Object = '',
Operator = '',
Package = '',
Property = '',
Reference = '',
Snippet = '',
String = '',
Struct = '',
Text = '',
TypeParameter = '',
Unit = '',
Value = '',
Variable = '',
},
git = {
LineAdded = '',
LineModified = '',
LineRemoved = '',
FileDeleted = '',
FileIgnored = '◌',
FileRenamed = '',
FileStaged = 'S',
FileUnmerged = '',
FileUnstaged = '',
FileUntracked = 'U',
Diff = '',
Repo = '',
Octoface = '',
Copilot = '',
Branch = '',
},
ui = {
ArrowCircleDown = '',
ArrowCircleLeft = '',
ArrowCircleRight = '',
ArrowCircleUp = '',
BoldArrowDown = '',
BoldArrowLeft = '',
BoldArrowRight = '',
BoldArrowUp = '',
BoldClose = '',
BoldDividerLeft = '',
BoldDividerRight = '',
BoldLineLeft = '▎',
BoldLineMiddle = '┃',
BoldLineDashedMiddle = '┋',
BookMark = '',
BoxChecked = '',
Bug = '',
Stacks = '',
Scopes = '',
Watches = '󰂥',
DebugConsole = '',
Calendar = '',
Check = '',
ChevronRight = '',
ChevronShortDown = '',
ChevronShortLeft = '',
ChevronShortRight = '',
ChevronShortUp = '',
Circle = '',
Close = '󰅖',
CloudDownload = '',
Code = '',
Comment = '',
Dashboard = '',
DividerLeft = '',
DividerRight = '',
DoubleChevronRight = '»',
Ellipsis = '',
EmptyFolder = '',
EmptyFolderOpen = '',
File = '',
FileSymlink = '',
Files = '',
FindFile = '󰈞',
FindText = '󰊄',
Fire = '',
Folder = '󰉋',
FolderOpen = '',
FolderSymlink = '',
Forward = '',
Gear = '',
History = '',
Lightbulb = '',
LineLeft = '▏',
LineMiddle = '│',
List = '',
Lock = '',
NewFile = '',
Note = '',
Package = '',
Pencil = '󰏫',
Plus = '',
Project = '',
Search = '',
SignIn = '',
SignOut = '',
Tab = '󰌒',
Table = '',
Target = '󰀘',
Telescope = '',
Text = '',
Tree = '',
Triangle = '󰐊',
TriangleShortArrowDown = '',
TriangleShortArrowLeft = '',
TriangleShortArrowRight = '',
TriangleShortArrowUp = '',
},
diagnostics = {
BoldError = '',
Error = '',
BoldWarning = '',
Warn = '',
BoldInformation = '',
Info = '',
BoldQuestion = '',
Question = '',
BoldHint = '',
Hint = '󰌶',
Debug = '',
Trace = '✎',
},
misc = {
Robot = '󰚩',
Squirrel = '',
Tag = '',
Watch = '',
Smiley = '',
Package = '',
CircuitBoard = '',
},
}
+84
View File
@@ -0,0 +1,84 @@
local opts = { noremap = true, silent = true }
-- Increment / Decrement
vim.keymap.set('n', '+', '<C-a>')
vim.keymap.set('n', '-', '<C-x>')
-- Select all
vim.keymap.set('n', '<C-a>', 'gg<S-v>G')
-- Replace currently selected text with default register without yanking it
vim.keymap.set('x', '<leader>p', '"_dP')
-- Delete without yanking
vim.keymap.set('n', '<leader>d', '"_d')
vim.keymap.set('v', '<leader>d', '"_d')
-- Clear highlights on search when pressing <Esc> in normal mode
vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')
-- Resize window using <ctrl> arrow keys
vim.keymap.set('n', '<A-Up>', '<cmd>resize +2<cr>', { desc = 'Increase Window Height' })
vim.keymap.set('n', '<A-Down>', '<cmd>resize -2<cr>', { desc = 'Decrease Window Height' })
vim.keymap.set('n', '<A-Left>', '<cmd>vertical resize -2<cr>', { desc = 'Decrease Window Width' })
vim.keymap.set('n', '<A-Right>', '<cmd>vertical resize +2<cr>', { desc = 'Increase Window Width' })
-- Visual vim.keymap.sets
vim.keymap.set('v', '<leader>r', '"hy:%s/<C-r>h//g<left><left>') -- Replace all instances of highlighted words
vim.keymap.set('v', '<C-s>', ':sort<CR>') -- Sort highlighted text in visual mode with Control+S
vim.keymap.set('v', 'K', ":m '>-2<CR>gv=gv") -- Move current line up
vim.keymap.set('v', 'J', ":m '>+1<CR>gv=gv") -- Move current line down
--utility vim.keymap.setpings
vim.keymap.set('n', 'n', 'nzzzv') -- keep the cursor centered when doing 'n'
vim.keymap.set('n', 'N', 'Nzzzv') -- keep the cursor centered when doing 'N'
vim.keymap.set('n', 'J', 'mzJ`z', { desc = 'Join line without moving the cursor' })
vim.keymap.set('n', 'cn', '*``cgn', { desc = 'Change next match by pressing dot (.)' })
vim.keymap.set('n', 'cN', '*``cgN', { desc = 'Change previous match by pressing dot (.)' })
vim.keymap.set('n', '<leader>vp', '`[v`]<CR>', { desc = 'Select pasted text' })
vim.keymap.set('n', '<C-d>', '<C-d>zz', { desc = 'Scroll down' })
vim.keymap.set('n', '<C-u>', '<C-u>zz', { desc = 'Scroll up' })
vim.keymap.set({ 'n', 'v' }, '<leader>y', '"+y', { desc = 'Copy to system clipboard' })
vim.keymap.set({ 'n', 'v' }, '<leader>p', '"+p', { desc = 'Paste from system clipboard' })
vim.keymap.set({ 'i' }, '<C-l>', '<Right>', { desc = 'Move cursor to right' })
vim.keymap.set({ 'i' }, '<C-h>', '<Left>', { desc = 'Move cursor to right' })
-- Better window management
vim.keymap.set('n', 'hs', ':split<Return>', opts)
vim.keymap.set('n', 'vs', ':vsplit<Return>', opts)
vim.keymap.set('n', '<C-h>', '<C-w>h', { desc = 'Move to left split' })
vim.keymap.set('n', '<C-j>', '<C-w>j', { desc = 'Move to below split' })
vim.keymap.set('n', '<C-k>', '<C-w>k', { desc = 'Move to above split' })
vim.keymap.set('n', '<C-l>', '<C-w>l', { desc = 'Move to right split' })
vim.keymap.set('n', '<A-Up>', '<cmd>resize -2<CR>', { desc = 'Resize split up' })
vim.keymap.set('n', '<A-Down>', '<cmd>resize +2<CR>', { desc = 'Resize split down' })
vim.keymap.set('n', '<A-Left>', '<cmd>vertical resize -2<CR>', { desc = 'Resize split left' })
vim.keymap.set('n', '<A-Right>', '<cmd>vertical resize +2<CR>', { desc = 'Resize split right' })
-- Stay in indent mode
vim.keymap.set('v', '<', '<gv', { desc = '(V) Indent to left' })
vim.keymap.set('v', '>', '>gv', { desc = '(V) Indent to right' })
-- insert semicolon in the end
-- vim.keymap.set('i', '<A-;>', '<Esc>miA;<Esc>`ii', { desc = 'insert semicolon in the end' })
-- Change text without putting it into the vim register,
vim.keymap.set({ 'n', 'x' }, 'c', '"_c', { desc = 'Change without yanking' })
vim.keymap.set({ 'n', 'x' }, 'C', '"_C', { desc = 'Change without yanking' })
vim.keymap.set({ 'n', 'x' }, 'cc', '"_cc', { desc = 'Change without yanking' })
vim.keymap.set({ 'n', 'x' }, 'x', '"_x', { desc = 'delete without yanking' })
-- Better escape using jk in insert and terminal mode
vim.keymap.set('i', 'jk', '<ESC>')
vim.keymap.set('i', 'kj', '<ESC>')
vim.keymap.set('i', 'jj', '<ESC>')
-- Terminal Mappings
vim.keymap.set('t', 'jk', '<C-\\><C-n>')
vim.keymap.set('t', 'kj', '<C-\\><C-n>')
vim.keymap.set('t', '<ESC>', '<C-\\><C-n>')
-- save file
vim.keymap.set({ 'i', 'v', 'n', 's' }, '<A-s>', '<cmd>wa<cr><esc>', { desc = 'Save all file' })
+77
View File
@@ -0,0 +1,77 @@
-- Bootstrap lazy.nvim
local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim'
---@diagnostic disable-next-line: undefined-field
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = 'https://github.com/folke/lazy.nvim.git'
local out = vim.fn.system({ 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ 'Failed to clone lazy.nvim:\n', 'ErrorMsg' },
{ out, 'WarningMsg' },
{ '\nPress any key to exit...' },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(lazypath)
require('lazy').setup({
spec = {
{ import = 'plugins' },
-- { import = 'plugins.themes' },
},
install = {
missing = true,
colorscheme = { 'onedark' },
},
checker = {
enabled = true,
notify = false,
},
change_detection = {
enabled = true,
notify = false,
},
ui = {
icons = {
ft = '',
lazy = '󰂠 ',
loaded = '',
not_loaded = '',
},
},
performance = {
rtp = {
disabled_plugins = {
'2html_plugin',
'tohtml',
'getscript',
'getscriptPlugin',
'gzip',
'logipat',
'netrw',
'netrwPlugin',
'netrwSettings',
'netrwFileHandlers',
'matchit',
'tar',
'tarPlugin',
'rrhelper',
'spellfile_plugin',
'vimball',
'vimballPlugin',
'zip',
'zipPlugin',
'tutor',
'rplugin',
'syntax',
'synmenu',
'optwin',
'compiler',
'bugreport',
'ftplugin',
},
},
},
})
+59
View File
@@ -0,0 +1,59 @@
--Remap space as leader key
vim.g.mapleader = ' '
vim.g.maplocalleader = ' '
vim.opt.backup = false -- creates a backup file
vim.opt.clipboard = 'unnamedplus' -- allows neovim to access the system clipboard
vim.opt.cmdheight = 0 -- more space in the neovim command line for displaying messages
vim.opt.completeopt = { 'menuone', 'noselect' } -- mostly just for cmp
vim.opt.conceallevel = 0 -- so that `` is visible in markdown files
-- vim.opt.fileencoding = "utf-8" -- the encoding written to a file
vim.opt.hlsearch = true -- highlight all matches on previous search pattern
vim.opt.ignorecase = true -- ignore case in search patterns
vim.opt.mouse = 'a' -- allow the mouse to be used in neovim
vim.opt.pumheight = 10 -- pop up menu height
vim.opt.pumblend = 10
vim.opt.showmode = false -- we don't need to see things like -- INSERT -- anymore
vim.opt.showtabline = 2 -- always show tabs
vim.opt.smartcase = true -- smart case
vim.opt.smartindent = true -- make indenting smarter again
vim.opt.splitbelow = true -- force all horizontal splits to go below current window
vim.opt.splitright = true -- force all vertical splits to go to the right of current window
vim.opt.swapfile = false -- creates a swapfile
vim.opt.termguicolors = true -- set term gui colors (most terminals support this)
vim.opt.timeoutlen = 1000 -- time to wait for a mapped sequence to complete (in milliseconds)
vim.opt.undofile = true -- enable persistent undo
vim.opt.updatetime = 100 -- faster completion (4000ms default)
vim.opt.writebackup = false -- if a file is being edited by another program (or was written to file while editing with another program), it is not allowed to be edited
vim.opt.expandtab = true -- convert tabs to spaces
vim.opt.shiftwidth = 2 -- the number of spaces inserted for each indentation
vim.opt.tabstop = 2 -- insert 2 spaces for a tab
vim.opt.cursorline = false -- highlight the current line
vim.opt.cursorlineopt = 'number'
vim.opt.number = true -- set numbered lines
vim.opt.laststatus = 0 --disable native statusline
vim.opt.showcmd = false
vim.opt.ruler = false
vim.opt.relativenumber = true -- set relative numbered lines
vim.opt.numberwidth = 4 -- set number column width to 2 {default 4}
vim.opt.signcolumn = 'yes' -- always show the sign column, otherwise it would shift the text each time
vim.opt.wrap = false -- display lines as one long line
vim.opt.scrolloff = 0
vim.opt.sidescrolloff = 8
vim.opt.guifont = 'monospace:h17' -- the font used in graphical neovim applications
vim.opt.title = true
vim.opt.titlelen = 0 -- do not shorten title
vim.opt.inccommand = 'split' -- split below for to show replaces
vim.opt.virtualedit = 'block'
vim.opt.fillchars = vim.opt.fillchars + 'eob: '
vim.opt.fillchars:append({
stl = ' ',
})
vim.opt.shortmess:append('c')
vim.cmd('set whichwrap+=<,>,[,],h,l')
vim.cmd([[set iskeyword+=-]])
vim.g.netrw_banner = 0
vim.g.netrw_mouse = 2
+51 -46
View File
@@ -210,69 +210,74 @@ map('i', 'kj', '<ESC>')
map('i', 'jj', '<ESC>')
-- Terminal Mappings
map("t", "jk", "<C-\\><C-n>")
map("t", "kj", "<C-\\><C-n>")
map("t", "<ESC>", "<C-\\><C-n>")
map('t', 'jk', '<C-\\><C-n>')
map('t', 'kj', '<C-\\><C-n>')
map('t', '<ESC>', '<C-\\><C-n>')
-- Move with shift-arrows
map("n", "<S-Left>", "<C-w><S-h>", {
desc = "Move window to the left"
map('n', '<S-Left>', '<C-w><S-h>', {
desc = 'Move window to the left',
})
map("n", "<S-Down>", "<C-w><S-j>", {
desc = "Move window down"
map('n', '<S-Down>', '<C-w><S-j>', {
desc = 'Move window down',
})
map("n", "<S-Up>", "<C-w><S-k>", {
desc = "Move window up"
map('n', '<S-Up>', '<C-w><S-k>', {
desc = 'Move window up',
})
map("n", "<S-Right>", "<C-w><S-l>", {
desc = "Move window to the right"
map('n', '<S-Right>', '<C-w><S-l>', {
desc = 'Move window to the right',
})
-- Search
map({
"n",
"x"
}, "gw", "*N", {
desc = "Search word under cursor"
})
map(
{
'n',
'x',
},
'gw',
'*N',
{
desc = 'Search word under cursor',
}
)
-- Some cool remaps
map("n", "n", "nzzzv")
map("n", "N", "Nzzzv")
map("n", "J", "mzJ`z")
map("n", "}", "}zzzv")
map("n", "{", "{zzzv")
map("n", "g,", "g,zvzz")
map("n", "g;", "g;zvzz")
map("n", "<C-d>", "<C-d>zz")
map("n", "<C-u>", "<C-u>zz")
map("n", "^", "g^")
map("n", "0", "g0")
map('n', 'n', 'nzzzv')
map('n', 'N', 'Nzzzv')
map('n', 'J', 'mzJ`z')
map('n', '}', '}zzzv')
map('n', '{', '{zzzv')
map('n', 'g,', 'g,zvzz')
map('n', 'g;', 'g;zvzz')
map('n', '<C-d>', '<C-d>zz')
map('n', '<C-u>', '<C-u>zz')
map('n', '^', 'g^')
map('n', '0', 'g0')
-- Do not include white space characters when using $ in visual mode,
map("x", "$", "g_")
map('x', '$', 'g_')
-- Always use very magic mode for searching
map("n", "/", [[/\v]])
map('n', '/', [[/\v]])
-- Add undo break-points
map("i", "?", "?<c-g>u")
map("i", "!", "!<c-g>u")
map("i", ",", ",<c-g>u")
map("i", ".", ".<c-g>u")
map("i", ";", ";<c-g>u")
map('i', '?', '?<c-g>u')
map('i', '!', '!<c-g>u')
map('i', ',', ',<c-g>u')
map('i', '.', '.<c-g>u')
map('i', ';', ';<c-g>u')
-- compromised backward search when comma is being used as localleader
map("n", "<A-,>", ",")
map('n', '<A-,>', ',')
-- Better up/down
map({ "n", "x" }, "j", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
map({ "n", "x" }, "<Down>", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
map({ "n", "x" }, "k", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
map({ "n", "x" }, "<Up>", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
map({ 'n', 'x' }, 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
map({ 'n', 'x' }, '<Down>', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
map({ 'n', 'x' }, 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
map({ 'n', 'x' }, '<Up>', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
-- Move text up and down
map("n", "<A-j>", "<cmd>m .+1<cr>==", { desc = "Move Down" })
map("n", "<A-k>", "<cmd>m .-2<cr>==", { desc = "Move Up" })
map("i", "<A-j>", "<esc><cmd>m .+1<cr>==gi", { desc = "Move Down" })
map("i", "<A-k>", "<esc><cmd>m .-2<cr>==gi", { desc = "Move Up" })
map("v", "<A-j>", ":m '>+1<cr>gv=gv", { desc = "Move Down" })
map("v", "<A-k>", ":m '<-4<cr>gv=gv", { desc = "Move Up" })
map('n', '<A-j>', '<cmd>m .+1<cr>==', { desc = 'Move Down' })
map('n', '<A-k>', '<cmd>m .-2<cr>==', { desc = 'Move Up' })
map('i', '<A-j>', '<esc><cmd>m .+1<cr>==gi', { desc = 'Move Down' })
map('i', '<A-k>', '<esc><cmd>m .-2<cr>==gi', { desc = 'Move Up' })
map('v', '<A-j>', ":m '>+1<cr>gv=gv", { desc = 'Move Down' })
map('v', '<A-k>', ":m '<-4<cr>gv=gv", { desc = 'Move Up' })
-80
View File
@@ -1,80 +0,0 @@
-- File Explorer
vim.keymap.set('n', '<leader>n', ':Neotree filesystem reveal left toggle<CR>')
-- Telescope
vim.keymap.set('n', '<leader>ff', ':Telescope find_files<CR>')
vim.keymap.set('n', '<leader>tc', ':Telescope colorscheme<CR>')
vim.keymap.set('n', '<leader>of', ':Telescope oldfiles<CR>')
vim.keymap.set('n', '<leader>tl', ':Telescope live_grep<CR>')
vim.keymap.set('n', '<leader>km', ':Telescope keymaps<CR>')
vim.keymap.set('n', '<leader>tf', function()
require('telescope.builtin').current_buffer_fuzzy_find(require('telescope.themes').get_dropdown({
previewer = false,
}))
end)
-- formatter
vim.keymap.set('n', '<leader>ft', vim.lsp.buf.format, {})
-- buffer
vim.keymap.set("n", "<tab>", ":BufferLineCycleNext<CR>")
vim.keymap.set("n", "<S-tab>", ":BufferLineCyclePrev<CR>")
vim.keymap.set("n", "<leader>q", ":BufferLinePickClose<CR>")
-- comment
vim.keymap.set('n', '<leader>/', 'gcc', { remap = true })
-- terminal
vim.keymap.set('n', '<leader>tv', ':Vterm<CR>') -- Vertical terminal
vim.keymap.set('n', '<leader>th', ':Sterm<CR>') -- Horizontal terminal
vim.keymap.set('n', '<leader>tf', ':Fterm<CR>') -- Floating terminal
-- File Explorer
vim.keymap.set('n', '<leader>e', function()
require('oil').toggle_float()
end)
-- Primeagen Refactoring
-- vim.keymap.set("x", "<leader>re", ":Refactor extract ")
-- vim.keymap.set("x", "<leader>rf", ":Refactor extract_to_file ")
-- vim.keymap.set("x", "<leader>rv", ":Refactor extract_var ")
-- vim.keymap.set({ "n", "x" }, "<leader>ri", ":Refactor inline_var")
-- vim.keymap.set( "n", "<leader>rI", ":Refactor inline_func")
-- vim.keymap.set("n", "<leader>rb", ":Refactor extract_block")
-- vim.keymap.set("n", "<leader>rbf", ":Refactor extract_block_to_file")
-- Clear search, diff update and redraw
vim.keymap.set({ 'i', 'n' }, '<esc>', '<cmd>noh<cr><esc>', { desc = 'Escape and clear hlsearch' })
-- Navigator
vim.keymap.set('n', '<C-h>', '<cmd>NavigatorLeft<cr>', { desc = 'Move Left' })
vim.keymap.set('n', '<C-j>', '<cmd>NavigatorDown<cr>', { desc = 'Move Down' })
vim.keymap.set('n', '<C-k>', '<cmd>NavigatorUp<cr>', { desc = 'Move Up' })
vim.keymap.set('n', '<C-l>', '<cmd>NavigatorRight<cr>', { desc = 'Move Right' })
vim.keymap.set('n', '<C-\\>', '<cmd>NavigatorPrevious<cr>', { desc = 'Previous Panel' })
-- Move with shift-arrows
vim.keymap.set('n', '<S-Left>', '<C-w><S-h>', {
desc = 'Move window to the left',
})
vim.keymap.set('n', '<S-Down>', '<C-w><S-j>', {
desc = 'Move window down',
})
vim.keymap.set('n', '<S-Up>', '<C-w><S-k>', {
desc = 'Move window up',
})
vim.keymap.set('n', '<S-Right>', '<C-w><S-l>', {
desc = 'Move window to the right',
})
-- Resize window using <ctrl> arrow keys
vim.keymap.set('n', '<C-Up>', '<cmd>resize +2<cr>', { desc = 'Increase Window Height' })
vim.keymap.set('n', '<C-Down>', '<cmd>resize -2<cr>', { desc = 'Decrease Window Height' })
vim.keymap.set('n', '<C-Left>', '<cmd>vertical resize -2<cr>', { desc = 'Decrease Window Width' })
vim.keymap.set('n', '<C-Right>', '<cmd>vertical resize +2<cr>', { desc = 'Increase Window Width' })
-- clear notification
vim.keymap.set('n', '<leader>mu', function()
require('notify').dismiss({ silent = true, pending = true })
end, { desc = 'Dismiss All Notifications' })
-1
View File
@@ -1 +0,0 @@
return {}
+40 -40
View File
@@ -1,11 +1,9 @@
--- @type LazyPluginSpec
return {
"goolord/alpha-nvim",
event = "VimEnter",
dependencies = { "nvim-tree/nvim-web-devicons" },
'goolord/alpha-nvim',
event = 'VimEnter',
opts = function()
local dashboard = require("alpha.themes.dashboard")
require("alpha.term")
local dashboard = require('alpha.themes.dashboard')
require('alpha.term')
local arttoggle = false
local logo = {
@@ -21,23 +19,23 @@ return {
local art = {
-- { name, width, height }
{ "tohru", 62, 17 },
{ 'tohru', 62, 17 },
}
if arttoggle == true then
dashboard.opts.opts.noautocmd = true
dashboard.section.terminal.opts.redraw = true
local path = vim.fn.stdpath("config") .. "/assets/"
local path = vim.fn.stdpath('config') .. '/assets/'
-- local random = math.random(1, #art)
local currentart = art[1]
dashboard.section.terminal.command = "cat " .. path .. currentart[1]
dashboard.section.terminal.command = 'cat ' .. path .. currentart[1]
dashboard.section.terminal.width = currentart[2]
dashboard.section.terminal.height = currentart[3]
dashboard.opts.layout = {
dashboard.section.terminal,
{ type = "padding", val = 2 },
{ type = 'padding', val = 2 },
dashboard.section.buttons,
dashboard.section.footer,
}
@@ -45,55 +43,57 @@ return {
dashboard.section.header.val = logo
end
dashboard.section.buttons.val = {
dashboard.button("ff", "" .. " Find files", ":Telescope find_files <CR>"),
dashboard.button("of", "" .. " Recent files", ":Telescope oldfiles <CR>"),
dashboard.button("l", "󰒲 " .. " Lazy", ":Lazy <CR>"),
dashboard.button("q", "" .. " Quit", ":q <CR>"),
dashboard.button('n', '' .. ' New File', '<cmd>ene<CR>'),
dashboard.button('spc e', '' .. ' File Tree', ':Neotree toggle left<CR>'),
dashboard.button('f', '' .. ' Find files', ':Telescope find_files <CR>'),
dashboard.button('o', '' .. ' Recent files', ':Telescope oldfiles <CR>'),
dashboard.button('l', '󰒲 ' .. ' Lazy', ':Lazy <CR>'),
dashboard.button('q', '' .. ' Quit', ':q <CR>'),
}
for _, button in ipairs(dashboard.section.buttons.val) do
button.opts.hl = "AlphaButtons"
button.opts.hl_shortcut = "AlphaShortcut"
button.opts.hl = 'AlphaButtons'
button.opts.hl_shortcut = 'AlphaShortcut'
end
dashboard.section.header.opts.hl = "Function"
dashboard.section.buttons.opts.hl = "Identifier"
dashboard.section.footer.opts.hl = "Function"
dashboard.section.header.opts.hl = 'Function'
dashboard.section.buttons.opts.hl = 'Identifier'
dashboard.section.footer.opts.hl = 'Function'
dashboard.opts.layout[1].val = 4
return dashboard
end,
config = function(_, dashboard)
if vim.o.filetype == "lazy" then
if vim.o.filetype == 'lazy' then
vim.cmd.close()
vim.api.nvim_create_autocmd("User", {
pattern = "AlphaReady",
vim.api.nvim_create_autocmd('User', {
pattern = 'AlphaReady',
callback = function()
require("lazy").show()
require('lazy').show()
end,
})
end
require("alpha").setup(dashboard.opts)
vim.api.nvim_create_autocmd("User", {
pattern = "LazyVimStarted",
require('alpha').setup(dashboard.opts)
vim.api.nvim_create_autocmd('User', {
pattern = 'LazyVimStarted',
callback = function()
local v = vim.version()
local dev = ""
if v.prerelease == "dev" then
dev = "-dev+" .. v.build
local dev = ''
if v.prerelease == 'dev' then
dev = '-dev+' .. v.build
else
dev = ""
dev = ''
end
local version = v.major .. "." .. v.minor .. "." .. v.patch .. dev
local stats = require("lazy").stats()
local plugins_count = stats.loaded .. "/" .. stats.count
local version = v.major .. '.' .. v.minor .. '.' .. v.patch .. dev
local stats = require('lazy').stats()
local plugins_count = stats.loaded .. '/' .. stats.count
local ms = math.floor(stats.startuptime + 0.5)
local time = vim.fn.strftime("%H:%M:%S")
local date = vim.fn.strftime("%d.%m.%Y")
local line1 = "" .. plugins_count .. " plugins loaded in " .. ms .. "ms"
local line2 = "󰃭 " .. date .. "" .. time
local line3 = "" .. version
local time = vim.fn.strftime('%H:%M:%S')
local date = vim.fn.strftime('%d.%m.%Y')
local line1 = '' .. plugins_count .. ' plugins loaded in ' .. ms .. 'ms'
local line2 = '󰃭 ' .. date .. '' .. time
local line3 = '' .. version
local line1_width = vim.fn.strdisplaywidth(line1)
local line2Padded = string.rep(" ", (line1_width - vim.fn.strdisplaywidth(line2)) / 2) .. line2
local line3Padded = string.rep(" ", (line1_width - vim.fn.strdisplaywidth(line3)) / 2) .. line3
local line2Padded = string.rep(' ', (line1_width - vim.fn.strdisplaywidth(line2)) / 2) .. line2
local line3Padded = string.rep(' ', (line1_width - vim.fn.strdisplaywidth(line3)) / 2) .. line3
dashboard.section.footer.val = {
line1,
+11 -4
View File
@@ -1,6 +1,13 @@
-- autopairing of (){}[] etc
return {
'altermo/ultimate-autopair.nvim',
event = { 'InsertEnter', 'CmdlineEnter' },
branch = 'v0.6',
opts = {},
'windwp/nvim-autopairs',
event = 'InsertEnter',
config = function(_, opts)
require('nvim-autopairs').setup(opts)
-- setup cmp for autopairs
-- If you want insert `(` after select function or method item
local cmp_autopairs = require('nvim-autopairs.completion.cmp')
require('cmp').event:on('confirm_done', cmp_autopairs.on_confirm_done())
end,
}
+9
View File
@@ -0,0 +1,9 @@
return {
'famiu/bufdelete.nvim',
event = { 'BufReadPre', 'BufNewFile' },
init = function()
vim.keymap.set('n', '<leader>q', function()
require('bufdelete').bufdelete(0, false)
end, { silent = true, desc = 'Quit Buffer' })
end,
}
+4
View File
@@ -3,6 +3,10 @@ return {
event = { 'BufReadPost', 'BufAdd', 'BufNewFile' },
version = '*',
dependencies = 'nvim-tree/nvim-web-devicons',
keys = {
{ '<tab>', '<cmd>BufferLineCycleNext<CR>', desc = 'Next Buffer' },
{ '<S-tab>', '<cmd>BufferLineCyclePrev<CR>', desc = 'Previous Buffer' },
},
opts = {
options = {
debug = { logging = true },
+25 -22
View File
@@ -1,27 +1,30 @@
return {
'navarasu/onedark.nvim',
'navarasu/onedark.nvim',
lazy = false,
config = function()
require('onedark').setup({
style = 'deep',
transparent = true,
term_colors = false,
ending_tildes = false,
cmp_itemkind_reverse = false,
-- toggle_style_key = '<leader>ot',
-- toggle_style_list = { 'dark', 'darker', 'cool', 'warm', 'warmer', 'deep', 'light' },
priority = 1000,
config = function()
local onedark = require('onedark')
onedark.setup({
style = 'deep',
transparent = true,
term_colors = false,
ending_tildes = false,
cmp_itemkind_reverse = false,
-- toggle_style_key = '<leader>ot',
-- toggle_style_list = { 'dark', 'darker', 'cool', 'warm', 'warmer', 'deep', 'light' },
-- Options are italic, bold, underline, none and combos 'italic,bold'
code_style = {
comments = 'italic',
keywords = 'none',
functions = 'none',
strings = 'none',
variables = 'none',
},
-- Options are italic, bold, underline, none and combos 'italic,bold'
code_style = {
comments = 'italic',
keywords = 'none',
functions = 'none',
strings = 'none',
variables = 'none',
},
lualine = { transparent = true },
diagnostics = { darker = true, undercurl = true, background = false },
})
end,
lualine = { transparent = true },
diagnostics = { darker = true, undercurl = true, background = false },
})
onedark.load()
end,
}
+10
View File
@@ -0,0 +1,10 @@
return {
{
'echasnovski/mini.comment',
version = false,
event = { 'BufReadPost', 'BufNewFile' },
config = function()
require('mini.comment').setup()
end,
},
}
+72 -87
View File
@@ -1,100 +1,85 @@
-- configure autocomplete
return {
{
'hrsh7th/nvim-cmp',
event = { 'InsertEnter', 'CmdlineEnter' },
dependencies = {
-- autocomplete plugins
'hrsh7th/cmp-buffer',
'hrsh7th/cmp-path',
'hrsh7th/cmp-cmdline',
'hrsh7th/cmp-nvim-lsp',
'hrsh7th/cmp-nvim-lua',
'saadparwaiz1/cmp_luasnip',
-- "hrsh7th/cmp-nvim-lsp-signature-help",
-- "hrsh7th/cmp-calc",
-- vscode like icons to autocomplete list
'onsails/lspkind.nvim',
-- snippet plugin
{ 'L3MON4D3/LuaSnip', event = { 'BufReadPost', 'BufNewFile' } },
{ 'rafamadriz/friendly-snippets', event = { 'BufReadPost', 'BufNewFile' } },
},
{
'hrsh7th/nvim-cmp',
config = function()
local cmp = require('cmp')
local luasnip = require('luasnip')
require('luasnip/loaders/from_vscode').lazy_load()
dependencies = {
'saadparwaiz1/cmp_luasnip',
'hrsh7th/cmp-cmdline',
'L3MON4D3/LuaSnip',
'rafamadriz/friendly-snippets',
'onsails/lspkind.nvim',
},
event = 'InsertEnter',
config = function()
local cmp = require('cmp')
local lspkind = require('lspkind')
cmp.setup({
completion = {
keyword_length = 1,
completeopt = 'menu,menuone',
},
formatting = {
fields = { 'kind', 'abbr', 'menu' },
format = function(entry, vim_item)
local kind = require('lspkind').cmp_format({ mode = 'symbol_text', maxwidth = 50 })(entry, vim_item)
local strings = vim.split(kind.kind, '%s', { trimempty = true })
kind.kind = ' ' .. (strings[1] or '') .. ' '
kind.menu = ' (' .. (strings[2] or '') .. ')'
cmp.setup({
snippet = {
expand = function(args)
require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
require('luasnip.loaders.from_vscode').lazy_load()
end,
},
window = {
completion = cmp.config.window.bordered(),
documentation = cmp.config.window.bordered(),
},
mapping = cmp.mapping.preset.insert({
['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.abort(),
['<CR>'] = cmp.mapping.confirm({
behavior = cmp.ConfirmBehavior.Replace,
select = false,
}),
['<Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif require('luasnip').expandable() then
luasnip.expand()
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
else
fallback()
end
end, { 'i', 's' }),
['<S-Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif require('luasnip').jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { 'i', 's' }),
return kind
end,
},
snippet = { -- configure how nvim-cmp interacts with snippet engine
expand = function(args)
luasnip.lsp_expand(args.body)
end,
},
mapping = {
['<Tab>'] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }),
['<S-Tab>'] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }),
['<C-k>'] = cmp.mapping.scroll_docs(-4),
['<C-j>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(), -- show completion suggestions
['<C-e>'] = cmp.mapping.abort(), -- close completion window
['<Esc>'] = cmp.mapping.close(),
['<CR>'] = cmp.mapping.confirm({
behavior = cmp.ConfirmBehavior.Insert,
select = true,
}),
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
{ name = 'luasnip' }, -- For luasnip users.
{ name = 'codeium' },
}, {
{ name = 'buffer' },
}),
formatting = {
format = lspkind.cmp_format({
mode = 'symbol',
maxwidth = 50,
ellipsis_char = '...',
show_labelDetails = true,
before = function(entry, vim_item)
return vim_item
end,
}),
},
cmp.setup.cmdline(':', {
mapping = cmp.mapping.preset.cmdline(),
sources = {
{ name = 'cmdline' },
},
})
}),
cmp.setup.cmdline({ '/', '?' }, {
mapping = cmp.mapping.preset.cmdline(),
sources = {
{ name = 'buffer' },
},
})
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline(':', {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({
{ name = 'path' },
}, {
{ name = 'cmdline' },
}),
matching = { disallow_symbol_nonprefix_matching = false },
})
end,
},
}),
-- sources for autocompletion
sources = {
{ name = 'nvim_lsp' },
{ name = 'luasnip' }, -- snippets
{ name = 'buffer' }, -- text within current buffer
{ name = 'path' }, -- file system paths
{ name = 'codeium' }, -- AI for autocompletion
-- { name = "nvim_lsp_signature_help" },
-- { name = "calc" }, --for maths calculations
},
})
end,
}
+54
View File
@@ -0,0 +1,54 @@
return {
{
'tpope/vim-dadbod',
dependencies = {
'kristijanhusak/vim-dadbod-ui',
'kristijanhusak/vim-dadbod-completion',
},
keys = {
{ '<leader>du', ':DBUIToggle<cr>', desc = 'Toggle DB UI' },
{ '<leader>db', ':DBUIFindBuffer<cr>', desc = 'DB Find buffer' },
{
'<leader>dr',
':DBUIRenameBuffer<cr>',
desc = 'DB Rename buffer',
},
{ '<leader>dl', ':DBUILastQueryInfo<cr>', desc = 'DB Last query' },
},
config = function()
local function db_completion()
require('plugins.completion.cmp').setup.buffer({
sources = { { name = 'vim-dadbod-completion' } },
})
end
vim.g.db_ui_save_location = vim.fn.stdpath('config') .. require('plenary.path').path.sep .. 'db_ui'
vim.api.nvim_create_autocmd('FileType', {
pattern = {
'sql',
},
command = [[setlocal omnifunc=vim_dadbod_completion#omni]],
})
vim.api.nvim_create_autocmd('FileType', {
pattern = {
'sql',
'mysql',
'plsql',
},
callback = function()
vim.schedule(db_completion)
end,
})
end,
cmd = {
'DBUIToggle',
'DBUI',
'DBUIAddConnection',
'DBUIFindBuffer',
'DBUIRenameBuffer',
'DBUILastQueryInfo',
},
},
}
-32
View File
@@ -1,32 +0,0 @@
return {
'kndndrj/nvim-dbee',
dependencies = {
'MunifTanjim/nui.nvim',
},
build = function()
-- "curl", "wget", "bitsadmin", "go"
require('dbee').install(curl)
end,
cmd = 'DBToggle',
enabled = false,
config = function()
require('dbee').setup({
sources = {
require('dbee.sources').EnvSource:new('NVIM_DB'),
-- require("dbee.sources").MemorySource:new({
-- {
-- name = "dbname",
-- type = "postgres",
-- url = "postgres://pguser:pguser@localhost:5602/dbname?sslmode=disable"
-- },
-- }),
-- require("dbee.sources").FileSource:new(vim.fn.stdpath("cache") .. "/dbee/config.json"),
},
})
vim.api.nvim_create_user_command('DBToggle', function()
require('dbee').toggle()
end, {})
end,
}
-6
View File
@@ -1,6 +0,0 @@
return {
"smjonas/inc-rename.nvim",
config = function()
require("inc_rename").setup()
end,
}
+200 -6
View File
@@ -1,7 +1,201 @@
return {
"nvim-lualine/lualine.nvim",
event = { 'BufReadPre', 'BufNewFile' },
config = function()
require("lualine").setup()
end,
return {
'nvim-lualine/lualine.nvim',
dependencies = {
'nvim-tree/nvim-web-devicons',
},
event = { 'BufReadPost', 'BufAdd', 'BufNewFile' },
config = function()
local lualine = require('lualine')
-- Color table for highlights
local colors = {
bg = 'none',
fg = '#bbc2cf',
yellow = '#ECBE7B',
cyan = '#008080',
darkblue = '#081633',
green = '#98be65',
orange = '#FF8800',
violet = '#a9a1e1',
magenta = '#c678dd',
blue = '#51afef',
red = '#ec5f67',
}
local conditions = {
buffer_not_empty = function()
return vim.fn.empty(vim.fn.expand('%:t')) ~= 1
end,
hide_in_width = function()
return vim.fn.winwidth(0) > 80
end,
check_git_workspace = function()
local filepath = vim.fn.expand('%:p:h')
local gitdir = vim.fn.finddir('.git', filepath .. ';')
return gitdir and #gitdir > 0 and #gitdir < #filepath
end,
}
-- Config
local config = {
options = {
-- Disable sections and component separators
component_separators = '',
section_separators = '',
theme = {
-- We are going to use lualine_c an lualine_x as left and
-- right section. Both are highlighted by c theme . So we
-- are just setting default looks o statusline
normal = { c = { fg = colors.fg, bg = colors.bg } },
inactive = { c = { fg = colors.fg, bg = colors.bg } },
},
},
sections = {
-- these are to remove the defaults
lualine_a = {},
lualine_b = {},
lualine_y = {},
lualine_z = {},
-- These will be filled later
lualine_c = {},
lualine_x = {},
},
inactive_sections = {
-- these are to remove the defaults
lualine_a = {},
lualine_b = {},
lualine_y = {},
lualine_z = {},
lualine_c = {},
lualine_x = {},
},
}
-- Inserts a component in lualine_c at left section
local function ins_left(component)
table.insert(config.sections.lualine_c, component)
end
-- Inserts a component in lualine_x at right section
local function ins_right(component)
table.insert(config.sections.lualine_x, component)
end
ins_left({
function()
return '▊'
end,
color = { fg = colors.blue }, -- Sets highlighting of component
padding = { left = 0, right = 1 }, -- We don't need space before this
})
ins_left({
-- mode component
function()
return ''
end,
color = function()
-- auto change color according to neovims mode
local mode_color = {
n = colors.red,
i = colors.green,
v = colors.blue,
['␖'] = colors.blue,
V = colors.blue,
c = colors.magenta,
no = colors.red,
s = colors.orange,
S = colors.orange,
['␓'] = colors.orange,
ic = colors.yellow,
R = colors.violet,
Rv = colors.violet,
cv = colors.red,
ce = colors.red,
r = colors.cyan,
rm = colors.cyan,
['r?'] = colors.cyan,
['!'] = colors.red,
t = colors.red,
}
return { fg = mode_color[vim.fn.mode()] }
end,
padding = { right = 1 },
})
ins_left({
'filename',
cond = conditions.buffer_not_empty,
color = { fg = colors.magenta, gui = 'bold' },
})
ins_left({
'diagnostics',
sources = { 'nvim_diagnostic' },
symbols = { error = '', warn = '', info = '' },
diagnostics_color = {
error = { fg = colors.red },
warn = { fg = colors.yellow },
info = { fg = colors.cyan },
},
})
-- Insert mid section. You can make any number of sections in neovim :)
-- for lualine it's any number greater then 2
ins_left({
function()
return '%='
end,
})
ins_left({
-- Lsp server name .
function()
local msg = 'No Active Lsp'
local buf_ft = vim.api.nvim_buf_get_option(0, 'filetype')
local clients = vim.lsp.get_clients()
if next(clients) == nil then
return msg
end
for _, client in ipairs(clients) do
local filetypes = client.config.filetypes
if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then
return client.name
end
end
return msg
end,
icon = ' LSP:',
color = { fg = '#ffffff', gui = 'bold' },
})
ins_right({
'diff',
-- Is it me or the symbol for modified us really weird
symbols = { added = '', modified = '', removed = '' },
diff_color = {
added = { fg = colors.green },
modified = { fg = colors.orange },
removed = { fg = colors.red },
},
cond = conditions.hide_in_width,
})
ins_right({
'branch',
icon = '',
color = { fg = colors.violet, gui = 'bold' },
})
ins_right({
function()
return '▊'
end,
color = { fg = colors.blue },
padding = { left = 1 },
})
-- Now don't forget to initialize lualine
lualine.setup(config)
end,
}
+1
View File
@@ -44,6 +44,7 @@ return {
'biome', -- js formatter
'stylua', -- lua formatter
'black', -- python formatter
'isort', -- python formatter
'clang-format', -- c/c++ formatter
'luacheck',
'pylint',
+7
View File
@@ -1,5 +1,12 @@
return {
'numToStr/Navigator.nvim',
keys = {
{ '<C-h>', '<cmd>NavigatorLeft<cr>' },
{ '<C-j>', '<cmd>NavigatorDown<cr>' },
{ '<C-k>', '<cmd>NavigatorUp<cr>' },
{ '<C-l>', '<cmd>NavigatorRight<cr>' },
{ '<C-\\>', '<cmd>NavigatorPrevious<cr>' },
},
config = function()
require('Navigator').setup()
end,
+11 -7
View File
@@ -1,9 +1,13 @@
return {
'nvim-neo-tree/neo-tree.nvim',
branch = 'v3.x',
dependencies = {
'nvim-lua/plenary.nvim',
'nvim-tree/nvim-web-devicons',
'MunifTanjim/nui.nvim',
},
'nvim-neo-tree/neo-tree.nvim',
branch = 'v3.x',
dependencies = {
'nvim-lua/plenary.nvim',
'nvim-tree/nvim-web-devicons',
'MunifTanjim/nui.nvim',
},
keys = {
-- { '<leader>ee', ':Neotree toggle float<CR>', silent = true, desc = 'Float File Explorer' },
{ '<leader>e', ':Neotree toggle left<CR>', silent = true, desc = 'Left File Explorer' },
},
}
+7 -7
View File
@@ -1,9 +1,9 @@
return {
"2kabhishek/nerdy.nvim",
dependencies = {
"stevearc/dressing.nvim",
"nvim-telescope/telescope.nvim",
},
cmd = "Nerdy",
vim.keymap.set("n", "<Leader>si", "<cmd>Nerdy<cr>", opts), --> nerd icons
'2kabhishek/nerdy.nvim',
dependencies = {
'stevearc/dressing.nvim',
'nvim-telescope/telescope.nvim',
},
cmd = 'Nerdy',
vim.keymap.set('n', '<Leader>si', '<cmd>Nerdy<cr>'), --> nerd icons
}
+32
View File
@@ -0,0 +1,32 @@
return {
'folke/noice.nvim',
event = 'VeryLazy',
enabled = false,
dependencies = {
'MunifTanjim/nui.nvim',
'rcarriga/nvim-notify',
},
config = function()
require('noice').setup({
cmdline = {
format = {
cmdline = { pattern = '^:', icon = '', lang = 'vim' },
filter = { pattern = '^:%s*!', icon = '', lang = 'bash' },
lua = { pattern = { '^:%s*lua%s+', '^:%s*lua%s*=%s*', '^:%s*=%s*' }, icon = '', lang = 'lua' },
help = { pattern = '^:%s*he?l?p?%s+', icon = '' },
search_down = { kind = 'search', pattern = '^/', icon = '', lang = 'regex' },
search_up = { kind = 'search', pattern = '^%?', icon = '', lang = 'regex' },
input = { view = 'cmdline_input', icon = '' },
},
},
lsp = {
signature = {
enabled = false,
},
},
presets = {
command_palette = true,
},
})
end,
}
+20 -23
View File
@@ -1,25 +1,22 @@
return {
'rcarriga/nvim-notify',
config = function()
vim.notify = require('notify')
require('notify')('Welcome Back!')
require('notify').setup({
background_colour = 'Normal',
fps = 30,
icons = {
DEBUG = '',
ERROR = '',
INFO = '',
TRACE = '✎',
WARN = '',
},
level = 2,
minimum_width = 40,
maximum_width = 40,
render = 'wrapped-compact',
stages = 'slide',
timeout = 2000,
})
end,
'rcarriga/nvim-notify',
event = 'VeryLazy',
keys = {
{
'<leader>un',
function()
require('notify').dismiss({ silent = true, pending = true })
end,
desc = 'Dismiss All Notifications',
},
},
opts = {
level = 2,
minimum_width = 50,
stages = 'fade',
timeout = 3000,
top_down = true,
render = 'compact',
background_colour = '#000000',
},
}
-7
View File
@@ -1,7 +0,0 @@
return {
"kylechui/nvim-surround",
event = { 'BufReadPre', 'BufNewFile' },
config = function()
require("nvim-surround").setup()
end,
}
+87 -32
View File
@@ -1,35 +1,90 @@
return {
'nvim-treesitter/nvim-treesitter',
build = ':TSUpdate',
dependencies = {
'windwp/nvim-ts-autotag',
-- Syntax highlightings
{
'nvim-treesitter/nvim-treesitter',
build = ':TSUpdate',
event = { 'BufReadPost', 'BufNewFile' },
cmd = { 'TSInstall', 'TSBufEnable', 'TSBufDisable', 'TSModuleInfo' },
dependencies = {
'nvim-treesitter/nvim-treesitter-textobjects',
'windwp/nvim-ts-autotag',
},
config = function()
require('nvim-ts-autotag').setup()
require('nvim-treesitter.configs').setup({
highlight = {
enable = true,
},
indent = {
enable = true,
},
ensure_installed = {
'vim',
'vimdoc',
'markdown',
'markdown_inline',
'bash',
'c',
'cpp',
'java',
'javascript',
'typescript',
'tsx',
'json',
'toml',
'html',
'css',
'scss',
'lua',
'python',
},
auto_install = true,
playground = {
enable = true,
disable = {},
},
textobjects = {
select = {
enable = true,
-- Automatically jump forward to textobj, similar to targets.vim
lookahead = true,
keymaps = {
['af'] = { query = '@function.outer', desc = 'Select outer part of a function region' },
['if'] = { query = '@function.inner', desc = 'Select inner part of a function region' },
['ac'] = { query = '@class.outer', desc = 'Select outer part of a class region' },
['ic'] = { query = '@class.inner', desc = 'Select inner part of a class region' },
},
},
swap = {
enable = true,
swap_next = {
['<leader>xp'] = { query = '@parameter.inner', desc = 'Swap parameter with the next one' },
},
swap_previous = {
['<leader>xP'] = {
query = '@parameter.inner',
desc = 'Swap parameter with the previous one',
},
},
},
},
})
end,
},
{
'nvim-treesitter/nvim-treesitter-context',
dependencies = { 'nvim-treesitter/nvim-treesitter' },
config = function()
require('treesitter-context').setup({ enable = false })
end,
cmd = 'TSContextToggle',
init = function()
vim.keymap.set('n', '[c', function()
require('treesitter-context').go_to_context()
end, { silent = true, desc = 'Go to TS context' })
vim.keymap.set('n', '<leader>tc', function()
require('treesitter-context').toggle()
end, { silent = true, desc = 'Toggle TS Context' })
end,
},
event = { 'BufReadPre', 'BufNewFile' },
config = function()
local configs = require('nvim-treesitter.configs')
configs.setup({
ensure_installed = {
'c',
'lua',
'vim',
'vimdoc',
'python',
'cpp',
'html',
'css',
'javascript',
'typescript',
'json',
'php',
'markdown',
'markdown_inline',
'bash',
'java',
},
sync_install = true,
highlight = { enable = true },
indent = { enable = true },
})
end,
}
-40
View File
@@ -1,40 +0,0 @@
vim.api.nvim_create_autocmd('FileType', {
pattern = 'oil',
callback = function()
vim.opt_local.colorcolumn = ''
end,
})
return {
{
'stevearc/oil.nvim',
opts = {},
-- Optional dependencies
dependencies = { 'nvim-tree/nvim-web-devicons' },
config = function()
require('oil').setup({
use_default_keymaps = false,
keymaps = {
['g?'] = 'actions.show_help',
['<CR>'] = 'actions.select',
['<C-\\>'] = 'actions.select_split',
['<C-enter>'] = 'actions.select_vsplit', -- this is used to navigate left
['<C-t>'] = 'actions.select_tab',
['<C-p>'] = 'actions.preview',
['<C-c>'] = 'actions.close',
['<C-r>'] = 'actions.refresh',
['-'] = 'actions.parent',
['_'] = 'actions.open_cwd',
['`'] = 'actions.cd',
['~'] = 'actions.tcd',
['gs'] = 'actions.change_sort',
['gx'] = 'actions.open_external',
['g.'] = 'actions.toggle_hidden',
},
view_options = {
show_hidden = false,
},
})
end,
},
}
+28
View File
@@ -0,0 +1,28 @@
return {
'folke/persistence.nvim',
event = 'BufReadPre',
opts = { options = vim.opt.sessionoptions:get() },
keys = {
{
'<leader>ss',
function()
require('persistence').load()
end,
desc = 'Restore Session',
},
{
'<leader>sl',
function()
require('persistence').load({ last = true })
end,
desc = 'Restore Last Session',
},
{
'<leader>sd',
function()
require('persistence').stop()
end,
desc = "Don't Save Current Session",
},
},
}
-32
View File
@@ -1,32 +0,0 @@
return {
'ThePrimeagen/refactoring.nvim',
dependencies = {
'nvim-lua/plenary.nvim',
'nvim-treesitter/nvim-treesitter',
},
config = function()
require('refactoring').setup({
prompt_func_return_type = {
go = false,
java = false,
cpp = false,
c = false,
h = false,
hpp = false,
cxx = false,
},
prompt_func_param_type = {
go = false,
java = false,
cpp = false,
c = false,
h = false,
hpp = false,
cxx = false,
},
printf_statements = {},
print_var_statements = {},
})
end,
}
+15
View File
@@ -0,0 +1,15 @@
return {
'echasnovski/mini.surround',
event = { 'BufReadPre', 'BufNewFile', 'BufWritePre' },
opts = {
mappings = {
add = 'gsa', -- Add surrounding in Normal and Visual modes
delete = 'gsd', -- Delete surrounding
find = 'gsf', -- Find surrounding (to the right)
find_left = 'gsF', -- Find surrounding (to the left)
highlight = 'gsh', -- Highlight surrounding
replace = 'gsr', -- Replace surrounding
update_n_lines = 'gsn', -- Update `n_lines`
},
},
}
+125 -25
View File
@@ -1,30 +1,130 @@
return {
'nvim-telescope/telescope.nvim',
tag = '0.1.8',
dependencies = {
'nvim-lua/plenary.nvim',
'nvim-telescope/telescope-fzf-native.nvim',
build = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build',
cond = vim.fn.executable('cmake') == 1,
},
config = function()
require('telescope').setup({
pickers = {
colorscheme = {
enable_preview = true,
},
{
'nvim-telescope/telescope.nvim',
cmd = 'Telescope',
version = false,
dependencies = {
{ 'nvim-lua/plenary.nvim' },
{ 'nvim-tree/nvim-web-devicons' },
{ 'nvim-telescope/telescope-fzf-native.nvim', build = 'zig' },
{ 'nvim-telescope/telescope-ui-select.nvim' },
},
keys = {
{
'<leader>ff',
function()
require('telescope.builtin').find_files()
end,
desc = 'Find File (CWD)',
},
defaults = {
layout_config = {
horizontal = {
preview_cutoff = 0,
{
'<leader>fh',
function()
require('telescope.builtin').help_tags()
end,
desc = 'Find Help',
},
{
'<leader>fH',
function()
require('telescope.builtin').highlights()
end,
desc = 'Find highlight groups',
},
{
'<leader>fM',
function()
require('telescope.builtin').man_pages()
end,
desc = 'Map Pages',
},
{
'<leader>of',
function()
require('telescope.builtin').oldfiles()
end,
desc = 'Open Recent File',
},
{
'<leader>tl',
function()
require('telescope.builtin').live_grep()
end,
desc = 'Live Grep',
},
{
'<leader>tw',
function()
require('telescope.builtin').grep_string()
end,
desc = 'Grep String',
},
{
'<leader>km',
function()
require('telescope.builtin').keymaps()
end,
desc = 'Keymaps',
},
{
'<leader>tC',
function()
require('telescope.builtin').commands()
end,
desc = 'Commands',
},
{
'<leader><leader>',
function()
require('telescope.builtin').buffers()
end,
desc = 'Buffers',
},
{
'<leader>td',
function()
require('telescope.builtin').diagnostics()
end,
desc = 'diagnostics',
},
{
'<leader>cc',
function()
require('telescope.builtin').colorscheme({ enable_preview = true })
end,
desc = 'Colorscheme with preview',
},
},
config = function()
local telescope = require('telescope')
telescope.setup({
file_ignore_patterns = { '%.git/.' },
defaults = {
preview = {
treesitter = false,
},
},
},
})
-- Enable telescope fzf native, if installed
pcall(require('telescope').load_extension, 'fzf')
end,
-- picker = {
-- colorscheme = {
-- enable_preview = true,
-- },
-- },
extensions = {
fzf = {
fuzzy = true, -- false will only do exact matching
override_generic_sorter = true, -- override the generic sorter
override_file_sorter = true, -- override the file sorter
case_mode = 'smart_case', -- or "ignore_case" or "respect_case"
},
},
borderchars = {
prompt = { '─', '│', '─', '│', '╭', '╮', '╯', '╰' },
results = { ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' },
},
})
telescope.load_extension('ui-select')
-- telescope.load_extension("refactoring")
telescope.load_extension('notify')
end,
},
}
+4
View File
@@ -1,4 +1,8 @@
return {
'2kabhishek/termim.nvim',
cmd = { 'Fterm', 'FTerm', 'Sterm', 'STerm', 'Vterm', 'VTerm' },
keys = {
{ 'tv', '<cmd>Vterm<CR>' }, -- Vertical terminal
{ 'th', '<cmd>Sterm<CR>' }, -- Horizontal terminal
},
}
-3
View File
@@ -6,9 +6,6 @@ return {
'/',
'?',
},
dependencies = {
'catppuccin/nvim',
},
config = function()
local wilder = require('wilder')
-62
View File
@@ -1,62 +0,0 @@
-- This file is automatically loaded by plugins.core
vim.g.mapleader = ' '
vim.g.maplocalleader = ' '
local opt = vim.opt
opt.number = true
opt.relativenumber = true
opt.expandtab = false
opt.tabstop = 6
opt.shiftwidth = 6
opt.wrap = false
-- netrw file explorer settings
vim.g.netrw_winsize = 20
vim.g.netrw_banner = 0
vim.g.netrw_liststyle = 1
opt.cursorline = true -- Enable highlighting of the current line
opt.expandtab = true -- Use spaces instead of tabs
opt.breakindent = true
opt.clipboard = 'unnamedplus' -- allows neovim to access the system clipboard
opt.cmdheight = 1 -- more space in the neovim command line for displaying messages
opt.conceallevel = 0 -- so that `` is visible in markdown files
opt.hlsearch = true -- highlight all matches on previous search pattern
opt.ignorecase = true -- ignore case in search patterns
opt.inccommand = 'split' -- preview incremental substitute
opt.mouse = 'a' -- allow the mouse to be used in neovim
opt.numberwidth = 4 -- set number column width to 2 {default 4}
opt.scrolloff = 10
opt.shiftround = true -- round indent
opt.shiftwidth = 4 -- the number of spaces inserted for each indentation
opt.showcmd = false
opt.showmode = false -- we don't need to see things like -- INSERT -- anymore
opt.showtabline = 0 -- always show tabs
opt.signcolumn = 'yes' -- always show the sign column, otherwise it would shift the text each timeout
opt.smartcase = true -- smart case
opt.smartindent = true -- make indenting smarter again
opt.smarttab = true
opt.splitbelow = true -- force all horizontal splits to go below current window
opt.splitright = true -- force all vertical splits to go right of the current window
opt.swapfile = false -- creastes a swapfile
opt.tabstop = 4 -- insert 2 spaces for a tab
opt.undofile = true -- enable persistent undofile
opt.undolevels = 10000
opt.updatetime = 50 -- faster completion (4000ms default)
opt.writebackup = false -- donot edit backups
opt.backup = false -- creates a backup file
opt.autowrite = true
opt.autoindent = true
opt.ai = true
opt.termguicolors =true
-- Fix markdown indentation settings
vim.g.markdown_recommended_style = 0
vim.opt.path:append({ '**' })
vim.opt.shortmess:append({ W = true, I = true, c = true })
-- hides `~` at the end of buffer
vim.cmd([[set fillchars+=eob:\ ]])
vim.cmd([[autocmd FileType * set formatoptions-=ro]])