Compare commits

...

7 Commits

Author SHA1 Message Date
8a5a13a628 add plugins nvim-surround and comment 2023-07-13 11:37:34 +02:00
22c7b31aa4 fixing autoclose 2023-07-13 11:36:53 +02:00
80f9fb8f77 update telescope to 0.1.2 2023-07-12 22:32:34 +02:00
3141de1d5f cleanup 2023-07-12 22:31:54 +02:00
860c21b165 replace fugitive with neogit 2023-07-12 22:27:48 +02:00
82d660f8c0 switching harpoon shortcut to leader+h 2023-07-12 22:14:04 +02:00
1d8253db4b Remove unessesary keymap + switch to better filepicker keymap 2023-07-12 22:09:00 +02:00
11 changed files with 182 additions and 29 deletions

View File

@ -1 +1,23 @@
require("autoclose").setup()
-- Close brackets
local config = {
keys = {
["("] = { escape = false, close = true, pair = "()", disabled_filetypes = {} },
["["] = { escape = false, close = true, pair = "[]", disabled_filetypes = {} },
["{"] = { escape = false, close = true, pair = "{}", disabled_filetypes = {} },
[">"] = { escape = true, close = false, pair = "<>", disabled_filetypes = {} },
[")"] = { escape = true, close = false, pair = "()", disabled_filetypes = {} },
["]"] = { escape = true, close = false, pair = "[]", disabled_filetypes = {} },
["}"] = { escape = true, close = false, pair = "{}", disabled_filetypes = {} },
['"'] = { escape = true, close = true, pair = '""', disabled_filetypes = {} },
["'"] = { escape = true, close = true, pair = "''", disabled_filetypes = {} },
["`"] = { escape = true, close = true, pair = "``", disabled_filetypes = {} },
},
options = {
disabled_filetypes = { "text", "markdown" },
disable_when_touch = false,
pair_spaces = false,
auto_indent = true,
},
}

View File

