removed windows and linux split subdir
This commit is contained in:
parent
83dda10fa8
commit
065b982734
280 changed files with 9053 additions and 426 deletions
3
.config/nvim/lua/config/init.lua
Normal file
3
.config/nvim/lua/config/init.lua
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
require('config.lazy')
|
||||
require('config.rest')
|
||||
require('config.lsp')
|
||||
8
.config/nvim/lua/config/keybinds.lua
Normal file
8
.config/nvim/lua/config/keybinds.lua
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
-- Remap Ctrl + h/j/k/l for pane movement
|
||||
vim.api.nvim_set_keymap('n', '<C-h>', '<C-w>h', { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap('n', '<C-j>', '<C-w>j', { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap('n', '<C-k>', '<C-w>k', { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap('n', '<C-l>', '<C-w>l', { noremap = true, silent = true })
|
||||
|
||||
-- Clear Highlights
|
||||
vim.api.nvim_set_keymap('n', '<Esc>', ':noh<CR>', { noremap = true, silent = true })
|
||||
41
.config/nvim/lua/config/lazy.lua
Normal file
41
.config/nvim/lua/config/lazy.lua
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
-- Bootstrap lazy.nvim
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
||||
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
|
||||
if vim.v.shell_error ~= 0 then
|
||||
vim.api.nvim_echo({
|
||||
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
|
||||
{ out, "WarningMsg" },
|
||||
{ "\nPress any key to exit..." },
|
||||
}, true, {})
|
||||
vim.fn.getchar()
|
||||
os.exit(1)
|
||||
end
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
-- Make sure to setup `mapleader` and `maplocalleader` before
|
||||
-- loading lazy.nvim so that mappings are correct.
|
||||
-- This is also a good place to setup other settings (vim.opt)
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = "\\"
|
||||
|
||||
-- Setup lazy.nvim
|
||||
require("lazy").setup({
|
||||
spec = {
|
||||
-- import your plugins
|
||||
{ import = "plugins_base" },
|
||||
{ import = "plugins_lsp" },
|
||||
},
|
||||
-- Configure any other settings here. See the documentation for more details.
|
||||
-- colorscheme that will be used when installing plugins.
|
||||
install = { colorscheme = { "nord" } },
|
||||
-- automatically check for plugin updates
|
||||
checker = { enabled = false },
|
||||
|
||||
change_detection = {
|
||||
enabled = false,
|
||||
notify = false,
|
||||
},
|
||||
})
|
||||
6
.config/nvim/lua/config/lsp.lua
Normal file
6
.config/nvim/lua/config/lsp.lua
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
vim.diagnostic.config({
|
||||
virtual_lines = {
|
||||
current_line = true,
|
||||
}
|
||||
})
|
||||
|
||||
2
.config/nvim/lua/config/rest.lua
Normal file
2
.config/nvim/lua/config/rest.lua
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
require('config.settings')
|
||||
require('config.keybinds')
|
||||
65
.config/nvim/lua/config/settings.lua
Normal file
65
.config/nvim/lua/config/settings.lua
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
-- Line numbers
|
||||
vim.wo.number = true
|
||||
|
||||
-- Tabs
|
||||
vim.o.expandtab = true
|
||||
vim.o.smartindent = true
|
||||
vim.o.tabstop = 4
|
||||
vim.o.shiftwidth = 4
|
||||
|
||||
-- Clipboard
|
||||
local function paste()
|
||||
return {
|
||||
vim.fn.split(vim.fn.getreg(""), "\n"),
|
||||
vim.fn.getregtype(""),
|
||||
}
|
||||
end
|
||||
|
||||
vim.o.clipboard = "unnamedplus"
|
||||
-- vim.g.clipboard = {
|
||||
-- name = "OSC 52",
|
||||
-- copy = {
|
||||
-- ["+"] = require("vim.ui.clipboard.osc52").copy("+"),
|
||||
-- ["*"] = require("vim.ui.clipboard.osc52").copy("*"),
|
||||
-- },
|
||||
-- paste = {
|
||||
-- ["+"] = paste,
|
||||
-- ["*"] = paste,
|
||||
-- },
|
||||
-- }
|
||||
vim.api.nvim_exec(
|
||||
[[
|
||||
augroup YankHighlight
|
||||
autocmd!
|
||||
autocmd TextYankPost * silent! lua vim.highlight.on_yank()
|
||||
augroup end
|
||||
]],
|
||||
false
|
||||
)
|
||||
|
||||
-- Restore cursor
|
||||
local restore_cursor_augroup = vim.api.nvim_create_augroup("restore_cursor_shape_on_exit", { clear = true })
|
||||
|
||||
vim.api.nvim_create_autocmd({ "VimLeave" }, {
|
||||
group = restore_cursor_augroup,
|
||||
desc = "restore the cursor shape on exit of neovim",
|
||||
command = "set guicursor=a:ver20",
|
||||
})
|
||||
|
||||
-- Horizontal Split Line
|
||||
vim.opt.laststatus = 3
|
||||
|
||||
-- Padding around current line
|
||||
vim.opt.scrolloff = 5
|
||||
|
||||
-- Highlight current line
|
||||
vim.opt.cursorline = true
|
||||
|
||||
-- Column limit
|
||||
vim.opt.colorcolumn = "80"
|
||||
|
||||
-- Set signcolumn to prevent lsp flickering
|
||||
vim.opt.signcolumn = "yes"
|
||||
|
||||
-- Always show tabline
|
||||
vim.opt.laststatus = 2
|
||||
1
.config/nvim/lua/plugins_base/deadcolumn.lua
Normal file
1
.config/nvim/lua/plugins_base/deadcolumn.lua
Normal file
|
|
@ -0,0 +1 @@
|
|||
return { 'Bekaboo/deadcolumn.nvim' }
|
||||
6
.config/nvim/lua/plugins_base/dropbar.lua
Normal file
6
.config/nvim/lua/plugins_base/dropbar.lua
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
return {
|
||||
{
|
||||
"Bekaboo/dropbar.nvim",
|
||||
version = "12.0.2"
|
||||
}
|
||||
}
|
||||
7
.config/nvim/lua/plugins_base/git-messenger.lua
Normal file
7
.config/nvim/lua/plugins_base/git-messenger.lua
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
return {
|
||||
'rhysd/git-messenger.vim',
|
||||
cmd = { 'GitMessenger' },
|
||||
keys = {
|
||||
{ "<leader>gm", "<cmd>GitMessenger<cr>", desc = "[G]it [M]essenger" },
|
||||
},
|
||||
}
|
||||
8
.config/nvim/lua/plugins_base/gitsigns.lua
Normal file
8
.config/nvim/lua/plugins_base/gitsigns.lua
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
return {
|
||||
"lewis6991/gitsigns.nvim",
|
||||
config = function()
|
||||
require("gitsigns").setup({
|
||||
current_line_blame = true,
|
||||
})
|
||||
end,
|
||||
}
|
||||
7
.config/nvim/lua/plugins_base/indent-blankline.lua
Normal file
7
.config/nvim/lua/plugins_base/indent-blankline.lua
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
return {
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
main = "ibl",
|
||||
---@module "ibl"
|
||||
---@type ibl.config
|
||||
opts = {},
|
||||
}
|
||||
3
.config/nvim/lua/plugins_base/mini_icons.lua
Normal file
3
.config/nvim/lua/plugins_base/mini_icons.lua
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
return {
|
||||
"echasnovski/mini.icons"
|
||||
}
|
||||
9
.config/nvim/lua/plugins_base/nord.lua
Normal file
9
.config/nvim/lua/plugins_base/nord.lua
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
return {
|
||||
"gbprod/nord.nvim",
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
config = function()
|
||||
require("nord").setup({})
|
||||
vim.cmd.colorscheme("nord")
|
||||
end,
|
||||
}
|
||||
9
.config/nvim/lua/plugins_base/nvim-surround.lua
Normal file
9
.config/nvim/lua/plugins_base/nvim-surround.lua
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
return {
|
||||
"kylechui/nvim-surround",
|
||||
version = "*",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("nvim-surround").setup({
|
||||
})
|
||||
end
|
||||
}
|
||||
10
.config/nvim/lua/plugins_base/nvim-tree.lua
Normal file
10
.config/nvim/lua/plugins_base/nvim-tree.lua
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
return {
|
||||
'nvim-tree/nvim-tree.lua',
|
||||
config = function()
|
||||
require("nvim-tree").setup()
|
||||
end,
|
||||
keys = {
|
||||
{ "<M-n>", "<cmd>NvimTreeFindFileToggle<cr>", desc = "Toggle [N]vimTree" },
|
||||
{ "<leader>nr", "<cmd>NvimTreeRefresh<cr>", desc = "[N]vimTree [R]efresh" },
|
||||
}
|
||||
}
|
||||
5
.config/nvim/lua/plugins_base/nvim-treesitter.lua
Normal file
5
.config/nvim/lua/plugins_base/nvim-treesitter.lua
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
lazy = false,
|
||||
build = ':TSUpdate'
|
||||
}
|
||||
23
.config/nvim/lua/plugins_base/refactoring.lua
Normal file
23
.config/nvim/lua/plugins_base/refactoring.lua
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
return {
|
||||
"ThePrimeagen/refactoring.nvim",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
},
|
||||
lazy = false,
|
||||
config = function()
|
||||
require("refactoring").setup()
|
||||
end,
|
||||
keys = {
|
||||
{
|
||||
"<leader>xe",
|
||||
"<cmd>Refactor extract <cr>",
|
||||
desc = "Refactor Extract"
|
||||
},
|
||||
{
|
||||
"<leader>xv",
|
||||
"<cmd>Refactor extract_var <cr>",
|
||||
desc = "Refactor Extract Variable"
|
||||
},
|
||||
}
|
||||
}
|
||||
11
.config/nvim/lua/plugins_base/statusline.lua
Normal file
11
.config/nvim/lua/plugins_base/statusline.lua
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
return {
|
||||
"nvim-lualine/lualine.nvim",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
config = function()
|
||||
require("lualine").setup({
|
||||
options = {
|
||||
disabled_filetypes = { "NvimTree" },
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
5
.config/nvim/lua/plugins_base/stcursorword.lua
Normal file
5
.config/nvim/lua/plugins_base/stcursorword.lua
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
return {
|
||||
"sontungexpt/stcursorword",
|
||||
event = "VeryLazy",
|
||||
config = true,
|
||||
}
|
||||
70
.config/nvim/lua/plugins_base/telescope.lua
Normal file
70
.config/nvim/lua/plugins_base/telescope.lua
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
return {
|
||||
"molecule-man/telescope-menufacture",
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
tag = "0.1.8",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
event = "VimEnter",
|
||||
config = function()
|
||||
require("telescope").load_extension("menufacture")
|
||||
local builtin = require("telescope.builtin")
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"<leader>sf",
|
||||
require("telescope").extensions.menufacture.find_files,
|
||||
{ desc = "[S]earch [F]iles" }
|
||||
)
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"<leader>sg",
|
||||
require("telescope").extensions.menufacture.live_grep,
|
||||
{ desc = "[S]earch [G]rep" }
|
||||
)
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"<leader>sw",
|
||||
require("telescope").extensions.menufacture.grep_string,
|
||||
{ desc = "[S]earch [W]ord under cursor" }
|
||||
)
|
||||
|
||||
vim.keymap.set("n", "<leader>/", function()
|
||||
-- You can pass additional configuration to Telescope to change the theme, layout, etc.
|
||||
builtin.current_buffer_fuzzy_find(require("telescope.themes").get_dropdown({
|
||||
winblend = 20,
|
||||
previewer = false,
|
||||
}))
|
||||
end, { desc = "[/] Fuzzily search in current buffer" })
|
||||
|
||||
vim.keymap.set("n", "<leader>ff", function()
|
||||
require("telescope.builtin").lsp_document_symbols({ symbols = "function" })
|
||||
end, { desc = "[F]ind [F]unction" })
|
||||
end,
|
||||
},
|
||||
{
|
||||
"jmacadie/telescope-hierarchy.nvim",
|
||||
dependencies = {
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
{ -- lazy style key map
|
||||
-- Choose your own keys, this works for me
|
||||
"<leader>si",
|
||||
"<cmd>Telescope hierarchy incoming_calls<cr>",
|
||||
desc = "LSP: [S]earch [I]ncoming Calls",
|
||||
},
|
||||
{
|
||||
"<leader>so",
|
||||
"<cmd>Telescope hierarchy outgoing_calls<cr>",
|
||||
desc = "LSP: [S]earch [O]utgoing Calls",
|
||||
},
|
||||
},
|
||||
opts = {},
|
||||
config = function(_, opts)
|
||||
require("telescope").setup(opts)
|
||||
require("telescope").load_extension("hierarchy")
|
||||
end,
|
||||
},
|
||||
}
|
||||
11
.config/nvim/lua/plugins_base/toggleterm.lua
Normal file
11
.config/nvim/lua/plugins_base/toggleterm.lua
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
return {
|
||||
"akinsho/toggleterm.nvim",
|
||||
cmd = "ToggleTerm",
|
||||
keys = {
|
||||
{ "<M-\\>", "<cmd>ToggleTerm</cr>", desc = "Toggle Terminal" },
|
||||
},
|
||||
version = "*",
|
||||
opts = {
|
||||
open_mapping = [[<M-\>]],
|
||||
},
|
||||
}
|
||||
14
.config/nvim/lua/plugins_base/which-key.lua
Normal file
14
.config/nvim/lua/plugins_base/which-key.lua
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
return {
|
||||
"folke/which-key.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {},
|
||||
keys = {
|
||||
{
|
||||
"<leader>?",
|
||||
function()
|
||||
require("which-key").show({ global = false })
|
||||
end,
|
||||
desc = "Buffer Local Keymaps (which-key)",
|
||||
},
|
||||
},
|
||||
}
|
||||
159
.config/nvim/lua/plugins_lsp/lsp.lua
Normal file
159
.config/nvim/lua/plugins_lsp/lsp.lua
Normal file
|
|
@ -0,0 +1,159 @@
|
|||
return {
|
||||
{
|
||||
"mason-org/mason-lspconfig.nvim",
|
||||
opts = {},
|
||||
dependencies = {
|
||||
{ "mason-org/mason.nvim", opts = {} },
|
||||
"neovim/nvim-lspconfig",
|
||||
},
|
||||
},
|
||||
{
|
||||
"ray-x/lsp_signature.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {},
|
||||
config = function(_, opts)
|
||||
require("lsp_signature").setup(opts)
|
||||
|
||||
vim.api.nvim_create_autocmd("LspAttach", {
|
||||
callback = function(args)
|
||||
local bufnr = args.buf
|
||||
local client = vim.lsp.get_client_by_id(args.data.client_id)
|
||||
if vim.tbl_contains({ "null-ls" }, client.name) then -- blacklist lsp
|
||||
return
|
||||
end
|
||||
require("lsp_signature").on_attach({
|
||||
-- ... setup options here ...
|
||||
}, bufnr)
|
||||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"stevearc/conform.nvim",
|
||||
event = { "BufWritePre" },
|
||||
cmd = { "ConformInfo" },
|
||||
opts = function()
|
||||
local mason_reg = require("mason-registry")
|
||||
|
||||
local formatters = {}
|
||||
local formatters_by_ft = {}
|
||||
|
||||
-- add diff langue vs filetype
|
||||
local keymap = {
|
||||
["c++"] = "cpp",
|
||||
["c#"] = "cs",
|
||||
}
|
||||
|
||||
-- add dif conform vs mason
|
||||
local name_map = {
|
||||
["cmakelang"] = "cmake_format",
|
||||
["deno"] = "deno_fmt",
|
||||
["elm-format"] = "elm_format",
|
||||
["gdtoolkit"] = "gdformat",
|
||||
["nixpkgs-fmt"] = "nixpkgs_fmt",
|
||||
["opa"] = "opa_fmt",
|
||||
["php-cs-fixer"] = "php_cs_fixer",
|
||||
["ruff"] = "ruff_format",
|
||||
["sql-formatter"] = "sql_formatter",
|
||||
["xmlformatter"] = "xmlformat",
|
||||
}
|
||||
|
||||
for _, pkg in pairs(mason_reg.get_installed_packages()) do
|
||||
for _, type in pairs(pkg.spec.categories) do
|
||||
-- only act upon a formatter
|
||||
if type == "Formatter" then
|
||||
-- if formatter doesn't have a builtin config, create our own from a generic template
|
||||
if not require("conform").get_formatter_config(pkg.spec.name) then
|
||||
-- the key of the entry to this table
|
||||
-- is the name of the bare executable
|
||||
-- the actual value may not be the absolute path
|
||||
-- in some cases
|
||||
local bin = next(pkg.spec.bin)
|
||||
-- this should be replaced by a function
|
||||
-- that quieries the configured mason install path
|
||||
local prefix = vim.fn.stdpath("data") .. "/mason/bin/"
|
||||
|
||||
formatters[pkg.spec.name] = {
|
||||
command = prefix .. bin,
|
||||
args = { "$FILENAME" },
|
||||
stdin = true,
|
||||
require_cwd = false,
|
||||
}
|
||||
end
|
||||
|
||||
-- finally add the formatter to it's compatible filetype(s)
|
||||
for _, ft in pairs(pkg.spec.languages) do
|
||||
local ftl = string.lower(ft)
|
||||
local ready = mason_reg.get_package(pkg.spec.name):is_installed()
|
||||
if ready then
|
||||
if keymap[ftl] ~= nil then
|
||||
ftl = keymap[ftl]
|
||||
end
|
||||
if name_map[pkg.spec.name] ~= nil then
|
||||
pkg.spec.name = name_map[pkg.spec.name]
|
||||
end
|
||||
formatters_by_ft[ftl] = formatters_by_ft[ftl] or {}
|
||||
table.insert(formatters_by_ft[ftl], pkg.spec.name)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return {
|
||||
formatters = formatters,
|
||||
formatters_by_ft = formatters_by_ft,
|
||||
}
|
||||
end,
|
||||
keys = {
|
||||
{
|
||||
"<leader>fm",
|
||||
function()
|
||||
require("conform").format({ async = true })
|
||||
end,
|
||||
mode = "",
|
||||
desc = "Format buffer",
|
||||
},
|
||||
-- {
|
||||
-- "<leader>ca",
|
||||
-- function()
|
||||
-- vim.lsp.buf.code_action()
|
||||
-- end,
|
||||
-- mode = "",
|
||||
-- desc = "Code Action",
|
||||
-- },
|
||||
{
|
||||
"<leader>rn",
|
||||
function()
|
||||
vim.lsp.buf.rename()
|
||||
end,
|
||||
mode = "",
|
||||
desc = "[R]e[N]ame",
|
||||
},
|
||||
{
|
||||
"gd",
|
||||
function()
|
||||
vim.lsp.buf.definition()
|
||||
end,
|
||||
mode = "",
|
||||
desc = "[G]oto [D]efinition",
|
||||
},
|
||||
{
|
||||
"gD",
|
||||
function()
|
||||
vim.lsp.buf.declaration()
|
||||
end,
|
||||
mode = "",
|
||||
desc = "[G]oto [D]eclaration",
|
||||
},
|
||||
{
|
||||
"<leader>ih",
|
||||
function()
|
||||
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled({0}),{0})
|
||||
end,
|
||||
mode = "",
|
||||
desc = "Toggle [I]nlay [H]ints"
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue