diff --git a/init.lua b/init.lua index 6c5a4d1..7b484e0 100644 --- a/init.lua +++ b/init.lua @@ -8,6 +8,8 @@ -- ╚═╝ ╚═╝ ╚═╝╚═╝╚═╝ ╚═╝ ╚═╝ - +-- Setup Lazy.nvim and plugins require("plugins") + +-- Setup standard neovim options require("options") diff --git a/lua/options/colors.lua b/lua/options/colors.lua index c2455ef..b4bb24b 100644 --- a/lua/options/colors.lua +++ b/lua/options/colors.lua @@ -3,4 +3,3 @@ -- vim.g.onedark_config = { style = 'darker' } vim.cmd("colorscheme carbonfox") - diff --git a/lua/options/keybind.lua b/lua/options/keybind.lua index 1b6fb1b..b1b15c6 100644 --- a/lua/options/keybind.lua +++ b/lua/options/keybind.lua @@ -1,21 +1,23 @@ +vim.g.mapleader = " " + + + local map = vim.api.nvim_set_keymap local cmap = vim.keymap.set local options = { noremap = true } local cmd_options = { noremap = true, silent = true } - local tele = require('telescope.builtin') local neogit = require('neogit') -vim.g.mapleader = " " - +-- open git integration map("n", "g", "Neogit kind=split", options) @@ -32,29 +34,33 @@ end) - +-- slef explanitory map("n", "tw", "lua MiniTrailspace.trim()", options) map("n", "fm", "CHADopen", options) -map("n", "fc", "NERDTreeClose", options) map("n", "tt", "12 split Tnew", options) map("n", "zt", "Twilight", options) map("n", "zz", "ZenMode", options) - +-- remap keys so that they dont skip camelCase map("n", "w", "CamelCaseMotion_w", cmd_options) map("n", "b", "CamelCaseMotion_b", cmd_options) map("n", "e", "CamelCaseMotion_e", cmd_options) map("n", "ge", "CamelCaseMotion_ge", cmd_options) + +-- Dashboard and pomodoro map("n", "v", "Veil", options) map("n", "p", "NomoMenu", options) +-- this little guy helps you move text, really helpful map("v", "J", ":m '>+1gv=gv", options) map("v", "K", ":m '<-2gv=gv", options) + +-- Cursor always stays on center map("n", "J", "mzJ`z", options) map("n", "", "zz", options) map("n", "", "zz", options) @@ -62,20 +68,26 @@ map("n", "n", "nzzzv", options) map("n", "N", "Nzzzv", options) --- greatest remap ever + +-- paste text but DONT copy the overridden text cmap("x", "p", [["_dP]]) cmap("x", "p", [["+dP]]) - +-- delete text but DONT copy to clipboard cmap({ "n", "v" }, "d", [["_d]]) - +-- quickfix stuff +-- +-- map("n", "", "cnextzz", options) map("n", "", "cprevzz", options) map("n", "k", "lnextzz", options) map("n", "j", "lprevzz", options) + +-- search and replace every instance of word under cursor cmap("n", "s", [[:%s/\<\>//gI]]) +-- take a break ! map("n", "mr", "CellularAutomaton make_it_rain", options) diff --git a/lua/options/opts.lua b/lua/options/opts.lua index 3cf8ad4..2b4ef44 100644 --- a/lua/options/opts.lua +++ b/lua/options/opts.lua @@ -17,10 +17,10 @@ o.termguicolors = true -- true colours for better experience o.wrap = false -- don't wrap lines o.backupcopy = "yes" -- fix weirdness for stuff that replaces the entire file when hot reloading -o.compatible = false -o.showmatch = true -o.hlsearch = true -o.incsearch = true +o.compatible = false -- disable compatibility with old vi +o.showmatch = true -- show matches while searching for text +o.hlsearch = true -- highlight text that has been searched +o.incsearch = true -- incramentally search o.tabstop = 16 o.softtabstop = 4 o.shiftwidth = 4 @@ -28,13 +28,13 @@ o.autoindent = true o.wildmode = "longest,list" o.mouse = "v" o.mouse = "a" -o.clipboard = "unnamedplus" +o.clipboard = "unnamedplus" -- use system clipboard o.ttyfast = true o.cursorline = true o.splitbelow = true o.autochdir = true o.signcolumn="yes:1" -o.shell = "/bin/dash" +o.shell = "/bin/bash" vim.api.nvim_command("filetype off") vim.api.nvim_command("let &runtimepath.=',~/.vim/bundle/neoterm'") @@ -44,7 +44,7 @@ vim.api.nvim_command("syntax on") - +-- disable builtin plugins as they are not needed local disabled_built_ins = { "netrw", "netrwPlugin", diff --git a/lua/plugins/devicons.lua b/lua/plugins/devicons.lua index f0673ed..34d22f1 100644 --- a/lua/plugins/devicons.lua +++ b/lua/plugins/devicons.lua @@ -2,41 +2,46 @@ require'nvim-web-devicons'.setup { -- your personnal icons can go here (to override) -- you can specify color or cterm_color instead of specifying both of them -- DevIcon will be appended to `name` - override = { - zsh = { - icon = "", - color = "#428850", - cterm_color = "65", - name = "Zsh" - } - }; + override = { + zsh = { + icon = "", + color = "#428850", + cterm_color = "65", + name = "Zsh" + } + }; + + -- globally enable different highlight colors per icon (default to true) -- if set to false all icons will have the default icon's color - color_icons = true; + color_icons = true; + -- globally enable default icons (default to false) -- will get overriden by `get_icons` option - default = true; + default = true; + -- globally enable "strict" selection of icons - icon will be looked up in -- different tables, first by filename, and if not found by extension; this -- prevents cases when file doesn't have any extension but still gets some icon -- because its name happened to match some extension (default to false) - strict = true; + strict = true; + -- same as `override` but specifically for overrides by filename -- takes effect when `strict` is true - override_by_filename = { - [".gitignore"] = { - icon = "", - color = "#f1502f", - name = "Gitignore" - } - }; + override_by_filename = { + [".gitignore"] = { + icon = "", + color = "#f1502f", + name = "Gitignore" + } + }; -- same as `override` but specifically for overrides by extension -- takes effect when `strict` is true - override_by_extension = { - ["log"] = { - icon = "", - color = "#81e043", - name = "Log" - } - }; + override_by_extension = { + ["log"] = { + icon = "", + color = "#81e043", + name = "Log" + } + }; } diff --git a/lua/plugins/drop.lua b/lua/plugins/drop.lua index 7856218..e9f5ae8 100644 --- a/lua/plugins/drop.lua +++ b/lua/plugins/drop.lua @@ -1,9 +1,9 @@ require('drop').setup { - ---@type DropTheme|string - theme = "leaves", -- can be one of rhe default themes, or a custom theme - max = 15, -- maximum number of drops on the screen - interval = 100, -- every 150ms we update the drops - screensaver = 1000 * 60 * 1, -- show after 5 minutes. Set to false, to disable - filetypes = { "veil" }, -- will enable/disable automatically for the following filetypes + ---@type DropTheme|string + theme = "leaves", -- can be one of rhe default themes, or a custom theme + max = 15, -- maximum number of drops on the screen + interval = 100, -- every 100ms we update the drops + screensaver = 1000 * 60 * 3, -- show after 3 minutes. Set to false, to disable + filetypes = { "veil" }, -- will enable/disable automatically for the following filetypes } diff --git a/lua/plugins/harpoon.lua b/lua/plugins/harpoon.lua index 54550cd..508114f 100644 --- a/lua/plugins/harpoon.lua +++ b/lua/plugins/harpoon.lua @@ -1,12 +1,14 @@ +vim.g.mapleader = " " + local mark = require("harpoon.mark") local ui = require("harpoon.ui") -vim.g.mapleader = " " - +-- show harpoon menu and add file to harpoon list vim.keymap.set("n", "ma", mark.add_file) vim.keymap.set("n", "mm", ui.toggle_quick_menu) +-- main 4 files of harpoon jumping vim.keymap.set("n", "", function() ui.nav_file(1) end) vim.keymap.set("n", "", function() ui.nav_file(2) end) vim.keymap.set("n", "", function() ui.nav_file(3) end) diff --git a/lua/plugins/hlblocks.lua b/lua/plugins/hlblocks.lua index 6c56b71..c533c6a 100644 --- a/lua/plugins/hlblocks.lua +++ b/lua/plugins/hlblocks.lua @@ -1,12 +1,13 @@ require('hlchunk').setup({ indent = { - chars = { "·", "·", "·", "·", }, -- more code can be found in https://unicodeplus.com/ --- chars = { "│", "¦", "┆", "┊", }, -- more code can be found in https://unicodeplus.com/ + chars = { "·", "·", "·", "·", }, + --chars = { "│", "¦", "┆", "┊", }, -- more code can be found in https://unicodeplus.com/ style = { "#333333", }, }, + blank = { enable = false, }, diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index ee04258..7873540 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -1,7 +1,5 @@ require("plugins.lazy") - require("plugins.noice") - require("plugins.neorg") require("plugins.treesitter") require("plugins.drop") @@ -11,10 +9,6 @@ require("plugins.nomodoro") require("plugins.devicons") require("plugins.lualine") require("plugins.veil") - - require("plugins.harpoon") require("plugins.hlblocks") - - require("plugins.gitsigns") diff --git a/lua/plugins/lazy.lua b/lua/plugins/lazy.lua index 09b08d4..ceb1a59 100644 --- a/lua/plugins/lazy.lua +++ b/lua/plugins/lazy.lua @@ -1,15 +1,17 @@ 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, - }) + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", -- latest stable release + lazypath, + }) end + vim.opt.rtp:prepend(lazypath) @@ -176,6 +178,7 @@ require("lazy").setup({ }, + -- this is pure magic, i love this guy { 'VonHeikemen/lsp-zero.nvim', branch = 'v2.x', diff --git a/lua/plugins/lsp-zero.lua b/lua/plugins/lsp-zero.lua index 58c1369..293a662 100644 --- a/lua/plugins/lsp-zero.lua +++ b/lua/plugins/lsp-zero.lua @@ -25,7 +25,7 @@ cmp.setup({ - + -- Cycle with tab, as intended by divine creation [""] = cmp.mapping(function(fallback) if cmp.visible() then cmp.select_next_item() diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua index 8b87a20..1a2fdbf 100644 --- a/lua/plugins/lualine.lua +++ b/lua/plugins/lualine.lua @@ -1,41 +1,47 @@ require('lualine').setup { - options = { - icons_enabled = true, - theme = 'carbonfox', - component_separators = { left = '', right = ''}, - section_separators = { left = '', right = ''}, - disabled_filetypes = { - statusline = {}, - winbar = {}, + options = { + icons_enabled = true, + theme = 'carbonfox', + + component_separators = { left = '', right = ''}, + section_separators = { left = '', right = ''}, + + disabled_filetypes = { + statusline = {}, + winbar = {}, + }, + + ignore_focus = {}, + always_divide_middle = true, + globalstatus = false, + + refresh = { + statusline = 1000, + tabline = 1000, + winbar = 1000, + } }, - ignore_focus = {}, - always_divide_middle = true, - globalstatus = false, - refresh = { - statusline = 1000, - tabline = 1000, - winbar = 1000, - } - }, - sections = { - lualine_a = {'mode'}, - lualine_b = {'branch', 'diff', 'diagnostics'}, - lualine_c = {'filename'}, - lualine_x = { require("nomodoro").status }, - lualine_y = {'progress'}, - lualine_z = {'location'} - }, - inactive_sections = { - lualine_a = {}, - lualine_b = {}, - lualine_c = {'filename'}, - lualine_x = {'location'}, - lualine_y = {}, - lualine_z = {} - }, - tabline = {}, - winbar = {}, - inactive_winbar = {}, - extensions = {} + + sections = { + lualine_a = {'mode'}, + lualine_b = {'branch', 'diff', 'diagnostics'}, + lualine_c = {'filename'}, + lualine_x = { require("nomodoro").status }, + lualine_y = {'progress'}, + lualine_z = {'location'} + }, + inactive_sections = { + lualine_a = {}, + lualine_b = {}, + lualine_c = {'filename'}, + lualine_x = {'location'}, + lualine_y = {}, + lualine_z = {} + }, + + tabline = {}, + winbar = {}, + inactive_winbar = {}, + extensions = {} } diff --git a/lua/plugins/noice.lua b/lua/plugins/noice.lua index 71b175c..38f28b9 100644 --- a/lua/plugins/noice.lua +++ b/lua/plugins/noice.lua @@ -3,6 +3,8 @@ require("noice").setup({ health = { checker = false }, + + cmdline = { format = { cmdline = { @@ -39,6 +41,8 @@ require("noice").setup({ input = {} } }, + + opts = { win_options = { winhighlight = { @@ -48,6 +52,8 @@ require("noice").setup({ } } }, + + lsp = { progress = { enabled = true @@ -58,6 +64,8 @@ require("noice").setup({ ["cmp.entry.get_documentation"] = true } }, + + -- show command prompt on top of the buffer, no border views = { cmdline_popup = { position = { @@ -73,13 +81,19 @@ require("noice").setup({ }, } }, + + presets = { long_message_to_split = true, lsp_doc_border = true }, + + popupmenu = { backend = "cmp" }, + + format = {} }) diff --git a/lua/plugins/nomodoro.lua b/lua/plugins/nomodoro.lua index 8824686..e5204fc 100644 --- a/lua/plugins/nomodoro.lua +++ b/lua/plugins/nomodoro.lua @@ -1,22 +1,28 @@ require('nomodoro').setup({ - work_time = 1, - break_time = 1, + work_time = 25, + break_time = 5, menu_available = true, + texts = { - on_break_complete = "BREAK IS UP!", - on_work_complete = "TIME IS UP!", + on_break_complete = "Break is over!", + on_work_complete = "Take a break!", status_icon = "羽", timer_format = '!%0M:%0S' -- To include hours: '!%0H:%0M:%0S' }, + + -- force break time yaaay on_work_complete = function() vim.cmd('CellularAutomaton make_it_rain') end, + + -- resume on_break_complete = function() vim.cmd('Veil') end }) +-- Show timer status in lualine, on the right require('lualine').setup({ sections = { lualine_x = { diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index 34b1ec4..37c746e 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -1,15 +1,15 @@ require'nvim-treesitter.configs'.setup { - -- A list of parser names, or "all" (the five listed parsers should always be installed) - ensure_installed = { "c", "lua", "vim", "vimdoc", "query", "haskell", "go", "bash" }, + -- A list of parser names, or "all" (the five listed parsers should always be installed) + ensure_installed = { "c", "lua", "vim", "vimdoc", "query", "haskell", "go", "bash" }, - -- Install parsers synchronously (only applied to `ensure_installed`) - sync_install = false, + -- Install parsers synchronously (only applied to `ensure_installed`) + sync_install = false, - -- Automatically install missing parsers when entering buffer - -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally - auto_install = true, + -- Automatically install missing parsers when entering buffer + -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally + auto_install = true, - highlight = { - enable = true, - }, + highlight = { + enable = true, + }, } diff --git a/lua/plugins/veil.lua b/lua/plugins/veil.lua index a519eb3..ab9be21 100644 --- a/lua/plugins/veil.lua +++ b/lua/plugins/veil.lua @@ -5,51 +5,56 @@ local builtin = require("veil.builtin") require("veil").setup({ - sections = { - builtin.sections.animated(builtin.headers.frames_days_of_week[current_day], { - hl = { fg = "#5de4c7" }, - }), + sections = { + builtin.sections.animated(builtin.headers.frames_days_of_week[current_day], { + hl = { fg = "#5de4c7" }, + }), + builtin.sections.buttons({ - { - icon = "", - text = "Find Files", - shortcut = "f", - callback = function() - require("telescope.builtin").find_files() - end, - }, - { - icon = "", - text = "Find Word", - shortcut = "w", - callback = function() - require("telescope.builtin").live_grep() - end, - }, - { - icon = "", - text = "Buffers", - shortcut = "b", - callback = function() - require("telescope.builtin").buffers() - end, - }, - { - icon = "", - text = "Config", - shortcut = "c", - callback = function() - require("telescope").extensions.file_browser.file_browser({ - path = vim.fn.stdpath("config"), - }) - end, - }, + { + icon = "", + text = "Config", + shortcut = "c", + callback = function() + require("telescope").extensions.file_browser.file_browser({ + path = vim.fn.stdpath("config"), + }) + end, + }, + + { + icon = "", + text = "Find Files", + shortcut = "f", + callback = function() + require("telescope.builtin").find_files() + end, + }, + + { + icon = "", + text = "Grep", + shortcut = "g", + callback = function() + require("telescope.builtin").live_grep() + end, + }, + + { + icon = "", + text = "Buffers", + shortcut = "b", + callback = function() + require("telescope.builtin").buffers() + end, + }, }), - builtin.sections.oldfiles(), - }, - mappings = {}, - startup = true, - listed = false + + builtin.sections.oldfiles(), + }, + + startup = true, + listed = true })