@ -1,3 +1,4 @@
-- pretty location at the top
require("barbecue").setup({
---Whether to attach navic to language servers automatically.
---

View File

@ -1 +0,0 @@
vim.keymap.set("n", "<leader>gs", vim.cmd.Git);

View File

@ -1,8 +1,9 @@
-- fast switching between files
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", "<leader>h", ui.toggle_quick_menu)
vim.keymap.set("n", "<C-h>", function() ui.nav_file(1) end)
vim.keymap.set("n", "<C-j>", function() ui.nav_file(2) end)

View File

@ -1,3 +1,4 @@
-- language server manager (via Mason)
local lsp = require('lsp-zero').preset({})
lsp.on_attach(function(client, bufnr)

102
after/plugin/neogit.lua Normal file
View File

@ -0,0 +1,102 @@
-- git manager
local neogit = require("neogit")
vim.keymap.set("n", "<leader>g", vim.cmd.Neogit)
neogit.setup {
disable_signs = false,
disable_hint = false,
disable_context_highlighting = false,
disable_commit_confirmation = false,
-- Neogit refreshes its internal state after specific events, which can be expensive depending on the repository size.
-- Disabling `auto_refresh` will make it so you have to manually refresh the status after you open it.
auto_refresh = true,
-- Value used for `--sort` option for `git branch` command
-- By default, branches will be sorted by commit date descending
-- Flag description: https://git-scm.com/docs/git-branch#Documentation/git-branch.txt---sortltkeygt
-- Sorting keys: https://git-scm.com/docs/git-for-each-ref#_options
sort_branches = "-committerdate",
disable_builtin_notifications = false,
use_magit_keybindings = false,
-- Change the default way of opening neogit
kind = "vsplit",
-- The time after which an output console is shown for slow running commands
console_timeout = 2000,
-- Automatically show console if a command takes more than console_timeout milliseconds
auto_show_console = true,
-- Persist the values of switches/options within and across sessions
remember_settings = true,
-- Scope persisted settings on a per-project basis
use_per_project_settings = true,
-- Array-like table of settings to never persist. Uses format "Filetype--cli-value"
-- ie: `{ "NeogitCommitPopup--author", "NeogitCommitPopup--no-verify" }`
ignored_settings = {},
-- Change the default way of opening the commit popup
commit_popup = {
kind = "split",
},
-- Change the default way of opening the preview buffer
preview_buffer = {
kind = "split",
},
-- Change the default way of opening popups
popup = {
kind = "split",
},
-- customize displayed signs
signs = {
-- { CLOSED, OPENED }
section = { ">", "v" },
item = { ">", "v" },
hunk = { "", "" },
},
integrations = {
-- Neogit only provides inline diffs. If you want a more traditional way to look at diffs, you can use `sindrets/diffview.nvim`.
-- The diffview integration enables the diff popup, which is a wrapper around `sindrets/diffview.nvim`.
--
-- Requires you to have `sindrets/diffview.nvim` installed.
-- use {
-- 'TimUntersberger/neogit',
-- requires = {
-- 'nvim-lua/plenary.nvim',
-- 'sindrets/diffview.nvim'
-- }
-- }
--
diffview = false
},
-- Setting any section to `false` will make the section not render at all
sections = {
untracked = {
folded = false
},
unstaged = {
folded = false
},
staged = {
folded = false
},
stashes = {
folded = true
},
unpulled = {
folded = true
},
unmerged = {
folded = false
},
recent = {
folded = true
},
},
-- override/add mappings
mappings = {
-- modify status buffer mappings
status = {
-- Adds a mapping with "B" as key that does the "BranchPopup" command
["B"] = "BranchPopup",
-- Removes the default mapping of "s"
["s"] = "",
}
}
}

View File

@ -1,3 +1,4 @@
-- finding files in working dir and repo
local builtin = require('telescope.builtin')
vim.keymap.set('n', '<leader>ff', builtin.find_files, {})
vim.keymap.set('n', '<leader>pf', builtin.git_files, {})

View File

@ -1,3 +1,4 @@
-- parsing and highlighting
require'nvim-treesitter.configs'.setup {
-- A list of parser names, or "all" (the five listed parsers should always be installed)
ensure_installed = { "python", "javascript", "typescript", "php", "c", "rust", "bash", "lua", "vim", "vimdoc", "query" },

View File

@ -1 +1,2 @@
-- advanced undo history
vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle)

View File

@ -8,34 +8,64 @@ return require('packer').startup(function(use)
use 'wbthomason/packer.nvim'
-- treesitter
use('nvim-treesitter/nvim-treesitter', {run = ':TSUpdate'})
use('nvim-treesitter/playground')
use('nvim-treesitter/nvim-treesitter-context')
use ('nvim-treesitter/nvim-treesitter', {run = ':TSUpdate'})
use ('nvim-treesitter/playground')
use ('nvim-treesitter/nvim-treesitter-context')
-- useful
use {
'nvim-telescope/telescope.nvim', tag = '0.1.1',
requires = { {'nvim-lua/plenary.nvim'} }
'nvim-telescope/telescope.nvim', tag = '0.1.2',
requires = 'nvim-lua/plenary.nvim'
}
use('ThePrimeagen/harpoon')
use('mbbill/undotree')
use('tpope/vim-fugitive')
use('m4xshen/autoclose.nvim')
use {
'ThePrimeagen/harpoon',
requires = 'nvim-lua/plenary.nvim'
}
use {
'NeogitOrg/neogit',
requires = 'nvim-lua/plenary.nvim'
}
use({
"kylechui/nvim-surround",
tag = "*", -- Use for stability; omit to use `main` branch for the latest features
config = function()
require("nvim-surround").setup()
end
})
use {
'numToStr/Comment.nvim',
config = function()
require('Comment').setup()
end
}
use ('mbbill/undotree')
use {
'm4xshen/autoclose.nvim',
config = function ()
require("autoclose").setup()
end
}
-- pretty
use({
use {
'catppuccin/nvim',
as = 'mocha',
config = function()
vim.cmd('colorscheme catppuccin-mocha')
end
})
}
use({
"utilyre/barbecue.nvim",
tag = "*",
use {
"utilyre/barbecue.nvim", tag = "*",
requires = {
"SmiteshP/nvim-navic",
"nvim-tree/nvim-web-devicons", -- optional dependency
@ -44,10 +74,11 @@ return require('packer').startup(function(use)
config = function()
require("barbecue").setup()
end,
})
}
-- lsp
use ({
use {
'VonHeikemen/lsp-zero.nvim',
branch = 'v2.x',
requires = {
@ -66,5 +97,5 @@ return require('packer').startup(function(use)
{'hrsh7th/cmp-nvim-lsp'}, -- Required
{'L3MON4D3/LuaSnip'}, -- Required
}
})
}
end)

View File

@ -1,14 +1,7 @@
vim.g.mapleader = " "
-- sevi-kun
vim.keymap.set("n", "<C-n>", vim.cmd.bNext)
vim.keymap.set("n", "<C-l>", vim.cmd.blast)
-- ThePrimeagen
vim.keymap.set("n", "<leader>pv", vim.cmd.Ex)
vim.keymap.set("n", "<leader>.", vim.cmd.Ex)
vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv")
vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv")