summaryrefslogtreecommitdiff
path: root/after
diff options
context:
space:
mode:
Diffstat (limited to 'after')
-rw-r--r--after/plugin/colors.lua40
-rw-r--r--after/plugin/fugitive.lua5
-rw-r--r--after/plugin/lsp.lua17
-rw-r--r--after/plugin/telescope.lua6
-rw-r--r--after/plugin/treesitter.lua21
-rw-r--r--after/plugin/undotree.lua1
6 files changed, 90 insertions, 0 deletions
diff --git a/after/plugin/colors.lua b/after/plugin/colors.lua
new file mode 100644
index 0000000..37afa2f
--- /dev/null
+++ b/after/plugin/colors.lua
@@ -0,0 +1,40 @@
+require("gruvbox").setup({
+ terminal_colors = true, -- add neovim terminal colors
+ undercurl = true,
+ underline = true,
+ bold = true,
+ italic = {
+ strings = true,
+ emphasis = 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 = false,
+})
+
+vim.cmd("colorscheme gruvbox")
+
+function SetFocusColors(mode)
+ if mode == 'light' then
+ vim.opt.cursorline = false
+ vim.opt.colorcolumn = '0'
+ vim.cmd("colorscheme paper")
+ end
+
+ if mode == 'dark' then
+ vim.opt.cursorline = true
+ vim.opt.colorcolumn = '120'
+ vim.cmd("colorscheme atlas")
+ end
+end
diff --git a/after/plugin/fugitive.lua b/after/plugin/fugitive.lua
new file mode 100644
index 0000000..a8aa35c
--- /dev/null
+++ b/after/plugin/fugitive.lua
@@ -0,0 +1,5 @@
+vim.keymap.set("n", "<leader>gs", vim.cmd.Git)
+vim.keymap.set("n", "<leader>gb", ":Git blame<CR>")
+-- see docs for more details
+vim.keymap.set("n", "<leader>gk", ":diffget //3<CR>") -- get diff from upstream (merge)
+vim.keymap.set("n", "<leader>gj", ":diffget //2<CR>") -- get diff from downstream (target)
diff --git a/after/plugin/lsp.lua b/after/plugin/lsp.lua
new file mode 100644
index 0000000..0bc840d
--- /dev/null
+++ b/after/plugin/lsp.lua
@@ -0,0 +1,17 @@
+local lsp = require('lsp-zero').preset({})
+
+local function allow_format(servers)
+ return function(client) return vim.tbl_contains(servers, client.name) end
+end
+
+
+-- TODO: add bindings to work when no lsp available, to allow normal functionality
+lsp.on_attach(function(client, bufnr)
+ -- see :help lsp-zero-keybindings
+ -- to learn the available actions
+ lsp.default_keymaps({buffer = bufnr})
+
+ local opts = {buffer = bufnr}
+end)
+
+lsp.setup()
diff --git a/after/plugin/telescope.lua b/after/plugin/telescope.lua
new file mode 100644
index 0000000..4806008
--- /dev/null
+++ b/after/plugin/telescope.lua
@@ -0,0 +1,6 @@
+local builtin = require('telescope.builtin')
+vim.keymap.set('n', '<leader>pf', builtin.find_files, {})
+vim.keymap.set('n', '<C-p>', builtin.git_files, {})
+vim.keymap.set('n', '<leader>ps', function()
+ builtin.grep_string({ search = vim.fn.input("Grep > ") });
+end)
diff --git a/after/plugin/treesitter.lua b/after/plugin/treesitter.lua
new file mode 100644
index 0000000..d0ee3dc
--- /dev/null
+++ b/after/plugin/treesitter.lua
@@ -0,0 +1,21 @@
+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", "javascript", "typescript", "python", "cpp"},
+
+ -- 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/after/plugin/undotree.lua b/after/plugin/undotree.lua
new file mode 100644
index 0000000..a346462
--- /dev/null
+++ b/after/plugin/undotree.lua
@@ -0,0 +1 @@
+vim.keymap.set('n', '<leader>u', vim.cmd.UndotreeToggle)