diff --git a/nvim/.config/nvim/init.lua b/nvim/.config/nvim/init.lua index 4cf3036..f93ead1 100644 --- a/nvim/.config/nvim/init.lua +++ b/nvim/.config/nvim/init.lua @@ -1,4 +1,7 @@ -require('core/theme') -require('core/basic-vars') +require('core/keymap') require('lazy-init') + +require('core/basic-vars') +require('core/options') +require('core/theme') diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json new file mode 100644 index 0000000..a76b7ea --- /dev/null +++ b/nvim/.config/nvim/lazy-lock.json @@ -0,0 +1,36 @@ +{ + "LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" }, + "alpha-nvim": { "branch": "main", "commit": "de72250e054e5e691b9736ee30db72c65d560771" }, + "auto-session": { "branch": "main", "commit": "021b64ed7d4ac68a37be3ad28d8e1cba5bec582c" }, + "barbar.nvim": { "branch": "master", "commit": "a26bae6c51899db530de19ce3c2f4307e37a869e" }, + "bufferline.nvim": { "branch": "main", "commit": "5726c4e291224181903e960119a11e20ac677a0a" }, + "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, + "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, + "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, + "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, + "dressing.nvim": { "branch": "master", "commit": "3a45525bb182730fe462325c99395529308f431e" }, + "friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" }, + "gitsigns.nvim": { "branch": "main", "commit": "5f808b5e4fef30bd8aca1b803b4e555da07fc412" }, + "hererocks": { "branch": "master", "commit": "c9c5444dea1e07e005484014a8231aa667be30b6" }, + "indent-blankline.nvim": { "branch": "master", "commit": "259357fa4097e232730341fa60988087d189193a" }, + "lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" }, + "lspkind.nvim": { "branch": "master", "commit": "d79a1c3299ad0ef94e255d045bed9fa26025dab6" }, + "lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" }, + "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, + "mini.nvim": { "branch": "main", "commit": "f968becf44b05d8c54d4fa95c9ca699df4de363b" }, + "nvim-autopairs": { "branch": "master", "commit": "b464658e9b880f463b9f7e6ccddd93fb0013f559" }, + "nvim-cmp": { "branch": "main", "commit": "b555203ce4bd7ff6192e759af3362f9d217e8c89" }, + "nvim-tree.lua": { "branch": "master", "commit": "68fc4c20f5803444277022c681785c5edd11916d" }, + "nvim-treesitter": { "branch": "master", "commit": "57713d079c3c2afcc31f3e0650bf8594a2a296ba" }, + "nvim-ts-autotag": { "branch": "main", "commit": "1cca23c9da708047922d3895a71032bc0449c52d" }, + "nvim-web-devicons": { "branch": "master", "commit": "5740b7382429d20b6ed0bbdb0694185af9507d44" }, + "onedark.nvim": { "branch": "master", "commit": "67a74c275d1116d575ab25485d1bfa6b2a9c38a6" }, + "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, + "rest.nvim": { "branch": "main", "commit": "545509268d5e928d72d64764c21ef65c77e90edf" }, + "tagbar": { "branch": "master", "commit": "8de7694c0aeda253073098bbc9fb890b2902ddb8" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "dae2eac9d91464448b584c7949a31df8faefec56" }, + "telescope.nvim": { "branch": "master", "commit": "2eca9ba22002184ac05eddbe47a7fe2d5a384dfc" }, + "vim-css-color": { "branch": "master", "commit": "14fd934cdd9ca1ac0e53511094e612eb9bace373" }, + "vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, + "which-key.nvim": { "branch": "main", "commit": "8ab96b38a2530eacba5be717f52e04601eb59326" } +} diff --git a/nvim/.config/nvim/lua/core/basic-vars.lua b/nvim/.config/nvim/lua/core/basic-vars.lua index 1b9e9e3..50a7a7b 100644 --- a/nvim/.config/nvim/lua/core/basic-vars.lua +++ b/nvim/.config/nvim/lua/core/basic-vars.lua @@ -1,14 +1,36 @@ -vim.o.tabstop = 4 -vim.o.softtabstop = 4 -vim.o.shiftwidth = 4 -vim.o.smarttab = true +-- Editor +vim.o.cursorline = true vim.o.expandtab = true -vim.o.mouse = a + +-- Mouse +vim.o.mouse = 'a' + +-- Line numbers vim.o.number = true vim.o.relativenumber = true -vim.o.undofile = true +-- Tabs and indentation +vim.o.shiftwidth = 4 +vim.o.smarttab = true +vim.o.softtabstop = 4 +vim.o.tabstop = 4 + +vim.o.wrap = false + +-- Modes +vim.o.showmode = false + +-- Undo vim.o.undodir = vim.fn.expand('~/.vim/undo') +vim.o.undofile = true vim.o.undolevels = 1024 -vim.g.mapleader = " " +-- Search +vim.o.ignorecase = true +vim.o.smartcase = true + +-- GUI +vim.o.termguicolors = true + +-- Clipboard +--vim.o.clipboard = 'unnamedplus' diff --git a/nvim/.config/nvim/lua/core/keymap.lua b/nvim/.config/nvim/lua/core/keymap.lua new file mode 100644 index 0000000..9dec9c4 --- /dev/null +++ b/nvim/.config/nvim/lua/core/keymap.lua @@ -0,0 +1,15 @@ +vim.g.mapleader = ' ' +vim.g.maplocalleader = ' ' + +-- Insert mode tweaks +vim.keymap.set('i', 'jk', '', { desc = 'Exit insert mode' }) + +-- Window management +vim.keymap.set('n', 'sv', 'v', { desc = 'Split window vertically' }) +vim.keymap.set('n', 'sh', 'h', { desc = 'Split window horizonatally' }) +vim.keymap.set('n', 'se', '=', { desc = 'Make splits equal size' }) +vim.keymap.set('n', 'sx', 'close', { desc = 'Close current split' }) + +-- Buffer management +vim.keymap.set('n', 'bn', 'bn', { desc = 'Next buffer' }) +vim.keymap.set('n', 'bp', 'bp', { desc = 'Prev buffer' }) diff --git a/nvim/.config/nvim/lua/core/options.lua b/nvim/.config/nvim/lua/core/options.lua new file mode 100644 index 0000000..d0bd5bf --- /dev/null +++ b/nvim/.config/nvim/lua/core/options.lua @@ -0,0 +1 @@ +vim.cmd("let g:netrw_liststyle = 3") diff --git a/nvim/.config/nvim/lua/core/theme.lua b/nvim/.config/nvim/lua/core/theme.lua index 73e8937..53db822 100644 --- a/nvim/.config/nvim/lua/core/theme.lua +++ b/nvim/.config/nvim/lua/core/theme.lua @@ -13,7 +13,7 @@ end -- OneDark styles: dark, darker, cool, deep, warm, warmer, light require('onedark').setup { - style = 'darker', + style = 'deep', colors = { fg = '#b2bbcc' }, --default: #a0a8b7 } require('onedark').load() diff --git a/nvim/.config/nvim/lua/lazy-init.lua b/nvim/.config/nvim/lua/lazy-init.lua index 264700e..b620a10 100644 --- a/nvim/.config/nvim/lua/lazy-init.lua +++ b/nvim/.config/nvim/lua/lazy-init.lua @@ -5,18 +5,29 @@ -- Plugin manager: lazy.nvim -- url: https://github.com/folke/lazy.nvim -local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -if not vim.loop.fs_stat(lazypath) then - vim.fn.system({ - "git", - "clone", - "--filter=blob:none", - "https://github.com/folke/lazy.nvim.git", - "--branch=stable", -- latest stable release - lazypath, - }) +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("lazy-plugins") +require('lazy').setup('lazy-plugins', { + checker = { + enabled = true, + notify = false, + }, + change_detection = { + notify = false, + }, +}) diff --git a/nvim/.config/nvim/lua/lazy-plugins/alpha.lua b/nvim/.config/nvim/lua/lazy-plugins/alpha.lua deleted file mode 100644 index b11a37b..0000000 --- a/nvim/.config/nvim/lua/lazy-plugins/alpha.lua +++ /dev/null @@ -1,8 +0,0 @@ --- Alpha (start screen/dashboard) -return { - "goolord/alpha-nvim", - dependencies = { "nvim-tree/nvim-web-devicons" }, - config = function () - require"alpha".setup(require"alpha.themes.startify".config) - end, -} diff --git a/nvim/.config/nvim/lua/lazy-plugins/plenary.lua b/nvim/.config/nvim/lua/lazy-plugins/base-plenary.lua similarity index 100% rename from nvim/.config/nvim/lua/lazy-plugins/plenary.lua rename to nvim/.config/nvim/lua/lazy-plugins/base-plenary.lua diff --git a/nvim/.config/nvim/lua/lazy-plugins/code-mason.lua b/nvim/.config/nvim/lua/lazy-plugins/code-mason.lua new file mode 100644 index 0000000..9541e85 --- /dev/null +++ b/nvim/.config/nvim/lua/lazy-plugins/code-mason.lua @@ -0,0 +1,4 @@ +-- Plenary +return { + "williamboman/mason.nvim", +} diff --git a/nvim/.config/nvim/lua/lazy-plugins/css-color.lua b/nvim/.config/nvim/lua/lazy-plugins/css-color.lua index f587662..ea2d6f5 100644 --- a/nvim/.config/nvim/lua/lazy-plugins/css-color.lua +++ b/nvim/.config/nvim/lua/lazy-plugins/css-color.lua @@ -1,6 +1,6 @@ -- CSS color return { - "ap/vim-css-color", + 'ap/vim-css-color', } diff --git a/nvim/.config/nvim/lua/lazy-plugins/editor-auto-session.lua b/nvim/.config/nvim/lua/lazy-plugins/editor-auto-session.lua new file mode 100644 index 0000000..462cdb8 --- /dev/null +++ b/nvim/.config/nvim/lua/lazy-plugins/editor-auto-session.lua @@ -0,0 +1,23 @@ +return { + 'rmagatti/auto-session', + event = 'VeryLazy', + config = function() + local auto_session = require('auto-session') + + auto_session.setup({ + auto_restore_enabled = false, + }) + end, + keys = { + { + 'wr', + 'SessionRestore', + desc = 'Session restore', + }, + { + 'ws', + 'SessionSave', + desc = 'Session save', + } + }, +} diff --git a/nvim/.config/nvim/lua/lazy-plugins/autopairs.lua b/nvim/.config/nvim/lua/lazy-plugins/editor-autopairs.lua similarity index 100% rename from nvim/.config/nvim/lua/lazy-plugins/autopairs.lua rename to nvim/.config/nvim/lua/lazy-plugins/editor-autopairs.lua diff --git a/nvim/.config/nvim/lua/lazy-plugins/editor-diffview.lua b/nvim/.config/nvim/lua/lazy-plugins/editor-diffview.lua new file mode 100644 index 0000000..2e450d9 --- /dev/null +++ b/nvim/.config/nvim/lua/lazy-plugins/editor-diffview.lua @@ -0,0 +1,4 @@ +-- Diffview +return { + 'sindrets/diffview.nvim', +} diff --git a/nvim/.config/nvim/lua/lazy-plugins/git-signs.lua b/nvim/.config/nvim/lua/lazy-plugins/editor-git-signs.lua similarity index 100% rename from nvim/.config/nvim/lua/lazy-plugins/git-signs.lua rename to nvim/.config/nvim/lua/lazy-plugins/editor-git-signs.lua diff --git a/nvim/.config/nvim/lua/lazy-plugins/editor-indent-blankline.lua b/nvim/.config/nvim/lua/lazy-plugins/editor-indent-blankline.lua new file mode 100644 index 0000000..e33e53d --- /dev/null +++ b/nvim/.config/nvim/lua/lazy-plugins/editor-indent-blankline.lua @@ -0,0 +1,12 @@ +-- Indent blankline +return { + 'lukas-reineke/indent-blankline.nvim', + event = { + 'BufReadPre', + 'BufNewFile', + }, + main = 'ibl', + opts = { + indent = { char = '┊' }, + }, +} diff --git a/nvim/.config/nvim/lua/lazy-plugins/surround.lua b/nvim/.config/nvim/lua/lazy-plugins/editor-surround.lua similarity index 100% rename from nvim/.config/nvim/lua/lazy-plugins/surround.lua rename to nvim/.config/nvim/lua/lazy-plugins/editor-surround.lua diff --git a/nvim/.config/nvim/lua/lazy-plugins/feat-rest-nvim.lua b/nvim/.config/nvim/lua/lazy-plugins/feat-rest-nvim.lua new file mode 100644 index 0000000..4390ebe --- /dev/null +++ b/nvim/.config/nvim/lua/lazy-plugins/feat-rest-nvim.lua @@ -0,0 +1,53 @@ +return { + "rest-nvim/rest.nvim", + dependencies = { { "nvim-lua/plenary.nvim" } }, + event = "BufEnter *.http", + config = function() + require("rest-nvim").setup({ + -- Open request results in a horizontal split + result_split_horizontal = false, + -- Keep the http file buffer above|left when split horizontal|vertical + result_split_in_place = false, + -- stay in current windows (.http file) or change to results window (default) + stay_in_current_window_after_split = false, + -- Skip SSL verification, useful for unknown certificates + skip_ssl_verification = false, + -- Encode URL before making request + encode_url = true, + -- Highlight request on run + highlight = { + enabled = true, + timeout = 150, + }, + result = { + -- toggle showing URL, HTTP info, headers at top the of result window + show_url = true, + -- show the generated curl command in case you want to launch + -- the same request via the terminal (can be verbose) + show_curl_command = false, + show_http_info = true, + show_headers = true, + -- table of curl `--write-out` variables or false if disabled + -- for more granular control see Statistics Spec + show_statistics = false, + -- executables or functions for formatting response body [optional] + -- set them to false if you want to disable them + formatters = { + json = "jq", + html = function(body) + return vim.fn.system({"tidy", "-i", "-q", "-"}, body) + end + }, + }, + -- Jump to request line on run + jump_to_request = false, + env_file = '.env', + -- for telescope select + env_pattern = "\\.env$", + env_edit_command = "tabedit", + custom_dynamic_variables = {}, + yank_dry_run = true, + search_back = true, + }) + end +} diff --git a/nvim/.config/nvim/lua/lazy-plugins/indent-blankline.lua b/nvim/.config/nvim/lua/lazy-plugins/indent-blankline.lua deleted file mode 100644 index f3ae156..0000000 --- a/nvim/.config/nvim/lua/lazy-plugins/indent-blankline.lua +++ /dev/null @@ -1,4 +0,0 @@ --- Indent blankline -return { - "lukas-reineke/indent-blankline.nvim", -} diff --git a/nvim/.config/nvim/lua/lazy-plugins/lastplace.lua b/nvim/.config/nvim/lua/lazy-plugins/lastplace.lua deleted file mode 100644 index b31685f..0000000 --- a/nvim/.config/nvim/lua/lazy-plugins/lastplace.lua +++ /dev/null @@ -1,5 +0,0 @@ --- Lastplace -return { - "farmergreg/vim-lastplace", -} - diff --git a/nvim/.config/nvim/lua/lazy-plugins/lsp-nvim-cmp.lua b/nvim/.config/nvim/lua/lazy-plugins/lsp-nvim-cmp.lua new file mode 100644 index 0000000..3f8b2df --- /dev/null +++ b/nvim/.config/nvim/lua/lazy-plugins/lsp-nvim-cmp.lua @@ -0,0 +1,63 @@ +return { + 'hrsh7th/nvim-cmp', + event = 'InsertEnter', + dependencies = { + 'hrsh7th/cmp-buffer', -- source for text in buffer + 'hrsh7th/cmp-path', -- source for file system paths + { + 'L3MON4D3/LuaSnip', + -- follow latest release. + version = 'v2.*', -- Replace by the latest released major (first number of latest release) + -- install jsregexp (optional!). + build = 'make install_jsregexp', + }, + 'saadparwaiz1/cmp_luasnip', -- for autocompletion + 'rafamadriz/friendly-snippets', -- useful snippets + 'onsails/lspkind.nvim', -- vs-code like pictograms + }, + config = function() + local cmp = require('cmp') + + local luasnip = require('luasnip') + + local lspkind = require('lspkind') + + -- loads vscode style snippets from installed plugins (e.g. friendly-snippets) + require('luasnip.loaders.from_vscode').lazy_load() + + cmp.setup({ + completion = { + completeopt = 'menu,menuone,preview,noselect', + }, + snippet = { -- configure how nvim-cmp interacts with snippet engine + expand = function(args) + luasnip.lsp_expand(args.body) + end, + }, + mapping = cmp.mapping.preset.insert({ + [''] = cmp.mapping.select_prev_item(), -- previous suggestion + [''] = cmp.mapping.select_next_item(), -- next suggestion + [''] = cmp.mapping.scroll_docs(-4), + [''] = cmp.mapping.scroll_docs(4), + [''] = cmp.mapping.complete(), -- show completion suggestions + [''] = cmp.mapping.abort(), -- close completion window + [''] = cmp.mapping.confirm({ select = false }), + }), + -- sources for autocompletion + sources = cmp.config.sources({ + { name = 'nvim_lsp'}, + { name = 'luasnip' }, -- snippets + { name = 'buffer' }, -- text within current buffer + { name = 'path' }, -- file system paths + }), + + -- configure lspkind for vs-code like pictograms in completion menu + formatting = { + format = lspkind.cmp_format({ + maxwidth = 50, + ellipsis_char = '...', + }), + }, + }) + end, +} diff --git a/nvim/.config/nvim/lua/lazy-plugins/lsp-treesitter.lua b/nvim/.config/nvim/lua/lazy-plugins/lsp-treesitter.lua new file mode 100644 index 0000000..52aee82 --- /dev/null +++ b/nvim/.config/nvim/lua/lazy-plugins/lsp-treesitter.lua @@ -0,0 +1,48 @@ +return { + 'nvim-treesitter/nvim-treesitter', + event = { + 'BufReadPre', + 'BufNewFile', + }, + build = ':TSUpdate', + dependencies = { + 'windwp/nvim-ts-autotag', + }, + config = function() + local treesitter = require('nvim-treesitter.configs') + + treesitter.setup({ + highlight = { + enable = true, + }, + indent = { + enable = true, + }, + autotag = { + enable = true, + }, + ensure_installed = { + 'json', + 'javascript', + 'yaml', + 'html', + 'css', + 'lua', + 'vim', + 'dockerfile', + 'gitignore', + 'markdown', + 'bash', + }, + incremental_selection = { + enable = true, + keymaps = { + init_selection = '', + node_incremental = '', + scope_incremental = false, + node_decremental = '', + }, + }, + }) + end, +} diff --git a/nvim/.config/nvim/lua/lazy-plugins/telescope.lua b/nvim/.config/nvim/lua/lazy-plugins/telescope.lua deleted file mode 100644 index 333cf51..0000000 --- a/nvim/.config/nvim/lua/lazy-plugins/telescope.lua +++ /dev/null @@ -1,48 +0,0 @@ -function git_root() - return string.gsub(vim.fn.system("git rev-parse --show-toplevel"), "\n", "") -end - -function get_opts() - local opts = {} - - local root = git_root() - if vim.v.shell_error == 0 then - opts.cwd = root - end - - return opts -end - --- Telescope -return { - "nvim-telescope/telescope.nvim", - dependencies = { - "nvim-lua/plenary.nvim", - }, - keys = { - { - "fp", - function() - require("telescope.builtin").find_files(get_opts()) - end, - }, - { - "ff", - function() - require('telescope.builtin').live_grep(get_opts()) - end, - }, - { - "fb", - function() - require('telescope.builtin').buffers(get_opts()) - end, - }, - { - "fh", - function() - require('telescope.builtin').help_tags(get_opts()) - end, - }, - }, -} diff --git a/nvim/.config/nvim/lua/lazy-plugins/theme-onedark.lua b/nvim/.config/nvim/lua/lazy-plugins/theme-onedark.lua index 90eac19..772249d 100644 --- a/nvim/.config/nvim/lua/lazy-plugins/theme-onedark.lua +++ b/nvim/.config/nvim/lua/lazy-plugins/theme-onedark.lua @@ -1,4 +1,4 @@ -- Onedark theme return { - "navarasu/onedark.nvim", + 'navarasu/onedark.nvim', } diff --git a/nvim/.config/nvim/lua/lazy-plugins/ui-alpha.lua b/nvim/.config/nvim/lua/lazy-plugins/ui-alpha.lua new file mode 100644 index 0000000..f38a6e5 --- /dev/null +++ b/nvim/.config/nvim/lua/lazy-plugins/ui-alpha.lua @@ -0,0 +1,38 @@ +-- Alpha (start screen/dashboard) +return { + "goolord/alpha-nvim", + dependencies = { "nvim-tree/nvim-web-devicons" }, + event = "VimEnter", + config = function() + local alpha = require("alpha") + local dashboard = require("alpha.themes.dashboard") + + -- Set header + dashboard.section.header.val = { + " ", + " ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ ", + " ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ ", + " ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ ", + " ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ ", + " ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ ", + " ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ ", + " ", + } + + -- Set menu + dashboard.section.buttons.val = { + dashboard.button("e", " > New File", "ene"), + dashboard.button("SPC ee", " > Toggle file explorer", "NvimTreeToggle"), + dashboard.button("SPC ff", "󰱼 > Find File", "Telescope find_files"), + dashboard.button("SPC fs", " > Find Word", "Telescope live_grep"), + dashboard.button("SPC wr", "󰁯 > Restore Session For Current Directory", "SessionRestore"), + dashboard.button("q", " > Quit NVIM", "qa"), + } + + -- Send config to alpha + alpha.setup(dashboard.opts) + + -- Disable folding on alpha buffer + vim.cmd([[autocmd FileType alpha setlocal nofoldenable]]) + end, +} diff --git a/nvim/.config/nvim/lua/lazy-plugins/barbar.lua b/nvim/.config/nvim/lua/lazy-plugins/ui-barbar.lua similarity index 88% rename from nvim/.config/nvim/lua/lazy-plugins/barbar.lua rename to nvim/.config/nvim/lua/lazy-plugins/ui-barbar.lua index 64c90b9..cdd1217 100644 --- a/nvim/.config/nvim/lua/lazy-plugins/barbar.lua +++ b/nvim/.config/nvim/lua/lazy-plugins/ui-barbar.lua @@ -1,6 +1,7 @@ -- Barbar (tabline bar) return { "romgrk/barbar.nvim", + enabled = false, dependencies = { "lewis6991/gitsigns.nvim", "nvim-tree/nvim-web-devicons", diff --git a/nvim/.config/nvim/lua/lazy-plugins/ui-bufferline.lua b/nvim/.config/nvim/lua/lazy-plugins/ui-bufferline.lua new file mode 100644 index 0000000..7716b8c --- /dev/null +++ b/nvim/.config/nvim/lua/lazy-plugins/ui-bufferline.lua @@ -0,0 +1,13 @@ +return { + 'akinsho/bufferline.nvim', + dependencies = { + 'nvim-tree/nvim-web-devicons', + }, + version = '*', + opts = { + options = { +-- mode = 'tabs', +-- separator_style = 'slant', + }, + }, +} diff --git a/nvim/.config/nvim/lua/lazy-plugins/ui-dressing.lua b/nvim/.config/nvim/lua/lazy-plugins/ui-dressing.lua new file mode 100644 index 0000000..ef0bfc9 --- /dev/null +++ b/nvim/.config/nvim/lua/lazy-plugins/ui-dressing.lua @@ -0,0 +1,4 @@ +return { + 'stevearc/dressing.nvim', + event = 'VeryLazy', +} diff --git a/nvim/.config/nvim/lua/lazy-plugins/ui-lualine.lua b/nvim/.config/nvim/lua/lazy-plugins/ui-lualine.lua new file mode 100644 index 0000000..3772b1b --- /dev/null +++ b/nvim/.config/nvim/lua/lazy-plugins/ui-lualine.lua @@ -0,0 +1,76 @@ +return { + 'nvim-lualine/lualine.nvim', + dependencies = { + 'nvim-tree/nvim-web-devicons', + }, + config = function() + local lualine = require('lualine') + local lazy_status = require('lazy.status') -- to configure lazy pending updates count + + local colors = { + blue = '#65D1FF', + green = '#3EFFDC', + violet = '#FF61EF', + yellow = '#FFDA7B', + red = '#FF4A4A', + fg = '#c3ccdc', + bg = '#112638', + inactive_bg = '#2c3043', + } + + local my_lualine_theme = { + normal = { + a = { bg = colors.blue, fg = colors.bg, gui = 'bold' }, + b = { bg = colors.bg, fg = colors.fg }, + c = { bg = colors.bg, fg = colors.fg }, + }, + insert = { + a = { bg = colors.green, fg = colors.bg, gui = 'bold' }, + b = { bg = colors.bg, fg = colors.fg }, + c = { bg = colors.bg, fg = colors.fg }, + }, + visual = { + a = { bg = colors.violet, fg = colors.bg, gui = 'bold' }, + b = { bg = colors.bg, fg = colors.fg }, + c = { bg = colors.bg, fg = colors.fg }, + }, + command = { + a = { bg = colors.yellow, fg = colors.bg, gui = 'bold' }, + b = { bg = colors.bg, fg = colors.fg }, + c = { bg = colors.bg, fg = colors.fg }, + }, + replace = { + a = { bg = colors.red, fg = colors.bg, gui = 'bold' }, + b = { bg = colors.bg, fg = colors.fg }, + c = { bg = colors.bg, fg = colors.fg }, + }, + inactive = { + a = { bg = colors.inactive_bg, fg = colors.semilightgray, gui = 'bold' }, + b = { bg = colors.inactive_bg, fg = colors.semilightgray }, + c = { bg = colors.inactive_bg, fg = colors.semilightgray }, + }, + } + + -- configure lualine with modified theme + lualine.setup({ + options = { + theme = my_lualine_theme, + disabled_filetypes = { + statusline = { 'NvimTree' }, + }, + }, + sections = { + lualine_x = { + { + lazy_status.updates, + cond = lazy_status.has_updates, + color = { fg = '#ff9e64' }, + }, + { 'encoding' }, + { 'fileformat' }, + { 'filetype' }, + }, + }, + }) + end, +} diff --git a/nvim/.config/nvim/lua/lazy-plugins/ui-mini-nvim.lua b/nvim/.config/nvim/lua/lazy-plugins/ui-mini-nvim.lua new file mode 100644 index 0000000..c0f7a8a --- /dev/null +++ b/nvim/.config/nvim/lua/lazy-plugins/ui-mini-nvim.lua @@ -0,0 +1,7 @@ +-- Mini.nvim +return { + 'echasnovski/mini.nvim', + config = function() + require('mini.icons').setup() + end +} diff --git a/nvim/.config/nvim/lua/lazy-plugins/ui-nvim-tree.lua b/nvim/.config/nvim/lua/lazy-plugins/ui-nvim-tree.lua new file mode 100644 index 0000000..3d36581 --- /dev/null +++ b/nvim/.config/nvim/lua/lazy-plugins/ui-nvim-tree.lua @@ -0,0 +1,46 @@ +return { + "nvim-tree/nvim-tree.lua", + dependencies = "nvim-tree/nvim-web-devicons", + config = function() + local nvimtree = require('nvim-tree') + vim.g.loaded_netrw = 1 + vim.g.loaded_netrwPlugin = 1 + + nvimtree.setup({ + view = { + width = 35, + relativenumber = true, + }, + -- change folder arrow icons + renderer = { + indent_markers = { + enable = true, + }, + icons = { + glyphs = { + folder = { + arrow_closed = "", -- arrow when folder is closed + arrow_open = "", -- arrow when folder is open + }, + }, + }, + }, + git = { + ignore = false, + }, + }) + + vim.keymap.set('n', 'ef', 'NvimTreeFindFile', { desc = 'Move to file in file explorer' }) + vim.keymap.set('n', 'ec', 'NvimTreeCollapse', { desc = 'Collapse file explorer' }) + vim.keymap.set('n', 'er', 'NvimTreeRefresh', { desc = 'Refresh file explorer' }) + end, + keys = { + { + 'ee', + function() + require('nvim-tree.api').tree.toggle() + end, + desc = 'Toggle file explorer', + }, + } +} diff --git a/nvim/.config/nvim/lua/lazy-plugins/tagbar.lua b/nvim/.config/nvim/lua/lazy-plugins/ui-tagbar.lua similarity index 68% rename from nvim/.config/nvim/lua/lazy-plugins/tagbar.lua rename to nvim/.config/nvim/lua/lazy-plugins/ui-tagbar.lua index 24168b6..fc12c32 100644 --- a/nvim/.config/nvim/lua/lazy-plugins/tagbar.lua +++ b/nvim/.config/nvim/lua/lazy-plugins/ui-tagbar.lua @@ -1,4 +1,5 @@ -- Tagbar return { "preservim/tagbar", + enabled = false, } diff --git a/nvim/.config/nvim/lua/lazy-plugins/ui-telescope.lua b/nvim/.config/nvim/lua/lazy-plugins/ui-telescope.lua new file mode 100644 index 0000000..c611d5d --- /dev/null +++ b/nvim/.config/nvim/lua/lazy-plugins/ui-telescope.lua @@ -0,0 +1,60 @@ +-- Telescope +return { + 'nvim-telescope/telescope.nvim', + dependencies = { + 'nvim-lua/plenary.nvim', + { 'nvim-telescope/telescope-fzf-native.nvim', build = 'make' }, + 'nvim-tree/nvim-web-devicons', + }, + config = function(_, opts) + local telescope = require('telescope') + local actions = require('telescope.actions') + + telescope.setup({ + defaults = { + path_display = { 'smart' }, + mappings = { + i = { + [''] = actions.move_selection_previous, -- move to prev result + [''] = actions.move_selection_next, -- move to next result + [''] = actions.send_selected_to_qflist + actions.open_qflist, + [''] = actions.delete_buffer, + } + } + } + }) + telescope.load_extension('fzf') + end, + keys = { + { + 'ff', + 'Telescope find_files', + desc = 'Find files', + }, + { + 'fg', + 'Telescope live_grep', + desc = 'Live grep', + }, + { + 'fb', + 'Telescope buffers', + desc = 'Buffers' + }, + { + 'fh', + 'Telescope help_tags', + desc = 'Help tags', + }, + { + 'fr', + 'Telescope oldfiles`', + desc = 'Recent files', + }, + { + 'fs', + 'Telescope grep_string', + desc = 'Find string', + }, + }, +} diff --git a/nvim/.config/nvim/lua/lazy-plugins/ui-which-key.lua b/nvim/.config/nvim/lua/lazy-plugins/ui-which-key.lua new file mode 100644 index 0000000..7731a10 --- /dev/null +++ b/nvim/.config/nvim/lua/lazy-plugins/ui-which-key.lua @@ -0,0 +1,17 @@ +return { + 'folke/which-key.nvim', + event = 'VeryLazy', + init = function() + vim.o.timeout = true + vim.o.timeoutlen = 500 + end, + config = function() + local wk = require("which-key") + wk.register({ + { "e", group = "NeoTree" }, + { "f", group = "Telescope" }, + { "s", group = "splits" }, + }) + end, + opts = { }, +} diff --git a/nvim/.config/nvim/lua/lazy-plugins/vim-sensible.lua b/nvim/.config/nvim/lua/lazy-plugins/vim-sensible.lua deleted file mode 100644 index 37ac253..0000000 --- a/nvim/.config/nvim/lua/lazy-plugins/vim-sensible.lua +++ /dev/null @@ -1,4 +0,0 @@ --- Sensible defaults -return { - "tpope/vim-sensible", -}