From 150e21702e4a3257d06f603d3244c67c2a253090 Mon Sep 17 00:00:00 2001 From: agryphus Date: Mon, 25 Sep 2023 17:06:11 -0400 Subject: [PATCH] Org mode / quality of life stuff --- after/ftplugin/norg.lua | 4 ++ after/plugin/colors.lua | 105 +++++++++++++++++++++++++++++++++++++ after/plugin/dashboard.lua | 0 after/plugin/firenvim.lua | 7 ++- after/plugin/lf.lua | 8 +++ after/plugin/neorg.lua | 20 +++++++ after/plugin/nvimtree.lua | 2 +- after/plugin/telescope.lua | 2 + after/plugin/undotree.lua | 2 + after/plugin/zenmode.lua | 62 ++++++++++++++++++++++ lua/andrew/packer.lua | 27 ++++++++++ lua/andrew/set.lua | 2 +- 12 files changed, 238 insertions(+), 3 deletions(-) create mode 100644 after/ftplugin/norg.lua create mode 100644 after/plugin/dashboard.lua create mode 100644 after/plugin/lf.lua create mode 100644 after/plugin/neorg.lua create mode 100644 after/plugin/undotree.lua create mode 100644 after/plugin/zenmode.lua diff --git a/after/ftplugin/norg.lua b/after/ftplugin/norg.lua new file mode 100644 index 0000000..806b55a --- /dev/null +++ b/after/ftplugin/norg.lua @@ -0,0 +1,4 @@ +vim.opt.tabstop = 2 +vim.opt.softtabstop = 2 +vim.opt.shiftwidth = 2 + diff --git a/after/plugin/colors.lua b/after/plugin/colors.lua index 54c3930..8f9f871 100644 --- a/after/plugin/colors.lua +++ b/after/plugin/colors.lua @@ -38,6 +38,111 @@ require("no-clown-fiesta").setup({ transparent = true, }) +require('rose-pine').setup({ + --- @usage 'auto'|'main'|'moon'|'dawn' + variant = 'auto', + --- @usage 'main'|'moon'|'dawn' + dark_variant = 'main', + bold_vert_split = false, + dim_nc_background = false, + disable_background = true, + disable_float_background = false, + disable_italics = true, + + --- @usage string hex value or named color from rosepinetheme.com/palette + groups = { + background = 'base', + background_nc = '_experimental_nc', + panel = 'surface', + panel_nc = 'base', + border = 'highlight_med', + comment = 'muted', + link = 'iris', + punctuation = 'subtle', + + error = 'love', + hint = 'iris', + info = 'foam', + warn = 'gold', + + headings = { + h1 = 'iris', + h2 = 'foam', + h3 = 'rose', + h4 = 'gold', + h5 = 'pine', + h6 = 'foam', + } + -- or set all headings at once + -- headings = 'subtle' + }, + + -- Change specific vim highlight groups + -- https://github.com/rose-pine/neovim/wiki/Recipes + highlight_groups = { + ColorColumn = { bg = 'rose' }, + + -- Blend colours against the "base" background + CursorLine = { bg = 'foam', blend = 10 }, + StatusLine = { fg = 'love', bg = 'love', blend = 10 }, + + -- By default each group adds to the existing config. + -- If you only want to set what is written in this config exactly, + -- you can set the inherit option: + Search = { bg = 'gold', inherit = false }, + } +}) + +require("gruvbox").setup({ + undercurl = true, + underline = true, + bold = true, + italic = { + strings = true, + comments = true, + operators = false, + folds = true, + }, + strikethrough = true, + invert_selection = false, + invert_signs = false, + invert_tabline = false, + invert_intend_guides = false, + inverse = true, -- invert background for search, diffs, statuslines and errors + contrast = "", -- can be "hard", "soft" or empty string + palette_overrides = {}, + overrides = {}, + dim_inactive = false, + transparent_mode = true, +}) + +local c = require('vscode.colors').get_colors() +require('vscode').setup({ + -- Alternatively set style in setup + -- style = 'light' + + -- Enable transparent background + transparent = true, + + -- Enable italic comment + italic_comments = true, + + -- Disable nvim-tree background color + disable_nvimtree_bg = true, + + -- Override colors (see ./lua/vscode/colors.lua) + color_overrides = { + -- vscLineNumber = '#FFFFFF', + }, + + -- Override highlight groups (see ./lua/vscode/theme.lua) + group_overrides = { + -- this supports the same val table as vim.api.nvim_set_hl + -- use colors from this colorscheme by requiring vscode.colors! + Cursor = { fg=c.vscDarkBlue, bg=c.vscLightGreen, bold=true }, + } +}) + vim.cmd[[ let s:base03 = [ '#151513', 233 ] let s:base02 = [ '#202020', 236 ] diff --git a/after/plugin/dashboard.lua b/after/plugin/dashboard.lua new file mode 100644 index 0000000..e69de29 diff --git a/after/plugin/firenvim.lua b/after/plugin/firenvim.lua index d937c09..fb14f4b 100644 --- a/after/plugin/firenvim.lua +++ b/after/plugin/firenvim.lua @@ -7,7 +7,7 @@ vim.g.firenvim_config = { priority = 0, selector = "textarea", takeover = "never" - } + }, } } @@ -16,3 +16,8 @@ if vim.g.started_by_firenvim == true then vim.opt.scrolloff = 0 end +vim.api.nvim_create_autocmd({'BufEnter'}, { + pattern = "localhost_*.txt", + command = "set filetype=python" +}) + diff --git a/after/plugin/lf.lua b/after/plugin/lf.lua new file mode 100644 index 0000000..cef1309 --- /dev/null +++ b/after/plugin/lf.lua @@ -0,0 +1,8 @@ +vim.keymap.set("n", "e", function () + vim.g.lf_command_override = string.format('LF_OVERRIDE_X=%d LF_OVERRIDE_Y=%d lf', + math.floor(vim.go.columns * 0.5), + math.ceil(vim.go.lines * 0.25) + ) + vim.cmd("Lf") +end) + diff --git a/after/plugin/neorg.lua b/after/plugin/neorg.lua new file mode 100644 index 0000000..2d92488 --- /dev/null +++ b/after/plugin/neorg.lua @@ -0,0 +1,20 @@ +require('neorg').setup { + load = { + ["core.defaults"] = {}, + ["core.concealer"] = {}, + ["core.dirman"] = { + config = { + workspaces = { + notes = "~/dox/norg/notes", + school = "~/school/", + }, + }, + }, + }, +} + +vim.api.nvim_create_autocmd({"BufEnter", "BufWinEnter"}, { + pattern = {"*.norg"}, + command = "set conceallevel=3" +}) + diff --git a/after/plugin/nvimtree.lua b/after/plugin/nvimtree.lua index c015d85..4643fac 100644 --- a/after/plugin/nvimtree.lua +++ b/after/plugin/nvimtree.lua @@ -3,7 +3,7 @@ vim.opt.termguicolors = true require("nvim-tree").setup() -vim.keymap.set("n", "pt", ":NvimTreeToggle") +vim.keymap.set("n", "pt", vim.cmd.NvimTreeToggle) -- sets transparent background vim.cmd[[hi NvimTreeNormal guibg=NONE ctermbg=NONE]] diff --git a/after/plugin/telescope.lua b/after/plugin/telescope.lua index 2616dc6..a28bf87 100644 --- a/after/plugin/telescope.lua +++ b/after/plugin/telescope.lua @@ -1,8 +1,10 @@ local builtin = require("telescope.builtin") + vim.keymap.set("n", "pf", builtin.find_files, {}) vim.keymap.set("n", "ps", function() builtin.grep_string({ search = vim.fn.input("Grep > ") }) end) +vim.keymap.set("n", "ht", builtin.colorscheme, {}) require("telescope").setup{ defaults = { diff --git a/after/plugin/undotree.lua b/after/plugin/undotree.lua new file mode 100644 index 0000000..48822a4 --- /dev/null +++ b/after/plugin/undotree.lua @@ -0,0 +1,2 @@ +vim.keymap.set("n", "ut", vim.cmd.UndotreeToggle) + diff --git a/after/plugin/zenmode.lua b/after/plugin/zenmode.lua new file mode 100644 index 0000000..5459116 --- /dev/null +++ b/after/plugin/zenmode.lua @@ -0,0 +1,62 @@ +require('zen-mode').setup { + window = { + backdrop = 0.95, -- shade the backdrop of the Zen window. Set to 1 to keep the same as Normal + -- height and width can be: + -- * an absolute number of cells when > 1 + -- * a percentage of the width / height of the editor when <= 1 + -- * a function that returns the width or the height + width = 120, -- width of the Zen window + height = 1, -- height of the Zen window + -- by default, no options are changed for the Zen window + -- uncomment any of the options below, or add other vim.wo options you want to apply + options = { + signcolumn = "no", -- disable signcolumn + number = false, -- disable number column + relativenumber = false, -- disable relative numbers + cursorline = false, -- disable cursorline + cursorcolumn = false, -- disable cursor column + foldcolumn = "0", -- disable fold column + -- list = false, -- disable whitespace characters + }, + }, + plugins = { + -- disable some global vim options (vim.o...) + -- comment the lines to not apply the options + options = { + enabled = true, + ruler = false, -- disables the ruler text in the cmd line area + showcmd = false, -- disables the command in the last line of the screen + }, + twilight = { enabled = true }, -- enable to start Twilight when zen mode opens + gitsigns = { enabled = false }, -- disables git signs + tmux = { enabled = false }, -- disables the tmux statusline + -- this will change the font size on kitty when in zen mode + -- to make this work, you need to set the following kitty options: + -- - allow_remote_control socket-only + -- - listen_on unix:/tmp/kitty + kitty = { + enabled = false, + font = "+4", -- font size increment + }, + -- this will change the font size on alacritty when in zen mode + -- requires Alacritty Version 0.10.0 or higher + -- uses `alacritty msg` subcommand to change font size + alacritty = { + enabled = false, + font = "14", -- font size + }, + -- this will change the font size on wezterm when in zen mode + -- See alse also the Plugins/Wezterm section in this projects README + wezterm = { + enabled = false, + -- can be either an absolute font size or the number of incremental steps + font = "+4", -- (10% increase per step) + }, + }, + -- callback where you can add custom code when the Zen window opens + on_open = function(win) + end, + -- callback where you can add custom code when the Zen window closes + on_close = function() + end, +} diff --git a/lua/andrew/packer.lua b/lua/andrew/packer.lua index 57ec3f1..e30cfca 100644 --- a/lua/andrew/packer.lua +++ b/lua/andrew/packer.lua @@ -9,6 +9,27 @@ return require("packer").startup(function(use) run = ":Neorg sync-parsers", } + -- Dashboard + use { + 'glepnir/dashboard-nvim', + event = 'VimEnter', + requires = {'nvim-tree/nvim-web-devicons'}, + config = function() + require('dashboard').setup { + -- config + } + end, + } + + -- File manager in nvim + use { + "ptzz/lf.vim", + requires = { {"voldikss/vim-floaterm"} }, + } + + -- Zen mode + use "folke/zen-mode.nvim" + -- Find files and strings use { "nvim-telescope/telescope.nvim", tag = "0.1.0", @@ -20,6 +41,9 @@ return require("packer").startup(function(use) -- Themes use "aktersnurra/no-clown-fiesta.nvim" + use "ellisonleao/gruvbox.nvim" + use { 'rose-pine/neovim', as = 'rose-pine' } + use 'Mofiqul/vscode.nvim' -- Referencing a hex code highlights it in that color use "lilydjwg/colorizer" @@ -27,6 +51,9 @@ return require("packer").startup(function(use) -- Relative line numbers disappear when not actively in buffer use "jeffkreeftmeijer/vim-numbertoggle" + -- History visualizer + use "mbbill/undotree" + -- See function signatures when typing them use "ray-x/lsp_signature.nvim" require "lsp_signature".setup({}) diff --git a/lua/andrew/set.lua b/lua/andrew/set.lua index 75ca996..300ab88 100644 --- a/lua/andrew/set.lua +++ b/lua/andrew/set.lua @@ -1,4 +1,4 @@ -vim.opt.guicursor = "" +-- vim.opt.guicursor = "" vim.opt.nu = true vim.opt.relativenumber = true