From 1d1039dfd58c3295c03f98a1890fb67f1bf98a46 Mon Sep 17 00:00:00 2001 From: Benjamin Chausse Date: Tue, 19 Sep 2023 18:14:31 -0400 Subject: Nvim lua test --- .config/nvim/after/plugin/colors.lua | 8 ++++++++ .config/nvim/after/plugin/fugitive.lua | 1 + .config/nvim/after/plugin/harpoon.lua | 10 ++++++++++ .config/nvim/after/plugin/lsp.lua | 4 ++++ .config/nvim/after/plugin/orgmode.lua | 20 +++++++++++++++++++ .config/nvim/after/plugin/telescope.lua | 7 +++++++ .config/nvim/after/plugin/treesitter.lua | 34 ++++++++++++++++++++++++++++++++ .config/nvim/after/plugin/undotree.lua | 1 + 8 files changed, 85 insertions(+) create mode 100644 .config/nvim/after/plugin/colors.lua create mode 100644 .config/nvim/after/plugin/fugitive.lua create mode 100644 .config/nvim/after/plugin/harpoon.lua create mode 100644 .config/nvim/after/plugin/lsp.lua create mode 100644 .config/nvim/after/plugin/orgmode.lua create mode 100644 .config/nvim/after/plugin/telescope.lua create mode 100644 .config/nvim/after/plugin/treesitter.lua create mode 100644 .config/nvim/after/plugin/undotree.lua (limited to '.config/nvim/after/plugin') diff --git a/.config/nvim/after/plugin/colors.lua b/.config/nvim/after/plugin/colors.lua new file mode 100644 index 0000000..33e9aaf --- /dev/null +++ b/.config/nvim/after/plugin/colors.lua @@ -0,0 +1,8 @@ +function ColorMyPencils(color) + color = color or "everforest" + vim.cmd.colorscheme(color) + vim.api.nvim_set_hl(0, "Normal", { bg = "none" }) + vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" }) +end + +ColorMyPencils() diff --git a/.config/nvim/after/plugin/fugitive.lua b/.config/nvim/after/plugin/fugitive.lua new file mode 100644 index 0000000..80c9070 --- /dev/null +++ b/.config/nvim/after/plugin/fugitive.lua @@ -0,0 +1 @@ +vim.keymap.set("n", "gs", vim.cmd.Git) diff --git a/.config/nvim/after/plugin/harpoon.lua b/.config/nvim/after/plugin/harpoon.lua new file mode 100644 index 0000000..eed35ed --- /dev/null +++ b/.config/nvim/after/plugin/harpoon.lua @@ -0,0 +1,10 @@ +local mark = require("harpoon.mark") +local ui = require("harpoon.ui") + +vim.keymap.set("n", "a", mark.add_file) +vim.keymap.set("n", "", ui.toggle_quick_menu) + +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) +vim.keymap.set("n", "", function() ui.nav_file(4) end) diff --git a/.config/nvim/after/plugin/lsp.lua b/.config/nvim/after/plugin/lsp.lua new file mode 100644 index 0000000..d39b467 --- /dev/null +++ b/.config/nvim/after/plugin/lsp.lua @@ -0,0 +1,4 @@ +local lsp = require('lsp-zero') + +lsp.preset("recomended") +lsp.setup() diff --git a/.config/nvim/after/plugin/orgmode.lua b/.config/nvim/after/plugin/orgmode.lua new file mode 100644 index 0000000..d51a4d8 --- /dev/null +++ b/.config/nvim/after/plugin/orgmode.lua @@ -0,0 +1,20 @@ +-- Load custom treesitter grammar for org filetype +require('orgmode').setup_ts_grammar() + +-- Treesitter configuration +require('nvim-treesitter.configs').setup { + -- If TS highlights are not enabled at all, or disabled via `disable` prop, + -- highlighting will fallback to default Vim syntax highlighting + highlight = { + enable = true, + -- Required for spellcheck, some LaTex highlights and + -- code block highlights that do not have ts grammar + additional_vim_regex_highlighting = {'org'}, + }, + ensure_installed = {'org'}, -- Or run :TSUpdate org +} + +require('orgmode').setup({ + org_agenda_files = {'~/Dropbox/org/*', '~/my-orgs/**/*'}, + org_default_notes_file = '~/Dropbox/org/refile.org', +}) diff --git a/.config/nvim/after/plugin/telescope.lua b/.config/nvim/after/plugin/telescope.lua new file mode 100644 index 0000000..d7b6471 --- /dev/null +++ b/.config/nvim/after/plugin/telescope.lua @@ -0,0 +1,7 @@ +local builtin = require('telescope.builtin') +vim.keymap.set('n', 'ff', builtin.find_files, {}) +vim.keymap.set('n', 'fg', builtin.git_files, {}) +vim.keymap.set('n', 'fb', builtin.buffers, {}) +vim.keymap.set('n', 'fh', builtin.help_tags, {}) +vim.keymap.set('n', 'fq', builtin.live_grep, {}) + diff --git a/.config/nvim/after/plugin/treesitter.lua b/.config/nvim/after/plugin/treesitter.lua new file mode 100644 index 0000000..c24c5d7 --- /dev/null +++ b/.config/nvim/after/plugin/treesitter.lua @@ -0,0 +1,34 @@ +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", + "latex", + "bibtex", + "csv", + "diff", + "dockerfile", + "bash", + "org", + "go" + }, + + -- 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, + + highlight = { + enable = true, + + -- Setting this to true will run `:h syntax` and tree-sitter at the same time. + -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). + -- Using this option may slow down your editor, and you may see some duplicate highlights. + -- Instead of true it can also be a list of languages + additional_vim_regex_highlighting = false, + }, +} diff --git a/.config/nvim/after/plugin/undotree.lua b/.config/nvim/after/plugin/undotree.lua new file mode 100644 index 0000000..b6b9276 --- /dev/null +++ b/.config/nvim/after/plugin/undotree.lua @@ -0,0 +1 @@ +vim.keymap.set("n", "u", vim.cmd.UndotreeToggle) -- cgit v1.2.3