diff --git a/init.lua b/init.lua index 7ca9ad2..8f59cb0 100644 --- a/init.lua +++ b/init.lua @@ -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') diff --git a/lazy-lock.json b/lazy-lock.json index 26da048..fc3134e 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -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" } } diff --git a/lua/config/autocmd.lua b/lua/config/autocmd.lua new file mode 100644 index 0000000..d968dae --- /dev/null +++ b/lua/config/autocmd.lua @@ -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 q :quit]] }) + +-- 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 setlocal spelllang=en,de]] } + { + pattern = { '*.txt', '*.md', '*.tex' }, + callback = function() + vim.opt.spell = true + vim.opt.spelllang = 'en,de' + end, + } +) + +-- close some filetypes with +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', 'close', { buffer = event.buf, silent = true }) + end, +}) + +-- resize neovim split when terminal is resized +vim.api.nvim_command('autocmd VimResized * wincmd =') diff --git a/lua/config/icons.lua b/lua/config/icons.lua new file mode 100644 index 0000000..406c11c --- /dev/null +++ b/lua/config/icons.lua @@ -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 = '', + }, +} diff --git a/lua/config/keymaps.lua b/lua/config/keymaps.lua new file mode 100644 index 0000000..8975fd4 --- /dev/null +++ b/lua/config/keymaps.lua @@ -0,0 +1,84 @@ +local opts = { noremap = true, silent = true } + +-- Increment / Decrement +vim.keymap.set('n', '+', '') +vim.keymap.set('n', '-', '') + +-- Select all +vim.keymap.set('n', '', 'ggG') + +-- Replace currently selected text with default register without yanking it +vim.keymap.set('x', 'p', '"_dP') + +-- Delete without yanking +vim.keymap.set('n', 'd', '"_d') +vim.keymap.set('v', 'd', '"_d') + +-- Clear highlights on search when pressing in normal mode +vim.keymap.set('n', '', 'nohlsearch') + +-- Resize window using arrow keys +vim.keymap.set('n', '', 'resize +2', { desc = 'Increase Window Height' }) +vim.keymap.set('n', '', 'resize -2', { desc = 'Decrease Window Height' }) +vim.keymap.set('n', '', 'vertical resize -2', { desc = 'Decrease Window Width' }) +vim.keymap.set('n', '', 'vertical resize +2', { desc = 'Increase Window Width' }) + +-- Visual vim.keymap.sets +vim.keymap.set('v', 'r', '"hy:%s/h//g') -- Replace all instances of highlighted words +vim.keymap.set('v', '', ':sort') -- Sort highlighted text in visual mode with Control+S +vim.keymap.set('v', 'K', ":m '>-2gv=gv") -- Move current line up +vim.keymap.set('v', 'J', ":m '>+1gv=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', 'vp', '`[v`]', { desc = 'Select pasted text' }) +vim.keymap.set('n', '', 'zz', { desc = 'Scroll down' }) +vim.keymap.set('n', '', 'zz', { desc = 'Scroll up' }) + +vim.keymap.set({ 'n', 'v' }, 'y', '"+y', { desc = 'Copy to system clipboard' }) +vim.keymap.set({ 'n', 'v' }, 'p', '"+p', { desc = 'Paste from system clipboard' }) + +vim.keymap.set({ 'i' }, '', '', { desc = 'Move cursor to right' }) +vim.keymap.set({ 'i' }, '', '', { desc = 'Move cursor to right' }) + +-- Better window management +vim.keymap.set('n', 'hs', ':split', opts) +vim.keymap.set('n', 'vs', ':vsplit', opts) +vim.keymap.set('n', '', 'h', { desc = 'Move to left split' }) +vim.keymap.set('n', '', 'j', { desc = 'Move to below split' }) +vim.keymap.set('n', '', 'k', { desc = 'Move to above split' }) +vim.keymap.set('n', '', 'l', { desc = 'Move to right split' }) +vim.keymap.set('n', '', 'resize -2', { desc = 'Resize split up' }) +vim.keymap.set('n', '', 'resize +2', { desc = 'Resize split down' }) +vim.keymap.set('n', '', 'vertical resize -2', { desc = 'Resize split left' }) +vim.keymap.set('n', '', 'vertical resize +2', { desc = 'Resize split right' }) + +-- Stay in indent mode +vim.keymap.set('v', '<', '', '>gv', { desc = '(V) Indent to right' }) + +-- insert semicolon in the end +-- vim.keymap.set('i', '', 'miA;`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', '') +vim.keymap.set('i', 'kj', '') +vim.keymap.set('i', 'jj', '') + +-- Terminal Mappings +vim.keymap.set('t', 'jk', '') +vim.keymap.set('t', 'kj', '') +vim.keymap.set('t', '', '') + +-- save file +vim.keymap.set({ 'i', 'v', 'n', 's' }, '', 'wa', { desc = 'Save all file' }) diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua new file mode 100644 index 0000000..480406d --- /dev/null +++ b/lua/config/lazy.lua @@ -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', + }, + }, + }, +}) diff --git a/lua/config/options.lua b/lua/config/options.lua new file mode 100644 index 0000000..90bed82 --- /dev/null +++ b/lua/config/options.lua @@ -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 diff --git a/lua/remaps.lua b/lua/config/remaps.lua similarity index 70% rename from lua/remaps.lua rename to lua/config/remaps.lua index 68300da..c1ef226 100644 --- a/lua/remaps.lua +++ b/lua/config/remaps.lua @@ -210,69 +210,74 @@ map('i', 'kj', '') map('i', 'jj', '') -- Terminal Mappings -map("t", "jk", "") -map("t", "kj", "") -map("t", "", "") +map('t', 'jk', '') +map('t', 'kj', '') +map('t', '', '') -- Move with shift-arrows -map("n", "", "", { - desc = "Move window to the left" +map('n', '', '', { + desc = 'Move window to the left', }) -map("n", "", "", { - desc = "Move window down" +map('n', '', '', { + desc = 'Move window down', }) -map("n", "", "", { - desc = "Move window up" +map('n', '', '', { + desc = 'Move window up', }) -map("n", "", "", { - desc = "Move window to the right" +map('n', '', '', { + 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", "", "zz") -map("n", "", "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', '', 'zz') +map('n', '', '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", "?", "?u") -map("i", "!", "!u") -map("i", ",", ",u") -map("i", ".", ".u") -map("i", ";", ";u") +map('i', '?', '?u') +map('i', '!', '!u') +map('i', ',', ',u') +map('i', '.', '.u') +map('i', ';', ';u') -- compromised backward search when comma is being used as localleader -map("n", "", ",") +map('n', '', ',') -- Better up/down -map({ "n", "x" }, "j", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true }) -map({ "n", "x" }, "", "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" }, "", "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' }, '', "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' }, '', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true }) -- Move text up and down -map("n", "", "m .+1==", { desc = "Move Down" }) -map("n", "", "m .-2==", { desc = "Move Up" }) -map("i", "", "m .+1==gi", { desc = "Move Down" }) -map("i", "", "m .-2==gi", { desc = "Move Up" }) -map("v", "", ":m '>+1gv=gv", { desc = "Move Down" }) -map("v", "", ":m '<-4gv=gv", { desc = "Move Up" }) +map('n', '', 'm .+1==', { desc = 'Move Down' }) +map('n', '', 'm .-2==', { desc = 'Move Up' }) +map('i', '', 'm .+1==gi', { desc = 'Move Down' }) +map('i', '', 'm .-2==gi', { desc = 'Move Up' }) +map('v', '', ":m '>+1gv=gv", { desc = 'Move Down' }) +map('v', '', ":m '<-4gv=gv", { desc = 'Move Up' }) diff --git a/lua/keymaps.lua b/lua/keymaps.lua deleted file mode 100644 index f3eb5ba..0000000 --- a/lua/keymaps.lua +++ /dev/null @@ -1,80 +0,0 @@ --- File Explorer -vim.keymap.set('n', 'n', ':Neotree filesystem reveal left toggle') - --- Telescope -vim.keymap.set('n', 'ff', ':Telescope find_files') -vim.keymap.set('n', 'tc', ':Telescope colorscheme') -vim.keymap.set('n', 'of', ':Telescope oldfiles') -vim.keymap.set('n', 'tl', ':Telescope live_grep') -vim.keymap.set('n', 'km', ':Telescope keymaps') -vim.keymap.set('n', 'tf', function() - require('telescope.builtin').current_buffer_fuzzy_find(require('telescope.themes').get_dropdown({ - previewer = false, - })) -end) - --- formatter -vim.keymap.set('n', 'ft', vim.lsp.buf.format, {}) - --- buffer -vim.keymap.set("n", "", ":BufferLineCycleNext") -vim.keymap.set("n", "", ":BufferLineCyclePrev") -vim.keymap.set("n", "q", ":BufferLinePickClose") - --- comment -vim.keymap.set('n', '/', 'gcc', { remap = true }) - --- terminal -vim.keymap.set('n', 'tv', ':Vterm') -- Vertical terminal -vim.keymap.set('n', 'th', ':Sterm') -- Horizontal terminal -vim.keymap.set('n', 'tf', ':Fterm') -- Floating terminal - --- File Explorer -vim.keymap.set('n', 'e', function() - require('oil').toggle_float() -end) - --- Primeagen Refactoring --- vim.keymap.set("x", "re", ":Refactor extract ") --- vim.keymap.set("x", "rf", ":Refactor extract_to_file ") --- vim.keymap.set("x", "rv", ":Refactor extract_var ") --- vim.keymap.set({ "n", "x" }, "ri", ":Refactor inline_var") --- vim.keymap.set( "n", "rI", ":Refactor inline_func") --- vim.keymap.set("n", "rb", ":Refactor extract_block") --- vim.keymap.set("n", "rbf", ":Refactor extract_block_to_file") - - --- Clear search, diff update and redraw -vim.keymap.set({ 'i', 'n' }, '', 'noh', { desc = 'Escape and clear hlsearch' }) - --- Navigator -vim.keymap.set('n', '', 'NavigatorLeft', { desc = 'Move Left' }) -vim.keymap.set('n', '', 'NavigatorDown', { desc = 'Move Down' }) -vim.keymap.set('n', '', 'NavigatorUp', { desc = 'Move Up' }) -vim.keymap.set('n', '', 'NavigatorRight', { desc = 'Move Right' }) -vim.keymap.set('n', '', 'NavigatorPrevious', { desc = 'Previous Panel' }) - --- Move with shift-arrows -vim.keymap.set('n', '', '', { - desc = 'Move window to the left', -}) -vim.keymap.set('n', '', '', { - desc = 'Move window down', -}) -vim.keymap.set('n', '', '', { - desc = 'Move window up', -}) -vim.keymap.set('n', '', '', { - desc = 'Move window to the right', -}) - --- Resize window using arrow keys -vim.keymap.set('n', '', 'resize +2', { desc = 'Increase Window Height' }) -vim.keymap.set('n', '', 'resize -2', { desc = 'Decrease Window Height' }) -vim.keymap.set('n', '', 'vertical resize -2', { desc = 'Decrease Window Width' }) -vim.keymap.set('n', '', 'vertical resize +2', { desc = 'Increase Window Width' }) - --- clear notification -vim.keymap.set('n', 'mu', function() - require('notify').dismiss({ silent = true, pending = true }) -end, { desc = 'Dismiss All Notifications' }) diff --git a/lua/plugins.lua b/lua/plugins.lua deleted file mode 100644 index a564707..0000000 --- a/lua/plugins.lua +++ /dev/null @@ -1 +0,0 @@ -return {} diff --git a/lua/plugins/alpha.lua b/lua/plugins/alpha.lua index 8e3e534..10261b6 100644 --- a/lua/plugins/alpha.lua +++ b/lua/plugins/alpha.lua @@ -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 "), - dashboard.button("of", " " .. " Recent files", ":Telescope oldfiles "), - dashboard.button("l", "󰒲 " .. " Lazy", ":Lazy "), - dashboard.button("q", " " .. " Quit", ":q "), + dashboard.button('n', ' ' .. ' New File', 'ene'), + dashboard.button('spc e', ' ' .. ' File Tree', ':Neotree toggle left'), + dashboard.button('f', ' ' .. ' Find files', ':Telescope find_files '), + dashboard.button('o', ' ' .. ' Recent files', ':Telescope oldfiles '), + dashboard.button('l', '󰒲 ' .. ' Lazy', ':Lazy '), + dashboard.button('q', ' ' .. ' Quit', ':q '), } 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, diff --git a/lua/plugins/auto-pairs.lua b/lua/plugins/auto-pairs.lua index 4a30ea8..6f12acf 100644 --- a/lua/plugins/auto-pairs.lua +++ b/lua/plugins/auto-pairs.lua @@ -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, } diff --git a/lua/plugins/buff_delete.lua b/lua/plugins/buff_delete.lua new file mode 100644 index 0000000..cdcd544 --- /dev/null +++ b/lua/plugins/buff_delete.lua @@ -0,0 +1,9 @@ +return { + 'famiu/bufdelete.nvim', + event = { 'BufReadPre', 'BufNewFile' }, + init = function() + vim.keymap.set('n', 'q', function() + require('bufdelete').bufdelete(0, false) + end, { silent = true, desc = 'Quit Buffer' }) + end, +} diff --git a/lua/plugins/bufferline.lua b/lua/plugins/bufferline.lua index 39568fd..1d182c5 100644 --- a/lua/plugins/bufferline.lua +++ b/lua/plugins/bufferline.lua @@ -3,6 +3,10 @@ return { event = { 'BufReadPost', 'BufAdd', 'BufNewFile' }, version = '*', dependencies = 'nvim-tree/nvim-web-devicons', + keys = { + { '', 'BufferLineCycleNext', desc = 'Next Buffer' }, + { '', 'BufferLineCyclePrev', desc = 'Previous Buffer' }, + }, opts = { options = { debug = { logging = true }, diff --git a/lua/plugins/colorschemes.lua b/lua/plugins/colorschemes.lua index 93ea128..493c372 100644 --- a/lua/plugins/colorschemes.lua +++ b/lua/plugins/colorschemes.lua @@ -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 = '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 = '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, } diff --git a/lua/plugins/comment.lua b/lua/plugins/comment.lua new file mode 100644 index 0000000..ab11a7d --- /dev/null +++ b/lua/plugins/comment.lua @@ -0,0 +1,10 @@ +return { + { + 'echasnovski/mini.comment', + version = false, + event = { 'BufReadPost', 'BufNewFile' }, + config = function() + require('mini.comment').setup() + end, + }, +} diff --git a/lua/plugins/completions.lua b/lua/plugins/completions.lua index e1f1a4e..af3cb2c 100644 --- a/lua/plugins/completions.lua +++ b/lua/plugins/completions.lua @@ -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({ - [''] = cmp.mapping.scroll_docs(-4), - [''] = cmp.mapping.scroll_docs(4), - [''] = cmp.mapping.complete(), - [''] = cmp.mapping.abort(), - [''] = cmp.mapping.confirm({ - behavior = cmp.ConfirmBehavior.Replace, - select = false, - }), - [''] = 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' }), - [''] = 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 = { + [''] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }), + [''] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }), + [''] = cmp.mapping.scroll_docs(-4), + [''] = cmp.mapping.scroll_docs(4), + [''] = cmp.mapping.complete(), -- show completion suggestions + [''] = cmp.mapping.abort(), -- close completion window + [''] = cmp.mapping.close(), + [''] = 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, } diff --git a/lua/plugins/database.lua b/lua/plugins/database.lua new file mode 100644 index 0000000..6eda8a5 --- /dev/null +++ b/lua/plugins/database.lua @@ -0,0 +1,54 @@ +return { + { + 'tpope/vim-dadbod', + dependencies = { + 'kristijanhusak/vim-dadbod-ui', + 'kristijanhusak/vim-dadbod-completion', + }, + keys = { + { 'du', ':DBUIToggle', desc = 'Toggle DB UI' }, + { 'db', ':DBUIFindBuffer', desc = 'DB Find buffer' }, + { + 'dr', + ':DBUIRenameBuffer', + desc = 'DB Rename buffer', + }, + { 'dl', ':DBUILastQueryInfo', 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', + }, + }, +} diff --git a/lua/plugins/dbee.lua b/lua/plugins/dbee.lua deleted file mode 100644 index ebda5f1..0000000 --- a/lua/plugins/dbee.lua +++ /dev/null @@ -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, -} diff --git a/lua/plugins/inc-rename.lua b/lua/plugins/inc-rename.lua deleted file mode 100644 index 49c2ac0..0000000 --- a/lua/plugins/inc-rename.lua +++ /dev/null @@ -1,6 +0,0 @@ -return { - "smjonas/inc-rename.nvim", - config = function() - require("inc_rename").setup() - end, -} diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua index 7e5e51b..6236d6e 100644 --- a/lua/plugins/lualine.lua +++ b/lua/plugins/lualine.lua @@ -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, } diff --git a/lua/plugins/mason.lua b/lua/plugins/mason.lua index aae1854..2e6f906 100644 --- a/lua/plugins/mason.lua +++ b/lua/plugins/mason.lua @@ -44,6 +44,7 @@ return { 'biome', -- js formatter 'stylua', -- lua formatter 'black', -- python formatter + 'isort', -- python formatter 'clang-format', -- c/c++ formatter 'luacheck', 'pylint', diff --git a/lua/plugins/navigator.lua b/lua/plugins/navigator.lua index 3404937..90c8b0c 100644 --- a/lua/plugins/navigator.lua +++ b/lua/plugins/navigator.lua @@ -1,5 +1,12 @@ return { 'numToStr/Navigator.nvim', + keys = { + { '', 'NavigatorLeft' }, + { '', 'NavigatorDown' }, + { '', 'NavigatorUp' }, + { '', 'NavigatorRight' }, + { '', 'NavigatorPrevious' }, + }, config = function() require('Navigator').setup() end, diff --git a/lua/plugins/neo-tree.lua b/lua/plugins/neo-tree.lua index 2f59b44..51d655a 100644 --- a/lua/plugins/neo-tree.lua +++ b/lua/plugins/neo-tree.lua @@ -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 = { + -- { 'ee', ':Neotree toggle float', silent = true, desc = 'Float File Explorer' }, + { 'e', ':Neotree toggle left', silent = true, desc = 'Left File Explorer' }, + }, } diff --git a/lua/plugins/nerdy.lua b/lua/plugins/nerdy.lua index e61830c..0a946d5 100644 --- a/lua/plugins/nerdy.lua +++ b/lua/plugins/nerdy.lua @@ -1,9 +1,9 @@ return { - "2kabhishek/nerdy.nvim", - dependencies = { - "stevearc/dressing.nvim", - "nvim-telescope/telescope.nvim", - }, - cmd = "Nerdy", - vim.keymap.set("n", "si", "Nerdy", opts), --> nerd icons + '2kabhishek/nerdy.nvim', + dependencies = { + 'stevearc/dressing.nvim', + 'nvim-telescope/telescope.nvim', + }, + cmd = 'Nerdy', + vim.keymap.set('n', 'si', 'Nerdy'), --> nerd icons } diff --git a/lua/plugins/noice.lua b/lua/plugins/noice.lua new file mode 100644 index 0000000..5f04b0d --- /dev/null +++ b/lua/plugins/noice.lua @@ -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, +} diff --git a/lua/plugins/notify.lua b/lua/plugins/notify.lua index 74fb19a..00a6fe0 100644 --- a/lua/plugins/notify.lua +++ b/lua/plugins/notify.lua @@ -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 = { + { + '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', + }, } diff --git a/lua/plugins/nvim-surround.lua b/lua/plugins/nvim-surround.lua deleted file mode 100644 index 29a6fa6..0000000 --- a/lua/plugins/nvim-surround.lua +++ /dev/null @@ -1,7 +0,0 @@ -return { - "kylechui/nvim-surround", - event = { 'BufReadPre', 'BufNewFile' }, - config = function() - require("nvim-surround").setup() - end, -} diff --git a/lua/plugins/nvim-treesitter.lua b/lua/plugins/nvim-treesitter.lua index 5ad35e5..1394f02 100644 --- a/lua/plugins/nvim-treesitter.lua +++ b/lua/plugins/nvim-treesitter.lua @@ -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 = { + ['xp'] = { query = '@parameter.inner', desc = 'Swap parameter with the next one' }, + }, + swap_previous = { + ['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', '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, } diff --git a/lua/plugins/oil.lua b/lua/plugins/oil.lua deleted file mode 100644 index 1c12961..0000000 --- a/lua/plugins/oil.lua +++ /dev/null @@ -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', - [''] = 'actions.select', - [''] = 'actions.select_split', - [''] = 'actions.select_vsplit', -- this is used to navigate left - [''] = 'actions.select_tab', - [''] = 'actions.preview', - [''] = 'actions.close', - [''] = '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, - }, -} diff --git a/lua/plugins/presistence.lua b/lua/plugins/presistence.lua new file mode 100644 index 0000000..0766a45 --- /dev/null +++ b/lua/plugins/presistence.lua @@ -0,0 +1,28 @@ +return { + 'folke/persistence.nvim', + event = 'BufReadPre', + opts = { options = vim.opt.sessionoptions:get() }, + keys = { + { + 'ss', + function() + require('persistence').load() + end, + desc = 'Restore Session', + }, + { + 'sl', + function() + require('persistence').load({ last = true }) + end, + desc = 'Restore Last Session', + }, + { + 'sd', + function() + require('persistence').stop() + end, + desc = "Don't Save Current Session", + }, + }, +} diff --git a/lua/plugins/refactoring.lua b/lua/plugins/refactoring.lua deleted file mode 100644 index e46a8d6..0000000 --- a/lua/plugins/refactoring.lua +++ /dev/null @@ -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, -} diff --git a/lua/plugins/surround.lua b/lua/plugins/surround.lua new file mode 100644 index 0000000..988bb5e --- /dev/null +++ b/lua/plugins/surround.lua @@ -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` + }, + }, +} diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index 1527a6e..22f051a 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -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 = { + { + 'ff', + function() + require('telescope.builtin').find_files() + end, + desc = 'Find File (CWD)', }, - - defaults = { - layout_config = { - horizontal = { - preview_cutoff = 0, + { + 'fh', + function() + require('telescope.builtin').help_tags() + end, + desc = 'Find Help', + }, + { + 'fH', + function() + require('telescope.builtin').highlights() + end, + desc = 'Find highlight groups', + }, + { + 'fM', + function() + require('telescope.builtin').man_pages() + end, + desc = 'Map Pages', + }, + { + 'of', + function() + require('telescope.builtin').oldfiles() + end, + desc = 'Open Recent File', + }, + { + 'tl', + function() + require('telescope.builtin').live_grep() + end, + desc = 'Live Grep', + }, + { + 'tw', + function() + require('telescope.builtin').grep_string() + end, + desc = 'Grep String', + }, + { + 'km', + function() + require('telescope.builtin').keymaps() + end, + desc = 'Keymaps', + }, + { + 'tC', + function() + require('telescope.builtin').commands() + end, + desc = 'Commands', + }, + { + '', + function() + require('telescope.builtin').buffers() + end, + desc = 'Buffers', + }, + { + 'td', + function() + require('telescope.builtin').diagnostics() + end, + desc = 'diagnostics', + }, + { + '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, + }, } diff --git a/lua/plugins/terminal.lua b/lua/plugins/terminal.lua index 9c72417..6308ac0 100644 --- a/lua/plugins/terminal.lua +++ b/lua/plugins/terminal.lua @@ -1,4 +1,8 @@ return { '2kabhishek/termim.nvim', cmd = { 'Fterm', 'FTerm', 'Sterm', 'STerm', 'Vterm', 'VTerm' }, + keys = { + { 'tv', 'Vterm' }, -- Vertical terminal + { 'th', 'Sterm' }, -- Horizontal terminal + }, } diff --git a/lua/plugins/wilder.lua b/lua/plugins/wilder.lua index 07aed5e..bd6a825 100644 --- a/lua/plugins/wilder.lua +++ b/lua/plugins/wilder.lua @@ -6,9 +6,6 @@ return { '/', '?', }, - dependencies = { - 'catppuccin/nvim', - }, config = function() local wilder = require('wilder') diff --git a/lua/preferences.lua b/lua/preferences.lua deleted file mode 100644 index 76ecd5b..0000000 --- a/lua/preferences.lua +++ /dev/null @@ -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]])