feat(initial): add all dotfiles
This commit is contained in:
5
.gitignore
vendored
5
.gitignore
vendored
@@ -1 +1,6 @@
|
|||||||
op
|
op
|
||||||
|
glab-cli/config.yml
|
||||||
|
glab-cli/**/mr.json
|
||||||
|
**/.DS_Store
|
||||||
|
**/lazy-lock.json
|
||||||
|
github-copilot/hosts.json
|
||||||
|
|||||||
1
github-copilot/versions.json
Normal file
1
github-copilot/versions.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"copilot.lua":"1.13.0"}
|
||||||
2
glab-cli/aliases.yml
Normal file
2
glab-cli/aliases.yml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
ci: pipeline ci
|
||||||
|
co: mr checkout
|
||||||
1
iterm2/AppSupport
Symbolic link
1
iterm2/AppSupport
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/Users/oliverhnat/Library/Application Support/iTerm2
|
||||||
2
nvim/.gitignore
vendored
Normal file
2
nvim/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
.DS_Store
|
||||||
|
lazy-lock.json
|
||||||
15
nvim/README.md
Normal file
15
nvim/README.md
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
# Info
|
||||||
|
On the master branch is my current nvim configuration. On v2.0 is the nvchad configuration that I used to use before.
|
||||||
|
|
||||||
|
## Todo:
|
||||||
|
- [x] When scrolling too much right, and then coming back, the screen doesn't come back as quickly
|
||||||
|
- [x] Add null-ls for formatting
|
||||||
|
- [x] Choose a theme
|
||||||
|
- [x] Change the color of the autocomplete
|
||||||
|
- [x] Make comments work
|
||||||
|
- [x] Delete tab when navigating out if it's not saved in harpoon
|
||||||
|
- [x] Add git to signcolumn
|
||||||
|
- [x] gitsigns not working
|
||||||
|
- [x] change ctrl L to ctrl ; for copilot, because clashing with ctrl l for moving in insert mode
|
||||||
|
- [ ] change my default lsp to something else
|
||||||
|
- [ ] figure out how to use emmet snips and autocomplete for commonly used functions like `if __name__ == "__main__":` etc
|
||||||
1
nvim/init.lua
Normal file
1
nvim/init.lua
Normal file
@@ -0,0 +1 @@
|
|||||||
|
require("olinpin")
|
||||||
21
nvim/lua/lspconfig/prolog_lsp.lua
Normal file
21
nvim/lua/lspconfig/prolog_lsp.lua
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
local configs = require 'lspconfig.configs'
|
||||||
|
local util = require 'lspconfig.util'
|
||||||
|
|
||||||
|
configs.prolog_lsp = {
|
||||||
|
default_config = {
|
||||||
|
cmd = {"swipl",
|
||||||
|
"-g", "use_module(library(lsp_server)).",
|
||||||
|
"-g", "lsp_server:main",
|
||||||
|
"-t", "halt",
|
||||||
|
"--", "stdio"};
|
||||||
|
filetypes = {"prolog"};
|
||||||
|
root_dir = util.root_pattern("pack.pl");
|
||||||
|
};
|
||||||
|
docs = {
|
||||||
|
description = [[
|
||||||
|
https://github.com/jamesnvc/prolog_lsp
|
||||||
|
|
||||||
|
Prolog Language Server
|
||||||
|
]];
|
||||||
|
}
|
||||||
|
}
|
||||||
38
nvim/lua/olinpin/commands.lua
Normal file
38
nvim/lua/olinpin/commands.lua
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
function InsertDebugPrint()
|
||||||
|
local ft = vim.bo.filetype
|
||||||
|
local filename = vim.fn.expand("%:t")
|
||||||
|
local lineno = vim.fn.line(".")
|
||||||
|
local current_line = vim.fn.getline(".")
|
||||||
|
local indent = string.match(current_line, "^%s*")
|
||||||
|
local print_statement = ""
|
||||||
|
local cursor_pos = #print_statement
|
||||||
|
|
||||||
|
if ft == "go" then
|
||||||
|
print_statement = string.format('log.Printf("DEBUG: %s:%d - %%v", )', filename, lineno)
|
||||||
|
cursor_pos = #print_statement - 1
|
||||||
|
elseif ft == "python" then
|
||||||
|
print_statement = string.format('print(f"DEBUG: %s:%d")', filename, lineno)
|
||||||
|
cursor_pos = #print_statement + 2
|
||||||
|
elseif ft == "php" then
|
||||||
|
print_statement = string.format('dd("DEBUG: %s:%d ");', filename, lineno)
|
||||||
|
cursor_pos = #print_statement - 1
|
||||||
|
elseif ft == "javascript" or ft == "typescript" then
|
||||||
|
print_statement = string.format('console.log("DEBUG: %s:%d: ", );', filename, lineno)
|
||||||
|
cursor_pos = #print_statement - 1
|
||||||
|
else
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Insert the statement with the same indentation
|
||||||
|
print_statement = indent .. print_statement
|
||||||
|
vim.api.nvim_put({ print_statement }, 'l', true, true)
|
||||||
|
|
||||||
|
-- Move the cursor to the right position & go into insert mode
|
||||||
|
local cursor_line = vim.fn.line(".")
|
||||||
|
vim.fn.cursor(cursor_line, cursor_pos)
|
||||||
|
-- vim.api.nvim_command('startinsert')
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.api.nvim_set_keymap('n', '<Leader>ic', ':lua InsertDebugPrint()<CR>', { noremap = true, silent = true })
|
||||||
|
|
||||||
|
|
||||||
10
nvim/lua/olinpin/init.lua
Normal file
10
nvim/lua/olinpin/init.lua
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
require("olinpin.set")
|
||||||
|
require("olinpin.lazy")
|
||||||
|
require("olinpin.remap")
|
||||||
|
require("olinpin.commands")
|
||||||
|
|
||||||
|
-- this needs to be set after lazy
|
||||||
|
vim.o.timeoutlen = 0
|
||||||
|
-- setup prolog
|
||||||
|
require('lspconfig/prolog_lsp')
|
||||||
|
require('lspconfig').prolog_lsp.setup{}
|
||||||
14
nvim/lua/olinpin/lazy.lua
Normal file
14
nvim/lua/olinpin/lazy.lua
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||||
|
if not vim.loop.fs_stat(lazypath) then
|
||||||
|
vim.fn.system({
|
||||||
|
"git",
|
||||||
|
"clone",
|
||||||
|
"--filter=blob:none",
|
||||||
|
"https://github.com/folke/lazy.nvim.git",
|
||||||
|
"--branch=stable", -- latest stable release
|
||||||
|
lazypath,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
vim.opt.rtp:prepend(lazypath)
|
||||||
|
|
||||||
|
require("lazy").setup("olinpin.plugins")
|
||||||
87
nvim/lua/olinpin/plugins/avante.lua
Normal file
87
nvim/lua/olinpin/plugins/avante.lua
Normal file
@@ -0,0 +1,87 @@
|
|||||||
|
return {
|
||||||
|
"yetone/avante.nvim",
|
||||||
|
event = "VeryLazy",
|
||||||
|
lazy = false,
|
||||||
|
config = function(_, opts)
|
||||||
|
-- Let the plugin load first
|
||||||
|
require("avante").setup(opts)
|
||||||
|
-- Then remove the default mappings
|
||||||
|
vim.schedule(function()
|
||||||
|
vim.keymap.del({ "n", "v" }, "<leader>aa")
|
||||||
|
vim.keymap.del("n", "<leader>ar")
|
||||||
|
vim.keymap.del("v", "<leader>ae")
|
||||||
|
vim.keymap.del("n", "<leader>ah")
|
||||||
|
vim.keymap.del("n", "<leader>ad")
|
||||||
|
vim.keymap.del("n", "<leader>af")
|
||||||
|
vim.keymap.del("n", "<leader>aR")
|
||||||
|
vim.keymap.del("n", "<leader>as")
|
||||||
|
vim.keymap.del("n", "<leader>at")
|
||||||
|
end)
|
||||||
|
end,
|
||||||
|
opts = {
|
||||||
|
-- add any opts here
|
||||||
|
provider = "copilot",
|
||||||
|
copilot = {
|
||||||
|
model = "claude-3.5-sonnet",
|
||||||
|
-- max_tokens = 4096,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
build = "make",
|
||||||
|
keys = {
|
||||||
|
{
|
||||||
|
"<leader>ca",
|
||||||
|
function()
|
||||||
|
require("avante.api").ask()
|
||||||
|
end,
|
||||||
|
desc = "avante: ask",
|
||||||
|
mode = { "n", "v" },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>cr",
|
||||||
|
function()
|
||||||
|
require("avante.api").refresh()
|
||||||
|
end,
|
||||||
|
desc = "avante: refresh",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>ce",
|
||||||
|
function()
|
||||||
|
require("avante.api").edit()
|
||||||
|
end,
|
||||||
|
desc = "avante: edit",
|
||||||
|
mode = "v",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>ch",
|
||||||
|
function()
|
||||||
|
require("avante.api").hint()
|
||||||
|
end,
|
||||||
|
desc = "avante: hint",
|
||||||
|
mode = "n",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>cd",
|
||||||
|
function()
|
||||||
|
require("avante.api").debug()
|
||||||
|
end,
|
||||||
|
desc = "avante: debug",
|
||||||
|
mode = "n",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
dependencies = {
|
||||||
|
"stevearc/dressing.nvim",
|
||||||
|
"nvim-lua/plenary.nvim",
|
||||||
|
"MunifTanjim/nui.nvim",
|
||||||
|
--- The below dependencies are optional,
|
||||||
|
-- "nvim-tree/nvim-web-devicons", -- or echasnovski/mini.icons
|
||||||
|
{
|
||||||
|
-- Make sure to setup it properly if you have lazy=true
|
||||||
|
"MeanderingProgrammer/render-markdown.nvim",
|
||||||
|
-- "zbirenbaum/copilot.lua", -- for providers='copilot'
|
||||||
|
opts = {
|
||||||
|
file_types = { "markdown", "Avante" },
|
||||||
|
},
|
||||||
|
ft = { "markdown", "Avante" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
14
nvim/lua/olinpin/plugins/barbecue.lua
Normal file
14
nvim/lua/olinpin/plugins/barbecue.lua
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
return {
|
||||||
|
"utilyre/barbecue.nvim",
|
||||||
|
name = "barbecue",
|
||||||
|
event = { "VeryLazy"},
|
||||||
|
version = "*",
|
||||||
|
dependencies = {
|
||||||
|
"SmiteshP/nvim-navic",
|
||||||
|
"nvim-tree/nvim-web-devicons", -- optional dependency
|
||||||
|
},
|
||||||
|
opts = {
|
||||||
|
-- configurations go here
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
8
nvim/lua/olinpin/plugins/blankline.lua
Normal file
8
nvim/lua/olinpin/plugins/blankline.lua
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
return {
|
||||||
|
"lukas-reineke/indent-blankline.nvim",
|
||||||
|
event = "VeryLazy",
|
||||||
|
config = function ()
|
||||||
|
require("ibl").setup {
|
||||||
|
}
|
||||||
|
end
|
||||||
|
}
|
||||||
25
nvim/lua/olinpin/plugins/color.lua
Normal file
25
nvim/lua/olinpin/plugins/color.lua
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
function ColorMe(color)
|
||||||
|
color = color or "OceanicNext"
|
||||||
|
vim.cmd.colorscheme(color)
|
||||||
|
|
||||||
|
vim.api.nvim_set_hl(0, "Normal", { bg = "none" })
|
||||||
|
vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" })
|
||||||
|
end
|
||||||
|
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
'mhartington/oceanic-next',
|
||||||
|
config = function ()
|
||||||
|
-- require('oceanic-next').setup()
|
||||||
|
vim.cmd.colorscheme('OceanicNext')
|
||||||
|
vim.cmd("highlight! EndOfBuffer guibg=background guifg=background")
|
||||||
|
end
|
||||||
|
}
|
||||||
|
-- {
|
||||||
|
-- 'nxvu699134/vn-night.nvim',
|
||||||
|
-- config = function ()
|
||||||
|
-- vim.cmd.colorscheme('vn-night')
|
||||||
|
-- vim.cmd("highlight! EndOfBuffer guibg=background guifg=background")
|
||||||
|
-- end
|
||||||
|
-- }
|
||||||
|
}
|
||||||
7
nvim/lua/olinpin/plugins/colorizer.lua
Normal file
7
nvim/lua/olinpin/plugins/colorizer.lua
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
return {
|
||||||
|
'norcalli/nvim-colorizer.lua',
|
||||||
|
event = "VeryLazy",
|
||||||
|
config = function()
|
||||||
|
require('colorizer').setup()
|
||||||
|
end
|
||||||
|
}
|
||||||
17
nvim/lua/olinpin/plugins/comment.lua
Normal file
17
nvim/lua/olinpin/plugins/comment.lua
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
return {
|
||||||
|
"numToStr/Comment.nvim",
|
||||||
|
event = "VeryLazy",
|
||||||
|
lazy = false,
|
||||||
|
|
||||||
|
config = function ()
|
||||||
|
require('Comment').setup({
|
||||||
|
opleader = {
|
||||||
|
-- Line-comment toggle keymap
|
||||||
|
line = '<leader>/'
|
||||||
|
},
|
||||||
|
toggler = {
|
||||||
|
line = "<leader>/"
|
||||||
|
}
|
||||||
|
})
|
||||||
|
end
|
||||||
|
}
|
||||||
22
nvim/lua/olinpin/plugins/copilot.lua
Normal file
22
nvim/lua/olinpin/plugins/copilot.lua
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
return {
|
||||||
|
"zbirenbaum/copilot.lua",
|
||||||
|
cmd = "Copilot",
|
||||||
|
event = "InsertEnter",
|
||||||
|
config = function ()
|
||||||
|
require("copilot").setup({
|
||||||
|
suggestion = {
|
||||||
|
enabled = true,
|
||||||
|
auto_trigger = true,
|
||||||
|
keymap = {
|
||||||
|
accept = "…"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
panel = {
|
||||||
|
enabled = false,
|
||||||
|
},
|
||||||
|
filetypes = {
|
||||||
|
["."] = false,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
end
|
||||||
|
}
|
||||||
17
nvim/lua/olinpin/plugins/dadbod.lua
Normal file
17
nvim/lua/olinpin/plugins/dadbod.lua
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
return {
|
||||||
|
'kristijanhusak/vim-dadbod-ui',
|
||||||
|
dependencies = {
|
||||||
|
{ 'tpope/vim-dadbod', lazy = true },
|
||||||
|
{ 'kristijanhusak/vim-dadbod-completion', ft = { 'sql', 'mysql' }, lazy = true },
|
||||||
|
},
|
||||||
|
cmd = {
|
||||||
|
'DBUI',
|
||||||
|
'DBUIToggle',
|
||||||
|
'DBUIAddConnection',
|
||||||
|
'DBUIFindBuffer',
|
||||||
|
},
|
||||||
|
init = function()
|
||||||
|
-- Your DBUI configuration
|
||||||
|
vim.g.db_ui_use_nerd_fonts = 1
|
||||||
|
end
|
||||||
|
}
|
||||||
3
nvim/lua/olinpin/plugins/diagrams.lua
Normal file
3
nvim/lua/olinpin/plugins/diagrams.lua
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
return {
|
||||||
|
"xavierchow/vim-sequence-diagram"
|
||||||
|
}
|
||||||
11
nvim/lua/olinpin/plugins/duck.lua
Normal file
11
nvim/lua/olinpin/plugins/duck.lua
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
return {
|
||||||
|
'tamton-aquib/duck.nvim',
|
||||||
|
config = function()
|
||||||
|
local duck = require("duck")
|
||||||
|
vim.keymap.set('n', '<leader>dd', function() duck.hatch() end, {})
|
||||||
|
vim.keymap.set('n', '<leader>dc', function() duck.hatch("🐿️", 20) end, {})
|
||||||
|
vim.keymap.set('n', '<leader>dk', function() duck.cook() end, {})
|
||||||
|
vim.keymap.set('n', '<leader>dk', function() duck.cook("🐿️") end, {})
|
||||||
|
-- duck.hatch("🐿️", 20)
|
||||||
|
end
|
||||||
|
}
|
||||||
11
nvim/lua/olinpin/plugins/fugitive.lua
Normal file
11
nvim/lua/olinpin/plugins/fugitive.lua
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
return {
|
||||||
|
'tpope/vim-fugitive',
|
||||||
|
event = "VeryLazy",
|
||||||
|
config = function()
|
||||||
|
vim.keymap.set("n", "<leader>gs", vim.cmd.Git)
|
||||||
|
vim.keymap.set("n", "<leader>gpl", ":G pull<CR>", { desc = "Git pull" })
|
||||||
|
vim.keymap.set("n", "<leader>gps", ":G push<CR>", { desc = "Git push" })
|
||||||
|
vim.keymap.set("n", "<leader>gc", ":Git commit<CR>", { desc = "Git commit" })
|
||||||
|
vim.keymap.set("n", "<leader>ga", ":Gwrite<CR>", { desc = "Git add current file" })
|
||||||
|
end
|
||||||
|
}
|
||||||
56
nvim/lua/olinpin/plugins/git-conflict.lua
Normal file
56
nvim/lua/olinpin/plugins/git-conflict.lua
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
return {
|
||||||
|
-- "akinsho/git-conflict.nvim",
|
||||||
|
-- version = "*",
|
||||||
|
-- lazy = true,
|
||||||
|
-- config = function()
|
||||||
|
-- require("git-conflict").setup({
|
||||||
|
-- default_mappings = false,
|
||||||
|
-- default_commands = true, -- disable commands created by this plugin
|
||||||
|
-- disable_diagnostics = false, -- This will disable the diagnostics in a buffer whilst it is conflicted
|
||||||
|
-- list_opener = "copen", -- command or function to open the conflicts list
|
||||||
|
-- -- highlights = { -- They must have background color, otherwise the default color will be used
|
||||||
|
-- -- incoming = "DiffAdd",
|
||||||
|
-- -- current = "DiffText",
|
||||||
|
-- -- ancestor = "DiffChange",
|
||||||
|
-- -- },
|
||||||
|
-- })
|
||||||
|
--
|
||||||
|
-- local function conflict_choose(choice)
|
||||||
|
-- return function()
|
||||||
|
-- vim.cmd("GitConflictChoose" .. choice)
|
||||||
|
-- vim.cmd("AvanteConflictChoose" .. choice)
|
||||||
|
-- end
|
||||||
|
-- end
|
||||||
|
--
|
||||||
|
-- local function resolve_conflict(action)
|
||||||
|
-- if vim.fn.exists(":GitConflict") == 2 and vim.fn["git_conflict#is_conflicted"]() then
|
||||||
|
-- if action == "ours" then
|
||||||
|
-- return vim.cmd("GitConflictChooseOurs")
|
||||||
|
-- elseif action == "theirs" then
|
||||||
|
-- return vim.cmd("GitConflictChooseTheirs")
|
||||||
|
-- elseif action == "both" then
|
||||||
|
-- return vim.cmd("GitConflictChooseBoth")
|
||||||
|
-- elseif action == "none" then
|
||||||
|
-- return vim.cmd("GitConflictChooseNone")
|
||||||
|
-- end
|
||||||
|
-- elseif vim.fn.exists(":Avante") == 2 then
|
||||||
|
-- if action == "ours" then
|
||||||
|
-- return vim.cmd("AvanteChooseOurs")
|
||||||
|
-- elseif action == "theirs" then
|
||||||
|
-- return vim.cmd("AvanteChooseTheirs")
|
||||||
|
-- elseif action == "both" then
|
||||||
|
-- return vim.cmd("AvanteChooseBoth")
|
||||||
|
-- elseif action == "none" then
|
||||||
|
-- return vim.cmd("AvanteChooseNone")
|
||||||
|
-- end
|
||||||
|
-- else
|
||||||
|
-- return ""
|
||||||
|
-- end
|
||||||
|
-- end
|
||||||
|
--
|
||||||
|
-- vim.keymap.set("n", "<leader>co", resolve_conflict("ours"), { desc = "Choose Ours (Avante & Git Conflict)" })
|
||||||
|
-- vim.keymap.set("n", "<leader>ct", resolve_conflict("theirs"), { desc = "Choose Theirs (Avante & Git Conflict)"})
|
||||||
|
-- vim.keymap.set("n", "<leader>cb", resolve_conflict("both"), { desc = "Choose Both (Avante & Git Conflict)" })
|
||||||
|
-- vim.keymap.set("n", "<leader>cn", resolve_conflict("none"), { desc = "Choose None (Avante & Git Conflict)" })
|
||||||
|
-- end,
|
||||||
|
}
|
||||||
19
nvim/lua/olinpin/plugins/gitsigns.lua
Normal file
19
nvim/lua/olinpin/plugins/gitsigns.lua
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
return {
|
||||||
|
"lewis6991/gitsigns.nvim",
|
||||||
|
event = "VeryLazy",
|
||||||
|
opts = function()
|
||||||
|
return {
|
||||||
|
signs = {
|
||||||
|
add = { text = "│" },
|
||||||
|
change = { text = "│" },
|
||||||
|
delete = { text = "" },
|
||||||
|
topdelete = { text = "‾" },
|
||||||
|
changedelete = { text = "~" },
|
||||||
|
untracked = { text = "│" },
|
||||||
|
}
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
config = function()
|
||||||
|
require("gitsigns").setup()
|
||||||
|
end
|
||||||
|
}
|
||||||
65
nvim/lua/olinpin/plugins/harpoon.lua
Normal file
65
nvim/lua/olinpin/plugins/harpoon.lua
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
return {
|
||||||
|
|
||||||
|
'ThePrimeagen/harpoon',
|
||||||
|
event = "VeryLazy",
|
||||||
|
dependencies = 'nvim-lua/plenary.nvim',
|
||||||
|
config = function()
|
||||||
|
require("harpoon").setup({
|
||||||
|
tabline = true,
|
||||||
|
tabline_prefix = " ",
|
||||||
|
tabline_suffix = " ",
|
||||||
|
menu = {
|
||||||
|
width = vim.api.nvim_win_get_width(0) - 20,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
local mark = require("harpoon.mark")
|
||||||
|
local ui = require("harpoon.ui")
|
||||||
|
local harpoon = require("harpoon")
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<leader>a", mark.add_file)
|
||||||
|
vim.keymap.set("n", "<leader>x", function()
|
||||||
|
-- remove current file
|
||||||
|
mark.rm_file(vim.fn.expand('%'))
|
||||||
|
|
||||||
|
local new_marks = {}
|
||||||
|
local config = harpoon.get_mark_config()
|
||||||
|
|
||||||
|
-- loop over the current marks
|
||||||
|
for idx = 1, mark.get_length() do
|
||||||
|
local filename = config.marks[idx].filename
|
||||||
|
-- if the mark is not empty, add it to the new marks table (removes the '(empty)' file)
|
||||||
|
if filename ~= "" then
|
||||||
|
table.insert(new_marks, {
|
||||||
|
filename = filename,
|
||||||
|
row = config.marks[idx].row,
|
||||||
|
col = config.marks[idx].col,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
config.marks = new_marks
|
||||||
|
|
||||||
|
ui.nav_prev()
|
||||||
|
|
||||||
|
end)
|
||||||
|
vim.keymap.set("n", "<leader>h", ui.toggle_quick_menu)
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<leader>1", function() ui.nav_file(1) end)
|
||||||
|
vim.keymap.set("n", "<leader>2", function() ui.nav_file(2) end)
|
||||||
|
vim.keymap.set("n", "<leader>3", function() ui.nav_file(3) end)
|
||||||
|
vim.keymap.set("n", "<leader>4", function() ui.nav_file(4) end)
|
||||||
|
vim.keymap.set("n", "<leader>5", function() ui.nav_file(5) end)
|
||||||
|
vim.keymap.set("n", "<leader>6", function() ui.nav_file(6) end)
|
||||||
|
vim.keymap.set("n", "<leader>7", function() ui.nav_file(7) end)
|
||||||
|
vim.keymap.set("n", "<leader>8", function() ui.nav_file(8) end)
|
||||||
|
vim.keymap.set("n", "<leader>9", function() ui.nav_file(9) end)
|
||||||
|
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<tab>", ui.nav_next)
|
||||||
|
vim.keymap.set("n", "<S-Tab>", ui.nav_prev)
|
||||||
|
vim.cmd('highlight! HarpoonInactive guibg=NONE guifg=#63698c')
|
||||||
|
vim.cmd('highlight! HarpoonActive guibg=NONE guifg=white')
|
||||||
|
vim.cmd('highlight! HarpoonNumberActive guibg=NONE guifg=#7aa2f7')
|
||||||
|
vim.cmd('highlight! HarpoonNumberInactive guibg=NONE guifg=#7aa2f7')
|
||||||
|
vim.cmd('highlight! TabLineFill guibg=NONE guifg=background')
|
||||||
|
end
|
||||||
|
}
|
||||||
24
nvim/lua/olinpin/plugins/leap.lua
Normal file
24
nvim/lua/olinpin/plugins/leap.lua
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
return {
|
||||||
|
"ggandor/leap.nvim",
|
||||||
|
config = function ()
|
||||||
|
require('leap')
|
||||||
|
vim.keymap.set("n", "<leader>s", "<Plug>(leap-forward-to)", { desc = "Leap forward to" })
|
||||||
|
-- default mapping: `s`
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<leader>S", "<Plug>(leap-backward-to)", { desc = "Leap backward to" })
|
||||||
|
-- arguments: `{ backward = true }`
|
||||||
|
-- default mapping: `S`
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<leader>b", "<Plug>(leap-forward-till)", { desc = "Leap forward till" } )
|
||||||
|
-- arguments: `{ offset = -1, inclusive_op = true }`
|
||||||
|
-- default mapping: `x` (Visual and Operator-pending mode only)
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<leader>B", "<Plug>(leap-backward-till)", { desc = "Leap backward till" })
|
||||||
|
-- arguments: `{ backward = true, offset = 2 }`
|
||||||
|
-- default mapping: `X` (Visual and Operator-pending mode only)
|
||||||
|
|
||||||
|
-- <Plug>(leap-from-window)
|
||||||
|
-- arguments: `{ target_windows = require('leap.util').get_enterable_windows() }`
|
||||||
|
-- default mapping: `gs`
|
||||||
|
end
|
||||||
|
}
|
||||||
49
nvim/lua/olinpin/plugins/lsp.lua
Normal file
49
nvim/lua/olinpin/plugins/lsp.lua
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
return {
|
||||||
|
'VonHeikemen/lsp-zero.nvim',
|
||||||
|
branch = 'v2.x',
|
||||||
|
dependencies = {
|
||||||
|
-- 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
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
local lsp = require('lsp-zero')
|
||||||
|
|
||||||
|
lsp.preset('recommended')
|
||||||
|
|
||||||
|
lsp.on_attach(function(client, bufnr)
|
||||||
|
-- see :help lsp-zero-keybindings
|
||||||
|
-- to learn the available actions
|
||||||
|
lsp.default_keymaps({buffer = bufnr})
|
||||||
|
end)
|
||||||
|
|
||||||
|
lsp.setup_servers({'ts_ls', 'eslint', 'html', 'hls', 'gopls'})
|
||||||
|
|
||||||
|
-- require("lspconfig").html.setup({
|
||||||
|
-- filetypes = { "html", "htmldjango" },
|
||||||
|
-- init_options = {
|
||||||
|
-- configurationSection = { "html", "css", "javascript" },
|
||||||
|
-- embeddedLanguages = {
|
||||||
|
-- css = true,
|
||||||
|
-- javascript = true,
|
||||||
|
-- },
|
||||||
|
-- provideFormatter = true,
|
||||||
|
-- },
|
||||||
|
-- })
|
||||||
|
|
||||||
|
require('lspconfig').lua_ls.setup(lsp.nvim_lua_ls())
|
||||||
|
lsp.set_sign_icons({
|
||||||
|
error = '✘',
|
||||||
|
warn = '▲',
|
||||||
|
hint = '⚑',
|
||||||
|
info = '»'
|
||||||
|
})
|
||||||
|
lsp.setup()
|
||||||
|
end
|
||||||
|
}
|
||||||
11
nvim/lua/olinpin/plugins/lualine.lua
Normal file
11
nvim/lua/olinpin/plugins/lualine.lua
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
return {
|
||||||
|
'nvim-lualine/lualine.nvim',
|
||||||
|
requires = { 'nvim-tree/nvim-web-devicons', opt = true },
|
||||||
|
config = function ()
|
||||||
|
require('lualine').setup({
|
||||||
|
options = {
|
||||||
|
theme = 'ayu_mirage'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
end
|
||||||
|
}
|
||||||
6
nvim/lua/olinpin/plugins/mason.lua
Normal file
6
nvim/lua/olinpin/plugins/mason.lua
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
return {
|
||||||
|
"williamboman/mason.nvim",
|
||||||
|
config = function()
|
||||||
|
require("mason").setup()
|
||||||
|
end
|
||||||
|
}
|
||||||
33
nvim/lua/olinpin/plugins/null-ls.lua
Normal file
33
nvim/lua/olinpin/plugins/null-ls.lua
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
return {
|
||||||
|
"jay-babu/mason-null-ls.nvim",
|
||||||
|
event = { "BufReadPre", "BufNewFile" },
|
||||||
|
dependencies = {
|
||||||
|
"williamboman/mason.nvim",
|
||||||
|
"jose-elias-alvarez/null-ls.nvim",
|
||||||
|
},
|
||||||
|
config = function ()
|
||||||
|
|
||||||
|
require("mason-null-ls").setup({
|
||||||
|
ensure_installed = {
|
||||||
|
"stylua",
|
||||||
|
"jq",
|
||||||
|
"php-cs-fixer",
|
||||||
|
"intelephense",
|
||||||
|
"black",
|
||||||
|
"prettier",
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
local null_ls = require("null-ls")
|
||||||
|
local format = null_ls.builtins.formatting
|
||||||
|
|
||||||
|
null_ls.setup({
|
||||||
|
sources = {
|
||||||
|
format.black,
|
||||||
|
format.stylua,
|
||||||
|
format.prettier
|
||||||
|
}
|
||||||
|
})
|
||||||
|
vim.keymap.set({"n", "x"}, "=", function() vim.cmd('LspZeroFormat') end, { desc = "Format" })
|
||||||
|
end
|
||||||
|
}
|
||||||
7
nvim/lua/olinpin/plugins/range-highlight.lua
Normal file
7
nvim/lua/olinpin/plugins/range-highlight.lua
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
return {
|
||||||
|
"winston0410/range-highlight.nvim",
|
||||||
|
dependencies = "winston0410/cmd-parser.nvim",
|
||||||
|
config = function ()
|
||||||
|
require("range-highlight").setup()
|
||||||
|
end
|
||||||
|
}
|
||||||
4
nvim/lua/olinpin/plugins/surround.lua
Normal file
4
nvim/lua/olinpin/plugins/surround.lua
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
return {
|
||||||
|
"tpope/vim-surround",
|
||||||
|
event = "VeryLazy"
|
||||||
|
}
|
||||||
24
nvim/lua/olinpin/plugins/tabline.lua
Normal file
24
nvim/lua/olinpin/plugins/tabline.lua
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
return {
|
||||||
|
'kdheepak/tabline.nvim',
|
||||||
|
config = function()
|
||||||
|
require('tabline').setup({
|
||||||
|
-- Defaults configuration options
|
||||||
|
enable = true,
|
||||||
|
options = {
|
||||||
|
-- If lualine is installed tabline will use separators configured in lualine by default.
|
||||||
|
-- These options can be used to override those settings.
|
||||||
|
section_separators = {'', ''},
|
||||||
|
component_separators = {'', ''},
|
||||||
|
max_bufferline_percent = 66, -- set to nil by default, and it uses vim.o.columns * 2/3
|
||||||
|
show_tabs_always = true, -- this shows tabs only when there are more than one tab or if the first tab is named
|
||||||
|
show_devicons = true, -- this shows devicons in buffer section
|
||||||
|
show_bufnr = false, -- this appends [bufnr] to buffer section,
|
||||||
|
show_filename_only = true, -- shows base filename only instead of relative path in filename
|
||||||
|
modified_icon = "+ ", -- change the default modified icon
|
||||||
|
modified_italic = false, -- set to true by default; this determines whether the filename turns italic if modified
|
||||||
|
show_tabs_only = false, -- this shows only tabs instead of tabs + buffers
|
||||||
|
}
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
requires = { { 'hoob3rt/lualine.nvim', opt=true }, {'kyazdani42/nvim-web-devicons', opt = true} }
|
||||||
|
}
|
||||||
57
nvim/lua/olinpin/plugins/telescope.lua
Normal file
57
nvim/lua/olinpin/plugins/telescope.lua
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
local _bad = { ".*%.min.css", ".*%.min.js" } -- remove minified results crashing the previewer
|
||||||
|
local bad_files = function(filepath)
|
||||||
|
for _, v in ipairs(_bad) do
|
||||||
|
if filepath:match(v) then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
|
local new_maker = function(filepath, bufnr, opts)
|
||||||
|
local previewers = require("telescope.previewers")
|
||||||
|
opts = opts or {}
|
||||||
|
if opts.use_ft_detect == nil then
|
||||||
|
opts.use_ft_detect = true
|
||||||
|
end
|
||||||
|
opts.use_ft_detect = opts.use_ft_detect == false and false or bad_files(filepath)
|
||||||
|
previewers.buffer_previewer_maker(filepath, bufnr, opts)
|
||||||
|
end
|
||||||
|
|
||||||
|
return {
|
||||||
|
"nvim-telescope/telescope.nvim",
|
||||||
|
event = "VeryLazy",
|
||||||
|
tag = "0.1.8",
|
||||||
|
dependencies = { "nvim-lua/plenary.nvim" },
|
||||||
|
init = function()
|
||||||
|
local builtin = require("telescope.builtin")
|
||||||
|
local telescope = require("telescope")
|
||||||
|
|
||||||
|
telescope.setup({
|
||||||
|
defaults = {
|
||||||
|
buffer_previewer_maker = new_maker,
|
||||||
|
},
|
||||||
|
pickers = {
|
||||||
|
find_files = {
|
||||||
|
-- `hidden = true` will still show the inside of `.git/` as it's not `.gitignore`d.
|
||||||
|
find_command = { "rg", "--files", "--hidden", "--no-ignore",
|
||||||
|
"--glob", "!**/.git/*", "--glob", "!**/venv/*", "--glob", "!**/.venv/*", "--glob",
|
||||||
|
"!**/node_modules/*",
|
||||||
|
"--glob", "!**/vendor/*", "--glob", "!**/var/cache/*",
|
||||||
|
"--glob", "!**/.next/*", "--glob", "!**/out/*", "--glob", "!**/dist/*", "--glob", "!**.min.js"
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
preview = {
|
||||||
|
filesize_limit = 0.5, -- MB
|
||||||
|
},
|
||||||
|
})
|
||||||
|
vim.keymap.set('n', '<leader>*', builtin.grep_string, {desc = "Grep current string"})
|
||||||
|
vim.keymap.set('n', '<leader>ff', builtin.find_files, {desc = "Find files"})
|
||||||
|
vim.keymap.set('n', '<leader>fg', builtin.git_branches, {desc = "Find Git branches" })
|
||||||
|
vim.keymap.set('n', '<leader>fc', builtin.git_commits, {desc = "Find Commits" })
|
||||||
|
vim.keymap.set('n', '<leader>fw', builtin.live_grep, {desc = "Find Words" })
|
||||||
|
|
||||||
|
end,
|
||||||
|
}
|
||||||
9
nvim/lua/olinpin/plugins/todo.lua
Normal file
9
nvim/lua/olinpin/plugins/todo.lua
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
return {
|
||||||
|
"folke/todo-comments.nvim",
|
||||||
|
dependencies = { "nvim-lua/plenary.nvim" },
|
||||||
|
opts = {
|
||||||
|
-- your configuration comes here
|
||||||
|
-- or leave it empty to use the default settings
|
||||||
|
-- refer to the configuration section below
|
||||||
|
}
|
||||||
|
}
|
||||||
58
nvim/lua/olinpin/plugins/treesitter.lua
Normal file
58
nvim/lua/olinpin/plugins/treesitter.lua
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
return {
|
||||||
|
'nvim-treesitter/nvim-treesitter',
|
||||||
|
event = "VeryLazy",
|
||||||
|
cmd = 'TSUpdate',
|
||||||
|
config = function()
|
||||||
|
require'nvim-treesitter.configs'.setup {
|
||||||
|
-- A list of parser names, or "all" (the five listed parsers should always be installed)
|
||||||
|
ensure_installed = {
|
||||||
|
"vimdoc",
|
||||||
|
"bash",
|
||||||
|
"css",
|
||||||
|
"javascript",
|
||||||
|
"python",
|
||||||
|
"c",
|
||||||
|
"lua",
|
||||||
|
"vim",
|
||||||
|
"vimdoc",
|
||||||
|
"query",
|
||||||
|
"go",
|
||||||
|
"markdown",
|
||||||
|
"markdown_inline",
|
||||||
|
"regex",
|
||||||
|
"swift",
|
||||||
|
"php",
|
||||||
|
"kotlin",
|
||||||
|
"rust",
|
||||||
|
"haskell",
|
||||||
|
"html"
|
||||||
|
},
|
||||||
|
|
||||||
|
-- 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 = {"markdown"}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
require'lspconfig'.sourcekit.setup{
|
||||||
|
cmd = {'/usr/bin/sourcekit-lsp'}
|
||||||
|
}
|
||||||
|
require('lspconfig')['hls'].setup{
|
||||||
|
filetypes = { 'haskell', 'lhaskell', 'cabal' },
|
||||||
|
}
|
||||||
|
|
||||||
|
-- vim.keymap.set('n','gd',vim.lsp.buf.definition)
|
||||||
|
end
|
||||||
|
|
||||||
|
}
|
||||||
22
nvim/lua/olinpin/plugins/trouble.lua
Normal file
22
nvim/lua/olinpin/plugins/trouble.lua
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
return {
|
||||||
|
"folke/trouble.nvim",
|
||||||
|
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||||
|
opts = {
|
||||||
|
-- your configuration comes here
|
||||||
|
-- or leave it empty to use the default settings
|
||||||
|
-- refer to the configuration section below
|
||||||
|
},
|
||||||
|
event = "VeryLazy",
|
||||||
|
keys = {
|
||||||
|
{
|
||||||
|
"<C-t>",
|
||||||
|
"<cmd>Trouble diagnostics toggle<cr>",
|
||||||
|
desc = "Diagnostics (Trouble)",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<C-T>",
|
||||||
|
"<cmd>Trouble diagnostics toggle filter.buf=0<cr>",
|
||||||
|
desc = "Buffer Diagnostics (Trouble)",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
7
nvim/lua/olinpin/plugins/undotree.lua
Normal file
7
nvim/lua/olinpin/plugins/undotree.lua
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
return {
|
||||||
|
'mbbill/undotree',
|
||||||
|
event = "VeryLazy",
|
||||||
|
init = function()
|
||||||
|
vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle)
|
||||||
|
end
|
||||||
|
}
|
||||||
3
nvim/lua/olinpin/plugins/vinegar.lua
Normal file
3
nvim/lua/olinpin/plugins/vinegar.lua
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
return {
|
||||||
|
"tpope/vim-vinegar"
|
||||||
|
}
|
||||||
32
nvim/lua/olinpin/plugins/which-key.lua
Normal file
32
nvim/lua/olinpin/plugins/which-key.lua
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
return {
|
||||||
|
"folke/which-key.nvim",
|
||||||
|
event = "VeryLazy",
|
||||||
|
init = function()
|
||||||
|
-- vim.o.timeout = true
|
||||||
|
vim.o.timeoutlen = 500
|
||||||
|
end,
|
||||||
|
config = function()
|
||||||
|
local wk = require("which-key")
|
||||||
|
wk.add({
|
||||||
|
{ "<leader>1", desc = "Openf harpoon buffer 1" },
|
||||||
|
{ "<leader>2", hidden = true },
|
||||||
|
{ "<leader>3", hidden = true },
|
||||||
|
{ "<leader>4", hidden = true },
|
||||||
|
{ "<leader>5", hidden = true },
|
||||||
|
{ "<leader>6", hidden = true },
|
||||||
|
{ "<leader>7", hidden = true },
|
||||||
|
{ "<leader>8", hidden = true },
|
||||||
|
{ "<leader>9", hidden = true },
|
||||||
|
{ "<leader>a", desc = "Add file to harpoon" },
|
||||||
|
{ "<leader>dd", desc = "duck hatch" },
|
||||||
|
{ "<leader>dk", desc = "duck cook" },
|
||||||
|
{ "<leader>f", group = "Find" },
|
||||||
|
{ "<leader>g", group = "Git" },
|
||||||
|
{ "<leader>gs", desc = "Open Git status" },
|
||||||
|
{ "<leader>h", desc = "Open Harpoon quick menu" },
|
||||||
|
{ "<leader>u", desc = "Toggle Undotree" },
|
||||||
|
{ "<leader>w", desc = "Replace all current words" },
|
||||||
|
{ "<leader>x", desc = "Close and remove buffer from harpoon" },
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
}
|
||||||
80
nvim/lua/olinpin/remap.lua
Normal file
80
nvim/lua/olinpin/remap.lua
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
vim.keymap.set("n", "<C-n>", vim.cmd.Ex, { desc = "Open explorer" })
|
||||||
|
vim.keymap.set("n", ";", ":")
|
||||||
|
|
||||||
|
|
||||||
|
-- window nav remaps
|
||||||
|
vim.keymap.set("n", "<C-h>", "<C-w>h", { desc = "Move window left" })
|
||||||
|
vim.keymap.set("n", "<C-j>", "<C-w>j", { desc = "Move window down" })
|
||||||
|
vim.keymap.set("n", "<C-k>", "<C-w>k", { desc = "Move window up" })
|
||||||
|
vim.keymap.set("n", "<C-l>", "<C-w>l", { desc = "Move window right" })
|
||||||
|
|
||||||
|
-- window split remaps
|
||||||
|
|
||||||
|
-- move selected lines
|
||||||
|
vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv", { desc = "Move selected down" })
|
||||||
|
vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv", { desc = "Move selected up" })
|
||||||
|
|
||||||
|
-- keep cursor in middle when searching
|
||||||
|
vim.keymap.set("n", "n", "nzzzv")
|
||||||
|
vim.keymap.set("n", "N", "Nzzzv")
|
||||||
|
|
||||||
|
|
||||||
|
-- keep copied text when pasting over selected text
|
||||||
|
vim.keymap.set("x", "<leader>p", "\"_dP", { desc = "Paste over selected text" })
|
||||||
|
|
||||||
|
-- replace the word you're on everywhere in buffer
|
||||||
|
vim.keymap.set("n", "<leader>w", ":%s/\\<<C-r><C-w>\\>/<C-r><C-w>/gI<Left><Left><Left>", { desc = "Replace word" })
|
||||||
|
|
||||||
|
|
||||||
|
-- move within insert mode
|
||||||
|
-- go to beginning and end
|
||||||
|
vim.keymap.set("i", "<C-b>", "<ESC>^i", { desc = "Beginning of line" })
|
||||||
|
vim.keymap.set("i", "<C-e>", "<End>", { desc = "End of line" })
|
||||||
|
|
||||||
|
-- navigate within insert mode
|
||||||
|
vim.keymap.set("i", "<C-h>", "<Left>", { desc = "Move left" })
|
||||||
|
vim.keymap.set("i", "<C-l>", "<Right>", { desc = "Move right" })
|
||||||
|
vim.keymap.set("i", "<C-j>", "<Down>", { desc = "Move down" })
|
||||||
|
vim.keymap.set("i", "<C-k>", "<Up>", { desc = "Move up" })
|
||||||
|
|
||||||
|
vim.keymap.set("x", "Y", "\"*y", { desc = "Copy to clipboard" }) -- copy to clipboard
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<ESC>", "<ESC>:noh<CR>", { desc = "Clear highlights" })
|
||||||
|
|
||||||
|
-- copy file path
|
||||||
|
vim.keymap.set("n", "<leader>cfp", [[:let @+ = expand("%:p")<CR>]], { desc = "Copy file path" })
|
||||||
|
|
||||||
|
vim.keymap.set("n", "ff", "za", { desc = "Fold" })
|
||||||
|
|
||||||
|
-- remap parentheses to add end parenthese
|
||||||
|
-- vim.keymap.set("i", "(", "()<Left>")
|
||||||
|
-- vim.keymap.set("i", "{", "{}<Left>")
|
||||||
|
-- vim.keymap.set("i", "[", "[]<Left>")
|
||||||
|
|
||||||
|
-- remap to add end quotes
|
||||||
|
-- vim.keymap.set("i", "'", "''<Left>")
|
||||||
|
-- vim.keymap.set("i", "\"", "\"\"<Left>")
|
||||||
|
-- vim.keymap.set("i", "`", "``<Left>")
|
||||||
|
|
||||||
|
-- remove mappings for avante
|
||||||
|
-- vim.keymap.del("n", "<leader>aa")
|
||||||
|
-- vim.keymap.del("v", "<leader>aa")
|
||||||
|
-- vim.keymap.del("n", "<leader>ar")
|
||||||
|
-- vim.keymap.del("v", "<leader>ae")
|
||||||
|
-- vim.keymap.del("n", "<leader>ah")
|
||||||
|
-- vim.keymap.del("n", "<leader>ad")
|
||||||
|
|
||||||
|
-- remove mappings from which-key
|
||||||
|
-- local wk = require("which-key")
|
||||||
|
-- wk.add({
|
||||||
|
-- { "<leader>aa", hidden = true },
|
||||||
|
-- { "<leader>ad", hidden = true },
|
||||||
|
-- { "<leader>ae", hidden = true },
|
||||||
|
-- { "<leader>ah", hidden = true },
|
||||||
|
-- { "<leader>ar", hidden = true },
|
||||||
|
-- })
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
vim.api.nvim_set_keymap("n", "<leader>ys", "<Plug>Ysurround", {})
|
||||||
|
|
||||||
44
nvim/lua/olinpin/set.lua
Normal file
44
nvim/lua/olinpin/set.lua
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
-- keep cursor in middle
|
||||||
|
vim.o.scrolloff = 800
|
||||||
|
-- keep cursor on the left
|
||||||
|
vim.o.sidescrolloff = 30
|
||||||
|
-- set relative line numbering
|
||||||
|
vim.opt.nu = true
|
||||||
|
vim.wo.relativenumber = true
|
||||||
|
-- turn off line wrap
|
||||||
|
vim.wo.wrap = false
|
||||||
|
-- make commands case insensitive
|
||||||
|
vim.o.ignorecase = true
|
||||||
|
|
||||||
|
-- indenting
|
||||||
|
vim.opt.tabstop = 4
|
||||||
|
vim.opt.softtabstop = 4
|
||||||
|
vim.opt.shiftwidth = 4
|
||||||
|
vim.opt.expandtab = true
|
||||||
|
vim.opt.smartindent = true
|
||||||
|
|
||||||
|
|
||||||
|
-- use undotree instead of vim backups
|
||||||
|
vim.opt.swapfile = false
|
||||||
|
vim.opt.backup = false
|
||||||
|
vim.undodir = os.getenv("HOME") .. "/.vim/undodir"
|
||||||
|
vim.opt.undofile = true
|
||||||
|
|
||||||
|
-- make vim update fast
|
||||||
|
vim.opt.updatetime = 50
|
||||||
|
|
||||||
|
|
||||||
|
-- vim.opt.colorcolumn = "80"
|
||||||
|
|
||||||
|
vim.g.mapleader = " "
|
||||||
|
|
||||||
|
vim.opt.signcolumn = "yes"
|
||||||
|
|
||||||
|
vim.opt.termguicolors = true
|
||||||
|
|
||||||
|
vim.opt.fillchars = { fold = " " }
|
||||||
|
vim.opt.foldmethod = "indent"
|
||||||
|
vim.opt.foldenable = false
|
||||||
|
vim.opt.foldlevel = 99
|
||||||
|
-- g.markdown_folding = 1 -- enable markdown folding
|
||||||
|
|
||||||
1
tmux/plugins/tmux-fzf
Submodule
1
tmux/plugins/tmux-fzf
Submodule
Submodule tmux/plugins/tmux-fzf added at 1547f18083
1
tmux/plugins/tmux-resurrect
Submodule
1
tmux/plugins/tmux-resurrect
Submodule
Submodule tmux/plugins/tmux-resurrect added at cff343cf9e
1
tmux/plugins/tmux-sessionx
Submodule
1
tmux/plugins/tmux-sessionx
Submodule
Submodule tmux/plugins/tmux-sessionx added at c2eb0e19bf
1
tmux/plugins/tmux-which-key
Submodule
1
tmux/plugins/tmux-which-key
Submodule
Submodule tmux/plugins/tmux-which-key added at 545831eb95
1
tmux/plugins/tpm
Submodule
1
tmux/plugins/tpm
Submodule
Submodule tmux/plugins/tpm added at 99469c4a9b
69
tmux/tmux.conf
Normal file
69
tmux/tmux.conf
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
### COLORS
|
||||||
|
set -g default-terminal screen-256color
|
||||||
|
|
||||||
|
# visuals
|
||||||
|
set-option -g status-style fg=colour250
|
||||||
|
|
||||||
|
set -g status-justify left
|
||||||
|
set -g status-position bottom
|
||||||
|
|
||||||
|
set -g status-left ''
|
||||||
|
set -g status-right '#S'
|
||||||
|
|
||||||
|
setw -g window-status-current-format ' #I#[fg=colour250]:#[fg=colour255]#W#[fg=#ffada2]#F '
|
||||||
|
setw -g window-status-format ' #I#[fg=colour237]:#[fg=colour250]#W#[fg=colour244]#F '
|
||||||
|
|
||||||
|
|
||||||
|
# remap prefix from 'C-b' to 'C-a'
|
||||||
|
unbind C-b
|
||||||
|
set-option -g prefix C-a
|
||||||
|
bind-key C-a send-prefix
|
||||||
|
|
||||||
|
# split panes using s and v
|
||||||
|
# use vim-like keys for splits and windows
|
||||||
|
# bind-key v split-window -h
|
||||||
|
# bind-key s split-window -v
|
||||||
|
|
||||||
|
# use vim-like keys for splits and windows
|
||||||
|
# bind C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys C-h) || tmux select-pane -L"
|
||||||
|
bind-key j select-pane -D
|
||||||
|
bind-key k select-pane -U
|
||||||
|
bind-key h select-pane -L
|
||||||
|
bind-key l select-pane -R
|
||||||
|
unbind-key C-l
|
||||||
|
|
||||||
|
# reload config file (change file location to your the tmux.conf you want to use)
|
||||||
|
bind r source-file ~/.tmux.conf
|
||||||
|
|
||||||
|
# vim like navigation
|
||||||
|
set-window-option -g mode-keys vi
|
||||||
|
|
||||||
|
# vim health check recommends the options below
|
||||||
|
set-option -sg escape-time 10
|
||||||
|
set-option -g focus-events on
|
||||||
|
set-option -sa terminal-overrides ',xterm-256color:RGB'
|
||||||
|
|
||||||
|
# bind V to select and Y to copy
|
||||||
|
unbind -T copy-mode-vi Space; #Default for begin-selection
|
||||||
|
unbind -T copy-mode-vi Enter; #Default for copy-selection
|
||||||
|
|
||||||
|
bind -T copy-mode-vi v send-keys -X begin-selection
|
||||||
|
bind -T copy-mode-vi y send-keys -X copy-selection
|
||||||
|
|
||||||
|
|
||||||
|
# increase history
|
||||||
|
set-option -g history-limit 5000
|
||||||
|
|
||||||
|
# set mouse support on
|
||||||
|
set -g mouse on
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
set -g @plugin 'tmux-plugins/tmux-resurrect'
|
||||||
|
set -g @plugin 'alexwforsythe/tmux-which-key'
|
||||||
|
|
||||||
|
set -g @plugin 'omerxx/tmux-sessionx'
|
||||||
|
|
||||||
|
|
||||||
|
# Initialise tmux plugin manager (needs to be at the bottom of the file)
|
||||||
|
run '~/.config/tmux/plugins/tpm/tpm'
|
||||||
Reference in New Issue
Block a user