From ded52506b3f17d5200429141729005421121310c Mon Sep 17 00:00:00 2001 From: Ted Kulp Date: Mon, 1 Aug 2022 14:41:36 -0400 Subject: [PATCH] chore: cleanup, added neorg --- .config/lvim/config.lua | 178 +++++++++++++--------------------------- 1 file changed, 58 insertions(+), 120 deletions(-) diff --git a/.config/lvim/config.lua b/.config/lvim/config.lua index 0ee719e..94c9aaf 100644 --- a/.config/lvim/config.lua +++ b/.config/lvim/config.lua @@ -1,30 +1,21 @@ local utils = require "lvim.utils" --- general lvim.log.level = "warn" --- lvim.format_on_save = true -lvim.colorscheme = "tokyonight" --- to disable icons and use a minimalist setup, uncomment the following --- lvim.use_icons = false +lvim.colorscheme = "dracula" vim.opt.clipboard = "unnamed,unnamedplus" --- vim.opt.list = true --- vim.opt.listchars:append("eol:↴") vim.opt.guifont = "JetBrainsMono Nerd Font Mono:h12" --- keymappings [view all the defaults by pressing Lk] lvim.leader = "space" --- add your own keymapping lvim.keys.normal_mode[""] = ":w" lvim.builtin.which_key.mappings['W'] = { ":w", "Save Buffer" } lvim.format_on_save = { timeout = 5000, } -lvim.builtin.lualine.options.theme = "tokyonight" +lvim.builtin.lualine.options.theme = "dracula-nvim" +lvim.builtin.bufferline.options.show_buffer_close_icons = false +lvim.builtin.bufferline.options.numbers = "buffer_id" +lvim.builtin.bufferline.options.separator_style = "slant" --- unmap a default keymapping --- vim.keymap.del("n", "") --- override a default keymapping --- lvim.keys.normal_mode[""] = ":q" -- or vim.keymap.set("n", "", ":q" ) vim.keymap.set("n", "", "") vim.keymap.set("i", "jj", "") vim.keymap.set("i", "jk", "") @@ -32,8 +23,6 @@ vim.keymap.set("i", "kj", "") vim.opt.cursorline = true vim.opt.relativenumber = true --- Change Telescope navigation to use j and k for navigation and n and p for history in both input and normal mode. --- we use protected-mode (pcall) just in case the plugin wasn't loaded yet. local _, actions = pcall(require, "telescope.actions") lvim.builtin.telescope.defaults.mappings = { -- for input mode @@ -50,8 +39,6 @@ lvim.builtin.telescope.defaults.mappings = { }, } --- Use which-key to add extra bindings with the leader-key prefix --- lvim.builtin.which_key.mappings["P"] = { "Telescope projects", "Projects" } lvim.builtin.which_key.mappings["t"] = { name = "+Trouble", r = { "Trouble lsp_references", "References" }, @@ -69,8 +56,6 @@ lvim.builtin.which_key.mappings['w'] = { c = { "close", "Close Window" }, } --- TODO: User Config for predefined plugins --- After changing plugin config exit and reopen LunarVim, Run :PackerInstall :PackerCompile lvim.builtin.alpha.active = true lvim.builtin.alpha.mode = "dashboard" lvim.builtin.notify.active = true @@ -78,7 +63,6 @@ lvim.builtin.terminal.active = true lvim.builtin.nvimtree.setup.view.side = "left" lvim.builtin.nvimtree.setup.renderer.icons.show.git = false --- if you don't want all the parsers change this to a table of the ones you want lvim.builtin.treesitter.ensure_installed = { "bash", "c", @@ -92,99 +76,28 @@ lvim.builtin.treesitter.ensure_installed = { "rust", "java", "yaml", + "norg", } -lvim.builtin.treesitter.ignore_install = { "haskell" } lvim.builtin.treesitter.highlight.enabled = true --- generic LSP settings - --- ---@usage disable automatic installation of servers --- lvim.lsp.automatic_servers_installation = false - --- ---configure a server manually. !!Requires `:LvimCacheReset` to take effect!! --- ---see the full default list `:lua print(vim.inspect(lvim.lsp.automatic_configuration.skipped_servers))` --- vim.list_extend(lvim.lsp.automatic_configuration.skipped_servers, { "pyright" }) --- local opts = {} -- check the lspconfig documentation for a list of all possible options --- require("lvim.lsp.manager").setup("pyright", opts) - --- ---remove a server from the skipped list, e.g. eslint, or emmet_ls. !!Requires `:LvimCacheReset` to take effect!! --- ---`:LvimInfo` lists which server(s) are skiipped for the current filetype --- vim.tbl_map(function(server) --- return server ~= "emmet_ls" --- end, lvim.lsp.automatic_configuration.skipped_servers) - --- -- you can set a custom on_attach function that will be used for all the language servers --- -- See --- lvim.lsp.on_attach_callback = function(client, bufnr) --- local function buf_set_option(...) --- vim.api.nvim_buf_set_option(bufnr, ...) --- end --- --Enable completion triggered by --- buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc") --- end - --- -- set a formatter, this will override the language server formatting capabilities (if it exists) --- local formatters = require "lvim.lsp.null-ls.formatters" --- formatters.setup { --- { command = "black", filetypes = { "python" } }, --- { command = "isort", filetypes = { "python" } }, --- { --- -- each formatter accepts a list of options identical to https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/doc/BUILTINS.md#Configuration --- command = "prettier", --- ---@usage arguments to pass to the formatter --- -- these cannot contain whitespaces, options such as `--line-width 80` become either `{'--line-width', '80'}` or `{'--line-width=80'}` --- extra_args = { "--print-with", "100" }, --- ---@usage specify which filetypes to enable. By default a providers will attach to all the filetypes it supports. --- filetypes = { "typescript", "typescriptreact" }, --- }, --- } - --- -- set additional linters --- local linters = require "lvim.lsp.null-ls.linters" --- linters.setup { --- { command = "flake8", filetypes = { "python" } }, --- { --- -- each linter accepts a list of options identical to https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/doc/BUILTINS.md#Configuration --- command = "shellcheck", --- ---@usage arguments to pass to the formatter --- -- these cannot contain whitespaces, options such as `--line-width 80` become either `{'--line-width', '80'}` or `{'--line-width=80'}` --- extra_args = { "--severity", "warning" }, --- }, --- { --- command = "codespell", --- ---@usage specify which filetypes to enable. By default a providers will attach to all the filetypes it supports. --- filetypes = { "javascript", "python" }, --- }, --- } - --- Additional Plugins --- lvim.plugins = { --- {"folke/tokyonight.nvim"}, --- { --- "folke/trouble.nvim", --- cmd = "TroubleToggle", --- }, --- } - --- Autocommands (https://neovim.io/doc/user/autocmd.html) --- vim.api.nvim_create_autocmd("BufEnter", { --- pattern = { "*.json", "*.jsonc" }, --- -- enable wrap mode for json files only --- command = "setlocal wrap", --- }) --- vim.api.nvim_create_autocmd("FileType", { --- pattern = "zsh", --- callback = function() --- -- let treesitter use bash highlight for zsh files as well --- require("nvim-treesitter.highlight").attach(0, "bash") --- end, --- }) - lvim.plugins = { { "folke/tokyonight.nvim", }, + { + "rebelot/kanagawa.nvim", + }, + { + "lunarvim/horizon.nvim", + }, + { + "Mofiqul/dracula.nvim", + config = function() + vim.g.dracula_show_end_of_buffer = true + vim.g.dracula_italic_comment = true + end, + }, { "chiedo/vim-case-convert" }, @@ -268,25 +181,16 @@ lvim.plugins = { }, }) end, - }, { "tpope/vim-repeat" }, { - "ethanholz/nvim-lastplace", - event = "BufRead", + "vladdoster/remember.nvim", config = function() - require("nvim-lastplace").setup({ - lastplace_ignore_buftype = { "quickfix", "nofile", "help" }, - lastplace_ignore_filetype = { - "gitcommit", - "gitrebase", - "svn", - "hgcommit", - }, - lastplace_open_folds = true, - }) + require("remember").setup { + open_folds = true, + } end, }, { @@ -330,7 +234,7 @@ lvim.plugins = { event = "BufRead", config = function() require("spectre").setup() - lvim.builtin.which_key.mappings["S"] = { "lua require('spectre').open()", "Spectre Search" } + lvim.builtin.which_key.mappings["sS"] = { "lua require('spectre').open()", "Spectre Search" } end, }, { @@ -432,12 +336,46 @@ lvim.plugins = { vim.keymap.set("i", "", "PickEverythingInsert", { noremap = true, silent = true }) -- opt-i on Mac end, }, + { + "nvim-neorg/neorg", + config = function() + require('neorg').setup { + load = { + ["core.defaults"] = {}, + ["core.norg.concealer"] = {}, + ["core.norg.completion"] = { + config = { + engine = "nvim-cmp", + }, + }, + } + } + + vim.list_extend(lvim.builtin.cmp.sources, { + { name = "neorg" }, + }) + end, + requires = "nvim-lua/plenary.nvim", + }, } -- luasnip jumps vim.keymap.set("i", "", "lua require('luasnip').jump(1)", { noremap = true, silent = true }) vim.keymap.set("i", "", "lua require('luasnip').jump(-1)", { noremap = true, silent = true }) +function Dump(o) + if type(o) == 'table' then + local s = '{ ' + for k, v in pairs(o) do + if type(k) ~= 'number' then k = '"' .. k .. '"' end + s = s .. '[' .. k .. '] = ' .. Dump(v) .. ',' + end + return s .. '} ' + else + return tostring(o) + end +end + -- set additional formatters local formatters = require "lvim.lsp.null-ls.formatters" formatters.setup {