summaryrefslogtreecommitdiff
path: root/.config/nvim
diff options
context:
space:
mode:
authorBenjamin Chausse <benjamin@chausse.xyz>2023-09-19 18:14:31 -0400
committerBenjamin Chausse <benjamin@chausse.xyz>2023-09-19 18:14:31 -0400
commit1d1039dfd58c3295c03f98a1890fb67f1bf98a46 (patch)
treeb8479436202043fbf1ca75b694e86c781f05c683 /.config/nvim
parent4bbb06a49fc3999bfd9ac17a5f3093963c9e595e (diff)
Nvim lua test
Diffstat (limited to '.config/nvim')
-rw-r--r--.config/nvim/after/plugin/colors.lua8
-rw-r--r--.config/nvim/after/plugin/fugitive.lua1
-rw-r--r--.config/nvim/after/plugin/harpoon.lua10
-rw-r--r--.config/nvim/after/plugin/lsp.lua4
-rw-r--r--.config/nvim/after/plugin/orgmode.lua20
-rw-r--r--.config/nvim/after/plugin/telescope.lua7
-rw-r--r--.config/nvim/after/plugin/treesitter.lua34
-rw-r--r--.config/nvim/after/plugin/undotree.lua1
-rw-r--r--.config/nvim/init.lua1
-rw-r--r--.config/nvim/lua/ben/init.lua3
-rw-r--r--.config/nvim/lua/ben/packer.lua43
-rw-r--r--.config/nvim/lua/ben/remap.lua2
12 files changed, 134 insertions, 0 deletions
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", "<leader>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", "<leader>a", mark.add_file)
+vim.keymap.set("n", "<C-e>", ui.toggle_quick_menu)
+
+vim.keymap.set("n", "<C-h>", function() ui.nav_file(1) end)
+vim.keymap.set("n", "<C-t>", function() ui.nav_file(2) end)
+vim.keymap.set("n", "<C-n>", function() ui.nav_file(3) end)
+vim.keymap.set("n", "<C-s>", 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', '<leader>ff', builtin.find_files, {})
+vim.keymap.set('n', '<leader>fg', builtin.git_files, {})
+vim.keymap.set('n', '<leader>fb', builtin.buffers, {})
+vim.keymap.set('n', '<leader>fh', builtin.help_tags, {})
+vim.keymap.set('n', '<leader>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", "<leader>u", vim.cmd.UndotreeToggle)
diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua
new file mode 100644
index 0000000..32d840c
--- /dev/null
+++ b/.config/nvim/init.lua
@@ -0,0 +1 @@
+require("ben")
diff --git a/.config/nvim/lua/ben/init.lua b/.config/nvim/lua/ben/init.lua
new file mode 100644
index 0000000..f774278
--- /dev/null
+++ b/.config/nvim/lua/ben/init.lua
@@ -0,0 +1,3 @@
+require("ben.remap")
+require("ben.packer")
+
diff --git a/.config/nvim/lua/ben/packer.lua b/.config/nvim/lua/ben/packer.lua
new file mode 100644
index 0000000..c17f4e2
--- /dev/null
+++ b/.config/nvim/lua/ben/packer.lua
@@ -0,0 +1,43 @@
+---Only required if you have packer configured as `opt`
+vim.cmd [[packadd packer.nvim]]
+
+return require('packer').startup(function(use)
+ -- Packer can manage itself
+ use 'wbthomason/packer.nvim'
+ use {
+ 'nvim-telescope/telescope.nvim', tag = '0.1.3',
+ -- or , branch = '0.1.x',
+ requires = { {'nvim-lua/plenary.nvim'} }
+ }
+ use({
+ 'sainnhe/everforest',
+ config = function()
+ vim.cmd('colorscheme everforest')
+ end
+ })
+ use ('ChausseBenjamin/friffle-vim')
+ use('nvim-treesitter/nvim-treesitter', {run = ':TSUpdate'})
+ use('theprimeagen/harpoon')
+ use('mbbill/undotree')
+ use('tpope/vim-fugitive')
+ use('tpope/vim-surround')
+ use {
+ 'VonHeikemen/lsp-zero.nvim',
+ branch = 'v2.x',
+ requires = {
+ -- LSP Support
+ {'neovim/nvim-lspconfig'}, -- Required
+ {'williamboman/mason.nvim'}, -- Optional
+ {'williamboman/mason-lspconfig.nvim'}, -- Optional
+ -- Autocompletion
+ {'hrsh7th/nvim-cmp'}, -- Required
+ {'hrsh7th/cmp-nvim-lsp'}, -- Required
+ {'L3MON4D3/LuaSnip'}, -- Required
+ }
+ }
+ use {'nvim-treesitter/nvim-treesitter'}
+ use {'nvim-orgmode/orgmode', config = function()
+ require('orgmode').setup{}
+ end}
+ use ('github/copilot.nvim')
+end)
diff --git a/.config/nvim/lua/ben/remap.lua b/.config/nvim/lua/ben/remap.lua
new file mode 100644
index 0000000..b760350
--- /dev/null
+++ b/.config/nvim/lua/ben/remap.lua
@@ -0,0 +1,2 @@
+vim.g.mapleader = " "
+vim.keymap.set("n", "<leader>pv", vim.cmd.Ex)