Compare commits
No commits in common. "7cb8ec32db4f748f7089d1f301cfd971b627cdeb" and "main" have entirely different histories.
7cb8ec32db
...
main
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
packer_compiled.lua
|
39
README.md
Normal file
39
README.md
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
# My NeoVim configuration
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
- NeoVim
|
||||||
|
- [Packer](https://github.com/wbthomason/packer.nvim)
|
||||||
|
|
||||||
|
To install packer run
|
||||||
|
```bash
|
||||||
|
git clone --depth 1 https://github.com/wbthomason/packer.nvim ~/.local/share/nvim/site/pack/packer/start/packer.nvim
|
||||||
|
```
|
||||||
|
|
||||||
|
To run LSP (autocomplete) you will also need the server for that language.
|
||||||
|
Currently, the languages servers that are configured are:
|
||||||
|
- bash (bashls)[https://github.com/bash-lsp/bash-language-server]
|
||||||
|
- c/c++ (ccls)[https://github.com/MaskRay/ccls]
|
||||||
|
- prisma (prismals)[https://www.npmjs.com/package/@prisma/language-server]
|
||||||
|
- python (pylsp)[https://github.com/python-lsp/python-lsp-server]
|
||||||
|
- rust (rust_analyzer)
|
||||||
|
- svelte (sveltelsp)[https://github.com/sveltejs/language-tools]
|
||||||
|
- tex (ltex)[https://github.com/valentjn/ltex-ls]
|
||||||
|
- ts (tsserver)[https://github.com/typescript-language-server/typescript-language-server]
|
||||||
|
- vlang (vls)[https://github.com/vlang/vls]
|
||||||
|
- zig (zls)[https://github.com/zigtools/zls]
|
||||||
|
|
||||||
|
## Instalation
|
||||||
|
|
||||||
|
1. After installing neovim and packer clone this repo to `.config/nvim`.
|
||||||
|
2. Start up NeoVim and run `:PackerSycn`
|
||||||
|
3. Restart neovim
|
||||||
|
|
||||||
|
## Some useful shortcuts
|
||||||
|
|
||||||
|
- ' f': Find files uses fuzzy finding to search for files in the folder you are currently are
|
||||||
|
- ' /': Search the files using grep
|
||||||
|
- '<C-F>': Open file structure
|
||||||
|
- 'gd': Goto definition
|
||||||
|
- 'K': Show call signature
|
||||||
|
- ']d': Goto next error
|
||||||
|
- '[d': Goto previous error
|
287
after/plugin/colors.lua
Normal file
287
after/plugin/colors.lua
Normal file
@ -0,0 +1,287 @@
|
|||||||
|
vim.opt.termguicolors = true
|
||||||
|
|
||||||
|
vim.ayucolor="dark"
|
||||||
|
|
||||||
|
vim.g.indentLine_char = ""
|
||||||
|
vim.g.indentLine_first_char = ""
|
||||||
|
vim.g.indentLine_showFirstIndentLevel = 1
|
||||||
|
vim.g.indentLine_setColors = 0
|
||||||
|
|
||||||
|
vim.opt.cursorline = true
|
||||||
|
vim.opt.background = 'light'
|
||||||
|
-- vim.g.cyberpunk_cursorline='black'
|
||||||
|
|
||||||
|
-- vim.cmd('colorscheme ayu')
|
||||||
|
-- vim.cmd('colorscheme night_owl_light')
|
||||||
|
-- vim.cmd('colorscheme eva01')
|
||||||
|
-- vim.cmd('colorscheme cyberpunk')
|
||||||
|
-- vim.cmd('colorscheme catppuccin-latte')
|
||||||
|
-- vim.cmd('colorscheme oxocarbon')
|
||||||
|
-- vim.cmd('colorscheme PaperColor')
|
||||||
|
vim.cmd('colorscheme bubblegum-256-light')
|
||||||
|
|
||||||
|
-- examples for your init.lua
|
||||||
|
|
||||||
|
-- disable netrw at the very start of your init.lua (strongly advised)
|
||||||
|
vim.g.loaded_netrw = 1
|
||||||
|
vim.g.loaded_netrwPlugin = 1
|
||||||
|
|
||||||
|
-- setup with some options
|
||||||
|
require("nvim-tree").setup{ -- BEGIN_DEFAULT_OPTS
|
||||||
|
auto_reload_on_write = true,
|
||||||
|
create_in_closed_folder = false,
|
||||||
|
disable_netrw = false,
|
||||||
|
hijack_cursor = false,
|
||||||
|
hijack_netrw = true,
|
||||||
|
hijack_unnamed_buffer_when_opening = false,
|
||||||
|
ignore_buffer_on_setup = false,
|
||||||
|
open_on_setup = false,
|
||||||
|
open_on_setup_file = false,
|
||||||
|
open_on_tab = false,
|
||||||
|
ignore_buf_on_tab_change = {},
|
||||||
|
sort_by = "name",
|
||||||
|
root_dirs = {},
|
||||||
|
prefer_startup_root = false,
|
||||||
|
sync_root_with_cwd = false,
|
||||||
|
reload_on_bufenter = false,
|
||||||
|
respect_buf_cwd = false,
|
||||||
|
on_attach = "disable",
|
||||||
|
remove_keymaps = false,
|
||||||
|
select_prompts = false,
|
||||||
|
view = {
|
||||||
|
adaptive_size = false,
|
||||||
|
centralize_selection = false,
|
||||||
|
width = 30,
|
||||||
|
hide_root_folder = false,
|
||||||
|
side = "right",
|
||||||
|
preserve_window_proportions = false,
|
||||||
|
number = false,
|
||||||
|
relativenumber = false,
|
||||||
|
signcolumn = "yes",
|
||||||
|
mappings = {
|
||||||
|
custom_only = false,
|
||||||
|
list = {
|
||||||
|
-- user mappings go here
|
||||||
|
},
|
||||||
|
},
|
||||||
|
float = {
|
||||||
|
enable = false,
|
||||||
|
quit_on_focus_loss = true,
|
||||||
|
open_win_config = {
|
||||||
|
relative = "editor",
|
||||||
|
border = "rounded",
|
||||||
|
width = 30,
|
||||||
|
height = 30,
|
||||||
|
row = 1,
|
||||||
|
col = 1,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
renderer = {
|
||||||
|
add_trailing = false,
|
||||||
|
group_empty = false,
|
||||||
|
highlight_git = false,
|
||||||
|
full_name = false,
|
||||||
|
highlight_opened_files = "none",
|
||||||
|
root_folder_modifier = ":~",
|
||||||
|
indent_width = 2,
|
||||||
|
indent_markers = {
|
||||||
|
enable = false,
|
||||||
|
inline_arrows = true,
|
||||||
|
icons = {
|
||||||
|
corner = "└",
|
||||||
|
edge = "│",
|
||||||
|
item = "│",
|
||||||
|
bottom = "─",
|
||||||
|
none = " ",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
icons = {
|
||||||
|
webdev_colors = true,
|
||||||
|
git_placement = "before",
|
||||||
|
padding = " ",
|
||||||
|
symlink_arrow = " ➛ ",
|
||||||
|
show = {
|
||||||
|
file = true,
|
||||||
|
folder = true,
|
||||||
|
folder_arrow = true,
|
||||||
|
git = true,
|
||||||
|
},
|
||||||
|
glyphs = {
|
||||||
|
default = "",
|
||||||
|
symlink = "",
|
||||||
|
bookmark = "",
|
||||||
|
folder = {
|
||||||
|
arrow_closed = "",
|
||||||
|
arrow_open = "",
|
||||||
|
default = "",
|
||||||
|
open = "",
|
||||||
|
empty = "",
|
||||||
|
empty_open = "",
|
||||||
|
symlink = "",
|
||||||
|
symlink_open = "",
|
||||||
|
},
|
||||||
|
git = {
|
||||||
|
unstaged = "🙄",
|
||||||
|
staged = "🥺",
|
||||||
|
unmerged = "🫢",
|
||||||
|
renamed = "📛",
|
||||||
|
untracked = "💫",
|
||||||
|
deleted = "🗑️",
|
||||||
|
ignored = "🤷",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
special_files = { "Cargo.toml", "Makefile", "README.md", "readme.md" },
|
||||||
|
symlink_destination = true,
|
||||||
|
},
|
||||||
|
hijack_directories = {
|
||||||
|
enable = true,
|
||||||
|
auto_open = true,
|
||||||
|
},
|
||||||
|
update_focused_file = {
|
||||||
|
enable = false,
|
||||||
|
update_root = false,
|
||||||
|
ignore_list = {},
|
||||||
|
},
|
||||||
|
ignore_ft_on_setup = {},
|
||||||
|
system_open = {
|
||||||
|
cmd = "",
|
||||||
|
args = {},
|
||||||
|
},
|
||||||
|
diagnostics = {
|
||||||
|
enable = true,
|
||||||
|
show_on_dirs = false,
|
||||||
|
debounce_delay = 50,
|
||||||
|
icons = { error = "☣️ ", warning = "😞", hint = "❤️ ", info = "🆓" }
|
||||||
|
,
|
||||||
|
},
|
||||||
|
filters = {
|
||||||
|
dotfiles = false,
|
||||||
|
custom = {},
|
||||||
|
exclude = {},
|
||||||
|
},
|
||||||
|
filesystem_watchers = {
|
||||||
|
enable = true,
|
||||||
|
debounce_delay = 50,
|
||||||
|
},
|
||||||
|
git = {
|
||||||
|
enable = true,
|
||||||
|
ignore = true,
|
||||||
|
show_on_dirs = true,
|
||||||
|
timeout = 400,
|
||||||
|
},
|
||||||
|
actions = {
|
||||||
|
use_system_clipboard = true,
|
||||||
|
change_dir = {
|
||||||
|
enable = true,
|
||||||
|
global = false,
|
||||||
|
restrict_above_cwd = false,
|
||||||
|
},
|
||||||
|
expand_all = {
|
||||||
|
max_folder_discovery = 300,
|
||||||
|
exclude = {},
|
||||||
|
},
|
||||||
|
file_popup = {
|
||||||
|
open_win_config = {
|
||||||
|
col = 1,
|
||||||
|
row = 1,
|
||||||
|
relative = "cursor",
|
||||||
|
border = "shadow",
|
||||||
|
style = "minimal",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
open_file = {
|
||||||
|
quit_on_open = false,
|
||||||
|
resize_window = true,
|
||||||
|
window_picker = {
|
||||||
|
enable = true,
|
||||||
|
chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890",
|
||||||
|
exclude = {
|
||||||
|
filetype = { "notify", "packer", "qf", "diff", "fugitive", "fugitiveblame" },
|
||||||
|
buftype = { "nofile", "terminal", "help" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
remove_file = {
|
||||||
|
close_window = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
trash = {
|
||||||
|
cmd = "gio trash",
|
||||||
|
require_confirm = true,
|
||||||
|
},
|
||||||
|
live_filter = {
|
||||||
|
prefix = "[FILTER]: ",
|
||||||
|
always_show_folders = true,
|
||||||
|
},
|
||||||
|
log = {
|
||||||
|
enable = false,
|
||||||
|
truncate = false,
|
||||||
|
types = {
|
||||||
|
all = false,
|
||||||
|
config = false,
|
||||||
|
copy_paste = false,
|
||||||
|
dev = false,
|
||||||
|
diagnostics = false,
|
||||||
|
git = false,
|
||||||
|
profile = false,
|
||||||
|
watcher = false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
notify = {
|
||||||
|
threshold = vim.log.levels.INFO,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
local hls = {
|
||||||
|
PmenuSel = { bg = "#282C34", fg = "NONE" },
|
||||||
|
Pmenu = { fg = "#C5CDD9", bg = "#22252A" },
|
||||||
|
|
||||||
|
CmpItemAbbrDeprecated = { fg = "#7E8294", bg = "NONE", strikethrough = true },
|
||||||
|
CmpItemAbbrMatch = { fg = "#82AAFF", bg = "NONE", bold = true },
|
||||||
|
CmpItemAbbrMatchFuzzy = { fg = "#82AAFF", bg = "NONE", bold = true },
|
||||||
|
CmpItemMenu = { fg = "#C792EA", bg = "NONE", italic = true },
|
||||||
|
|
||||||
|
CmpItemKindField = { fg = "#EED8DA", bg = "#B5585F" },
|
||||||
|
CmpItemKindProperty = { fg = "#EED8DA", bg = "#B5585F" },
|
||||||
|
CmpItemKindEvent = { fg = "#EED8DA", bg = "#B5585F" },
|
||||||
|
|
||||||
|
CmpItemKindText = { fg = "#C3E88D", bg = "#9FBD73" },
|
||||||
|
CmpItemKindEnum = { fg = "#C3E88D", bg = "#9FBD73" },
|
||||||
|
CmpItemKindKeyword = { fg = "#C3E88D", bg = "#9FBD73" },
|
||||||
|
|
||||||
|
CmpItemKindConstant = { fg = "#FFE082", bg = "#D4BB6C" },
|
||||||
|
CmpItemKindConstructor = { fg = "#FFE082", bg = "#D4BB6C" },
|
||||||
|
CmpItemKindReference = { fg = "#FFE082", bg = "#D4BB6C" },
|
||||||
|
|
||||||
|
CmpItemKindFunction = { fg = "#EADFF0", bg = "#A377BF" },
|
||||||
|
CmpItemKindStruct = { fg = "#EADFF0", bg = "#A377BF" },
|
||||||
|
CmpItemKindClass = { fg = "#EADFF0", bg = "#A377BF" },
|
||||||
|
CmpItemKindModule = { fg = "#EADFF0", bg = "#A377BF" },
|
||||||
|
CmpItemKindOperator = { fg = "#EADFF0", bg = "#A377BF" },
|
||||||
|
|
||||||
|
CmpItemKindVariable = { fg = "#C5CDD9", bg = "#7E8294" },
|
||||||
|
CmpItemKindFile = { fg = "#C5CDD9", bg = "#7E8294" },
|
||||||
|
|
||||||
|
CmpItemKindUnit = { fg = "#F5EBD9", bg = "#D4A959" },
|
||||||
|
CmpItemKindSnippet = { fg = "#F5EBD9", bg = "#D4A959" },
|
||||||
|
CmpItemKindFolder = { fg = "#F5EBD9", bg = "#D4A959" },
|
||||||
|
|
||||||
|
CmpItemKindMethod = { fg = "#DDE5F5", bg = "#6C8ED4" },
|
||||||
|
CmpItemKindValue = { fg = "#DDE5F5", bg = "#6C8ED4" },
|
||||||
|
CmpItemKindEnumMember = { fg = "#DDE5F5", bg = "#6C8ED4" },
|
||||||
|
|
||||||
|
CmpItemKindInterface = { fg = "#D8EEEB", bg = "#58B5A8" },
|
||||||
|
CmpItemKindColor = { fg = "#D8EEEB", bg = "#58B5A8" },
|
||||||
|
CmpItemKindTypeParameter = { fg = "#D8EEEB", bg = "#58B5A8" },
|
||||||
|
}
|
||||||
|
|
||||||
|
for key, value in pairs(hls) do
|
||||||
|
vim.api.nvim_set_hl(0, key, value)
|
||||||
|
end
|
||||||
|
|
||||||
|
require("transparent").setup()
|
||||||
|
|
21
after/plugin/keys.lua
Normal file
21
after/plugin/keys.lua
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
-- This file sets the fzf and side tree
|
||||||
|
vim.keymap.set("n", " ", "<Nop>", { silent = true, remap = false })
|
||||||
|
vim.g.mapleader = " "
|
||||||
|
vim.g.maplocalleader = " "
|
||||||
|
|
||||||
|
local opts = { noremap=true }
|
||||||
|
|
||||||
|
vim.keymap.set('n', '<leader>f', function () vim.cmd('Telescope find_files') end, { remap = true })
|
||||||
|
vim.keymap.set('n', '<leader>/', function () vim.cmd('Telescope live_grep') end, { remap = true })
|
||||||
|
vim.keymap.set('n', '<leader>b', function () vim.cmd('Telescope buffers') end, { remap = true })
|
||||||
|
|
||||||
|
vim.keymap.set('n', 'ge', 'G0', { remap = true })
|
||||||
|
vim.keymap.set('n', 'gh', '0', { remap = true })
|
||||||
|
vim.keymap.set('n', 'gl', '$', { remap = true })
|
||||||
|
|
||||||
|
vim.keymap.set('v', '<leader>c', function () vim.cmd('\'<,\'>Commentary') end, { noremap = true, silent = true })
|
||||||
|
vim.keymap.set('n', '<leader>c', function () vim.cmd('Commentary') end, { noremap = true, silent = true })
|
||||||
|
|
||||||
|
vim.keymap.set('n', '<leader>gg', function () vim.cmd('Neogit') end, { noremap = true, silent = true })
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<C-F>", "<cmd>NvimTreeToggle<CR>", { silent = true })
|
94
after/plugin/lualine.lua
Normal file
94
after/plugin/lualine.lua
Normal file
@ -0,0 +1,94 @@
|
|||||||
|
local colors = {
|
||||||
|
black = '#212121',
|
||||||
|
white = '#ebdbb2',
|
||||||
|
red = '#fb4934',
|
||||||
|
green = '#b8bb26',
|
||||||
|
blue = '#83a598',
|
||||||
|
yellow = '#fe8019',
|
||||||
|
gray = '#a89984',
|
||||||
|
darkgray = '#3c3836',
|
||||||
|
lightgray = '#504945',
|
||||||
|
inactivegray = '#7c6f64',
|
||||||
|
cute_light_pink='#FCDFE5',
|
||||||
|
cute_light_blue='#25BFFC',
|
||||||
|
cute_blue='#55cdfc',
|
||||||
|
cute_pink='#F48DA2',
|
||||||
|
green = '#4EC930',
|
||||||
|
red = '#FC545D',
|
||||||
|
ocre = '#f7a8b8',
|
||||||
|
orange = '#FC8553'
|
||||||
|
}
|
||||||
|
|
||||||
|
local bubblegum_theme = {
|
||||||
|
normal = {
|
||||||
|
a = {bg = colors.cute_blue, fg = colors.black, gui = 'bold'},
|
||||||
|
b = {bg = colors.cute_pink, fg = colors.cute_light_blue},
|
||||||
|
c = {bg = colors.cute_light_pink, fg = colors.cute_light_blue}
|
||||||
|
},
|
||||||
|
insert = {
|
||||||
|
a = {bg = colors.green, fg = colors.black, gui = 'bold'},
|
||||||
|
b = {bg = colors.cute_pink, fg = colors.cute_light_blue},
|
||||||
|
c = {bg = colors.cute_light_pink, fg = colors.cute_light_blue}
|
||||||
|
},
|
||||||
|
visual = {
|
||||||
|
a = {bg = colors.yellow, fg = colors.black, gui = 'bold'},
|
||||||
|
b = {bg = colors.cute_pink, fg = colors.cute_light_blue},
|
||||||
|
c = {bg = colors.cute_light_pink, fg = colors.cute_light_blue}
|
||||||
|
},
|
||||||
|
replace = {
|
||||||
|
a = {bg = colors.red, fg = colors.black, gui = 'bold'},
|
||||||
|
b = {bg = colors.cute_pink, fg = colors.cute_light_blue},
|
||||||
|
c = {bg = colors.cute_light_pink, fg = colors.cute_light_blue}
|
||||||
|
},
|
||||||
|
command = {
|
||||||
|
a = {bg = colors.ocre, fg = colors.black, gui = 'bold'},
|
||||||
|
b = {bg = colors.cute_pink, fg = colors.cute_light_blue},
|
||||||
|
c = {bg = colors.cute_light_pink, fg = colors.cute_light_blue}
|
||||||
|
},
|
||||||
|
inactive = {
|
||||||
|
a = {bg = colors.cute_light_pink, fg = colors.cute_light_blue, gui = 'bold'},
|
||||||
|
b = {bg = colors.cute_light_pink, fg = colors.cute_light_blue},
|
||||||
|
c = {bg = colors.cute_light_pink, fg = colors.cute_light_blue}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
require('lualine').setup {
|
||||||
|
options = {
|
||||||
|
icons_enabled = true,
|
||||||
|
theme=bubblegum_theme,
|
||||||
|
component_separators = { left = '', right = ''},
|
||||||
|
section_separators = { left = '', right = ''},
|
||||||
|
disabled_filetypes = {
|
||||||
|
statusline = {},
|
||||||
|
winbar = {},
|
||||||
|
},
|
||||||
|
ignore_focus = {},
|
||||||
|
always_divide_middle = true,
|
||||||
|
globalstatus = false,
|
||||||
|
refresh = {
|
||||||
|
statusline = 1000,
|
||||||
|
tabline = 1000,
|
||||||
|
winbar = 1000,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
sections = {
|
||||||
|
lualine_a = {'mode'},
|
||||||
|
lualine_b = {'branch', 'diff', 'diagnostics'},
|
||||||
|
lualine_c = {'filename'},
|
||||||
|
lualine_x = {'encoding', 'fileformat', 'filetype'},
|
||||||
|
lualine_y = {'progress'},
|
||||||
|
lualine_z = {'location'}
|
||||||
|
},
|
||||||
|
inactive_sections = {
|
||||||
|
lualine_a = {},
|
||||||
|
lualine_b = {},
|
||||||
|
lualine_c = {'filename'},
|
||||||
|
lualine_x = {'location'},
|
||||||
|
lualine_y = {},
|
||||||
|
lualine_z = {}
|
||||||
|
},
|
||||||
|
tabline = {},
|
||||||
|
winbar = {},
|
||||||
|
inactive_winbar = {},
|
||||||
|
extensions = {"nvim-tree"}
|
||||||
|
}
|
10
after/plugin/svelte.lua
Normal file
10
after/plugin/svelte.lua
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
-- To disable indentation on the script and style
|
||||||
|
-- vim.g.svelte_indent_script = 0
|
||||||
|
-- vim.g.svelte_indent_style = 0
|
||||||
|
|
||||||
|
vim.g.svelte_preprocessor_tags = {
|
||||||
|
{name = "ts", tag = "script", as = "typescript"},
|
||||||
|
}
|
||||||
|
|
||||||
|
vim.g.svelte_preprocessors = {"typescript", "scss"}
|
||||||
|
|
5
after/plugin/tree-sitter.lua
Normal file
5
after/plugin/tree-sitter.lua
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
require'nvim-treesitter.configs'.setup {
|
||||||
|
highlight = {
|
||||||
|
enable = true
|
||||||
|
}
|
||||||
|
}
|
@ -1,22 +0,0 @@
|
|||||||
{
|
|
||||||
"bubblegum-theme": { "branch": "main", "commit": "105b1302ee54abae9abc199710b94a6098572a8e" },
|
|
||||||
"cellular-automaton.nvim": { "branch": "main", "commit": "b7d056dab963b5d3f2c560d92937cb51db61cb5b" },
|
|
||||||
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
|
||||||
"cmp-cmdline": { "branch": "main", "commit": "8ee981b4a91f536f52add291594e89fb6645e451" },
|
|
||||||
"cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" },
|
|
||||||
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
|
||||||
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
|
|
||||||
"fidget": { "branch": "main", "commit": "3a93300c076109d86c7ce35ec67a8034ae6ba9db" },
|
|
||||||
"friendly-snippets": { "branch": "main", "commit": "69a2c1675b66e002799f5eef803b87a12f593049" },
|
|
||||||
"lazy.nvim": { "branch": "main", "commit": "96584866b9c5e998cbae300594d0ccfd0c464627" },
|
|
||||||
"lsp_signature.nvim": { "branch": "master", "commit": "fed2c8389c148ff1dfdcdca63c2b48d08a50dea0" },
|
|
||||||
"luasnip": { "branch": "master", "commit": "82108e7e31cc6fc223cc5df5cae6d89f70bb199f" },
|
|
||||||
"neogen": { "branch": "main", "commit": "70127baaff25611deaf1a29d801fc054ad9d2dc1" },
|
|
||||||
"nvim-cmp": { "branch": "main", "commit": "538e37ba87284942c1d76ed38dd497e54e65b891" },
|
|
||||||
"nvim-lspconfig": { "branch": "master", "commit": "796394fd19fb878e8dbc4fd1e9c9c186ed07a5f4" },
|
|
||||||
"nvim-treesitter": { "branch": "master", "commit": "8cd2b230174efbf7b5d9f49fe2f90bda6b5eb16e" },
|
|
||||||
"plenary": { "branch": "master", "commit": "55d9fe89e33efd26f532ef20223e5f9430c8b0c0" },
|
|
||||||
"telescope.nvim": { "branch": "master", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" },
|
|
||||||
"undotree": { "branch": "master", "commit": "36ff7abb6b60980338344982ad4cdf03f7961ecd" },
|
|
||||||
"vim-fugitive": { "branch": "master", "commit": "59659093581aad2afacedc81f009ed6a4bfad275" }
|
|
||||||
}
|
|
@ -1,6 +1,8 @@
|
|||||||
vim.g.mapleader = " "
|
if vim.g.vscode then
|
||||||
vim.g.maplocalleader = " "
|
-- VSCode extension
|
||||||
|
else
|
||||||
require('andr3.lazy')
|
|
||||||
require('andr3.set')
|
require('andr3.set')
|
||||||
require('andr3.keys')
|
require('andr3.packer')
|
||||||
|
require('andr3.lsp')
|
||||||
|
require('andr3.neogit')
|
||||||
|
end
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
-- Leader is set on init before lazy
|
|
||||||
-- vim.g.mapleader = " "
|
|
||||||
-- vim.g.maplocalleader = " "
|
|
||||||
|
|
||||||
vim.keymap.set('v', 'J', ":m '>+1<CR>gv=gv")
|
|
||||||
vim.keymap.set('v', 'K', ":m '<-2<CR>gv=gv")
|
|
||||||
|
|
1
lua/andr3/langs/.gitignore
vendored
Normal file
1
lua/andr3/langs/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
ltex-key
|
13
lua/andr3/langs/bash.lua
Normal file
13
lua/andr3/langs/bash.lua
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
local O = {}
|
||||||
|
|
||||||
|
local lspConfig = require('lspconfig')
|
||||||
|
function O.setup(on_attach, lsp_flags, capabilities)
|
||||||
|
lspConfig.bashls.setup{
|
||||||
|
on_attach = on_attach,
|
||||||
|
flags = lsp_flags,
|
||||||
|
capabilities = capabilities,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
return O
|
||||||
|
|
12
lua/andr3/langs/ccls.lua
Normal file
12
lua/andr3/langs/ccls.lua
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
local O = {};
|
||||||
|
local lspConfig = require('lspconfig')
|
||||||
|
|
||||||
|
function O.setup(on_attach, lsp_flags, capabilities)
|
||||||
|
lspConfig['ccls'].setup{
|
||||||
|
on_attach = on_attach,
|
||||||
|
flags = lsp_flags,
|
||||||
|
capabilities = capabilities,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
return O
|
12
lua/andr3/langs/go.lua
Normal file
12
lua/andr3/langs/go.lua
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
local O = {};
|
||||||
|
local lspConfig = require('lspconfig')
|
||||||
|
|
||||||
|
function O.setup(on_attach, lsp_flags, capabilities)
|
||||||
|
lspConfig['gopls'].setup{
|
||||||
|
on_attach = on_attach,
|
||||||
|
flags = lsp_flags,
|
||||||
|
capabilities = capabilities,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
return O
|
19
lua/andr3/langs/htmlcss.lua
Normal file
19
lua/andr3/langs/htmlcss.lua
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
local O = {};
|
||||||
|
local lspConfig = require('lspconfig')
|
||||||
|
|
||||||
|
function O.setup(on_attach, lsp_flags, capabilities)
|
||||||
|
lspConfig['cssls'].setup{
|
||||||
|
on_attach = on_attach,
|
||||||
|
flags = lsp_flags,
|
||||||
|
capabilities = capabilities,
|
||||||
|
cmd = {"css-languageserver", "--stdio"}
|
||||||
|
}
|
||||||
|
lspConfig['html'].setup{
|
||||||
|
on_attach = on_attach,
|
||||||
|
flags = lsp_flags,
|
||||||
|
capabilities = capabilities,
|
||||||
|
cmd = {"html-languageserver", "--stdio"}
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
return O
|
12
lua/andr3/langs/java.lua
Normal file
12
lua/andr3/langs/java.lua
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
local O = {};
|
||||||
|
local lspConfig = require('lspconfig')
|
||||||
|
|
||||||
|
function O.setup(on_attach, lsp_flags, capabilities)
|
||||||
|
lspConfig['jdtls'].setup{
|
||||||
|
on_attach = on_attach,
|
||||||
|
flags = lsp_flags,
|
||||||
|
capabilities = capabilities,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
return O
|
3
lua/andr3/langs/ltex-key-bak
Normal file
3
lua/andr3/langs/ltex-key-bak
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
http://api.languagetoolplus.com/
|
||||||
|
andr3h3nriqu3s@gmail.com
|
||||||
|
pit-Z31pae3YaG1c
|
12
lua/andr3/langs/ocaml.lua
Normal file
12
lua/andr3/langs/ocaml.lua
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
local O = {};
|
||||||
|
local lspConfig = require('lspconfig')
|
||||||
|
|
||||||
|
function O.setup(on_attach, lsp_flags, capabilities)
|
||||||
|
lspConfig['ocamllsp'].setup{
|
||||||
|
on_attach = on_attach,
|
||||||
|
flags = lsp_flags,
|
||||||
|
capabilities = capabilities,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
return O
|
13
lua/andr3/langs/prisma.lua
Normal file
13
lua/andr3/langs/prisma.lua
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
local O = {}
|
||||||
|
|
||||||
|
local lspConfig = require('lspconfig')
|
||||||
|
function O.setup(on_attach, lsp_flags, capabilities)
|
||||||
|
lspConfig.prismals.setup{
|
||||||
|
on_attach = on_attach,
|
||||||
|
flags = lsp_flags,
|
||||||
|
capabilities = capabilities,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
return O
|
||||||
|
|
13
lua/andr3/langs/python.lua
Normal file
13
lua/andr3/langs/python.lua
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
local O = {}
|
||||||
|
|
||||||
|
local lspConfig = require('lspconfig')
|
||||||
|
function O.setup(on_attach, lsp_flags, capabilities)
|
||||||
|
lspConfig.pylsp.setup{
|
||||||
|
on_attach = on_attach,
|
||||||
|
flags = lsp_flags,
|
||||||
|
capabilities = capabilities,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
return O
|
||||||
|
|
16
lua/andr3/langs/rust.lua
Normal file
16
lua/andr3/langs/rust.lua
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
local O = {}
|
||||||
|
local lspConfig = require('lspconfig')
|
||||||
|
|
||||||
|
function O.setup(on_attach, lsp_flags, capabilities)
|
||||||
|
lspConfig['rust_analyzer'].setup{
|
||||||
|
on_attach = on_attach,
|
||||||
|
flags = lsp_flags,
|
||||||
|
capabilities = capabilities,
|
||||||
|
-- Server-specific settings...
|
||||||
|
settings = {
|
||||||
|
["rust-analyzer"] = {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
return O
|
10
lua/andr3/langs/svelte.lua
Normal file
10
lua/andr3/langs/svelte.lua
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
local O = {};
|
||||||
|
local lspConfig = require('lspconfig')
|
||||||
|
function O.setup(on_attach, lsp_flags, capabilities)
|
||||||
|
lspConfig['svelte'].setup{
|
||||||
|
on_attach = on_attach,
|
||||||
|
flags = lsp_flags,
|
||||||
|
capabilities = capabilities,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
return O
|
52
lua/andr3/langs/tex.lua
Normal file
52
lua/andr3/langs/tex.lua
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
local O = {};
|
||||||
|
local lspConfig = require('lspconfig')
|
||||||
|
|
||||||
|
function O.setup(on_attach, lsp_flags, capabilities)
|
||||||
|
local path = debug.getinfo(1).source
|
||||||
|
local acpath = path:sub(2, #path - 7).."ltex-key"
|
||||||
|
|
||||||
|
local f = io.open(acpath, "r")
|
||||||
|
|
||||||
|
if f == nil then
|
||||||
|
lspConfig['ltex'].setup{
|
||||||
|
on_attach = on_attach,
|
||||||
|
flags = lsp_flags,
|
||||||
|
capabilities = capabilities,
|
||||||
|
}
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
io.input(f)
|
||||||
|
local url = io.read("*line")
|
||||||
|
local user = io.read("*line")
|
||||||
|
local key = io.read("*line")
|
||||||
|
io.close(f)
|
||||||
|
|
||||||
|
if user == nil or key == nil or url == nil then
|
||||||
|
lspConfig['ltex'].setup{
|
||||||
|
on_attach = on_attach,
|
||||||
|
flags = lsp_flags,
|
||||||
|
capabilities = capabilities,
|
||||||
|
}
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
lspConfig['ltex'].setup{
|
||||||
|
on_attach = on_attach,
|
||||||
|
flags = lsp_flags,
|
||||||
|
capabilities = capabilities,
|
||||||
|
settings = {
|
||||||
|
ltex = {
|
||||||
|
language = "en-GB",
|
||||||
|
languageToolHttpServerUri = url,
|
||||||
|
languageToolOrg = {
|
||||||
|
username = user,
|
||||||
|
apiKey = file
|
||||||
|
},
|
||||||
|
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
return O
|
12
lua/andr3/langs/ts.lua
Normal file
12
lua/andr3/langs/ts.lua
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
local O = {};
|
||||||
|
local lspConfig = require('lspconfig')
|
||||||
|
|
||||||
|
function O.setup(on_attach, lsp_flags, capabilities)
|
||||||
|
lspConfig['tsserver'].setup{
|
||||||
|
on_attach = on_attach,
|
||||||
|
flags = lsp_flags,
|
||||||
|
capabilities = capabilities,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
return O
|
12
lua/andr3/langs/vlang.lua
Normal file
12
lua/andr3/langs/vlang.lua
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
local O = {};
|
||||||
|
local lspConfig = require('lspconfig')
|
||||||
|
|
||||||
|
function O.setup(on_attach, lsp_flags, capabilities)
|
||||||
|
lspConfig.vls.setup{
|
||||||
|
on_attach=on_attach,
|
||||||
|
lsp_flags=lsp_flags,
|
||||||
|
capabilities=capabilities
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
return O
|
13
lua/andr3/langs/zig.lua
Normal file
13
lua/andr3/langs/zig.lua
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
local O = {}
|
||||||
|
|
||||||
|
local lspConfig = require('lspconfig')
|
||||||
|
function O.setup(on_attach, lsp_flags, capabilities)
|
||||||
|
lspConfig.zls.setup{
|
||||||
|
on_attach = on_attach,
|
||||||
|
flags = lsp_flags,
|
||||||
|
capabilities = capabilities,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
return O
|
||||||
|
|
@ -1,7 +0,0 @@
|
|||||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
|
||||||
vim.opt.rtp:prepend(lazypath)
|
|
||||||
|
|
||||||
require('lazy').setup({
|
|
||||||
spec = "andr3.plugins",
|
|
||||||
change_detection = { notify = false }
|
|
||||||
})
|
|
276
lua/andr3/lsp.lua
Normal file
276
lua/andr3/lsp.lua
Normal file
@ -0,0 +1,276 @@
|
|||||||
|
require 'andr3.lsp_adds.prettier'
|
||||||
|
require 'andr3.lsp_adds.null-ls'
|
||||||
|
require 'andr3.lsp_adds.lsp_signature'
|
||||||
|
local icons = require 'andr3.lsp_adds.icons'
|
||||||
|
|
||||||
|
vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(
|
||||||
|
vim.lsp.diagnostic.on_publish_diagnostics, {
|
||||||
|
-- Enable underline, use default values
|
||||||
|
underline = true,
|
||||||
|
-- Enable virtual text, override spacing to 4
|
||||||
|
virtual_text = {
|
||||||
|
spacing = 4,
|
||||||
|
prefix = '~',
|
||||||
|
},
|
||||||
|
-- Use a function to dynamically turn signs off
|
||||||
|
-- and on, using buffer local variables
|
||||||
|
signs = function(bufnr, client_id)
|
||||||
|
local ok, result = pcall(vim.api.nvim_buf_get_var, bufnr, 'show_signs')
|
||||||
|
-- No buffer local variable set, so just enable by default
|
||||||
|
if not ok then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
|
return result
|
||||||
|
end,
|
||||||
|
-- Disable a feature
|
||||||
|
update_in_insert = false,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
-- vim.diagnostic.config({ virtual_text = { prefix = '🅰', } })
|
||||||
|
|
||||||
|
for type, icon in pairs(icons.signs) do
|
||||||
|
local hl = "DiagnosticSign" .. type
|
||||||
|
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl })
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
-- lspkind
|
||||||
|
|
||||||
|
require('lspkind').init({
|
||||||
|
mode = 'symbol_text',
|
||||||
|
preset = 'codicons',
|
||||||
|
symbol_map = icons.kind_icons,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Saga
|
||||||
|
|
||||||
|
local keymap = vim.keymap.set
|
||||||
|
local saga = require'lspsaga'
|
||||||
|
local signs = icons.signs
|
||||||
|
|
||||||
|
-- saga.init_lsp_saga{
|
||||||
|
saga.setup{
|
||||||
|
border_style = "single",
|
||||||
|
saga_winblend = 0,
|
||||||
|
move_in_saga = { prev = '<C-p>',next = '<C-n>'},
|
||||||
|
diagnostic_header = { signs.Error, signs.Warn, signs.Hint, signs.Info },
|
||||||
|
max_preview_lines = 10,
|
||||||
|
code_action_icon = signs.CodeAction,
|
||||||
|
code_action_num_shortcut = true,
|
||||||
|
code_action_lightbulb = {
|
||||||
|
enable = true,
|
||||||
|
enable_in_insert = true,
|
||||||
|
cache_code_action = true,
|
||||||
|
sign = true,
|
||||||
|
icon = signs.CodeAction,
|
||||||
|
update_time = 150,
|
||||||
|
sign_priority = 20,
|
||||||
|
virtual_text = true,
|
||||||
|
},
|
||||||
|
finder_icons = {
|
||||||
|
def = ' ',
|
||||||
|
ref = '諭 ',
|
||||||
|
link = ' ',
|
||||||
|
},
|
||||||
|
finder_request_timeout = 1500,
|
||||||
|
finder_action_keys = {
|
||||||
|
open = {'o', '<CR>'},
|
||||||
|
vsplit = 's',
|
||||||
|
split = 'i',
|
||||||
|
tabe = 't',
|
||||||
|
quit = {'q', '<ESC>'},
|
||||||
|
},
|
||||||
|
code_action_keys = {
|
||||||
|
quit = 'q',
|
||||||
|
exec = '<CR>',
|
||||||
|
},
|
||||||
|
definition_action_keys = {
|
||||||
|
edit = '<C-c>o',
|
||||||
|
vsplit = '<C-c>v',
|
||||||
|
split = '<C-c>i',
|
||||||
|
tabe = '<C-c>t',
|
||||||
|
quit = 'q',
|
||||||
|
},
|
||||||
|
rename_action_quit = '<C-c>',
|
||||||
|
rename_in_select = true,
|
||||||
|
symbol_in_winbar = {
|
||||||
|
in_custom = false,
|
||||||
|
enable = true,
|
||||||
|
separator = ' ',
|
||||||
|
show_file = true,
|
||||||
|
file_formatter = "",
|
||||||
|
click_support = false,
|
||||||
|
},
|
||||||
|
show_outline = {
|
||||||
|
win_position = 'right',
|
||||||
|
win_with = '',
|
||||||
|
win_width = 30,
|
||||||
|
auto_enter = true,
|
||||||
|
auto_preview = true,
|
||||||
|
virt_text = '┃',
|
||||||
|
jump_key = 'o',
|
||||||
|
auto_refresh = true,
|
||||||
|
},
|
||||||
|
custom_kind = {},
|
||||||
|
server_filetype_map = {},
|
||||||
|
ui = {
|
||||||
|
code_action = signs.CodeAction,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
keymap("n", "<leader>sf", "<cmd>Lspsaga lsp_finder<CR>", { silent = true })
|
||||||
|
keymap("n", "<leader>t", "<cmd>terminal<CR>", { silent = true })
|
||||||
|
keymap({"n","v"}, "<leader>ca", function () saga.code_action() end, {})
|
||||||
|
keymap("n", "gr", "<cmd>Lspsaga rename<CR>", { silent = true })
|
||||||
|
keymap("n", "<F2>", "<cmd>Lspsaga rename<CR>", { silent = true })
|
||||||
|
keymap("n", "gd", "<cmd>Lspsaga peek_definition<CR>", { silent = true })
|
||||||
|
keymap("n", "<leader>cd", "<cmd>Lspsaga show_cursor_diagnostics<CR>", { silent = true })
|
||||||
|
keymap("n", "<leader>cr", "<cmd>Lspsaga rename<CR>", { silent = true })
|
||||||
|
keymap('n', '<leader>e', '<cmd>lua vim.diagnostic.open_float()<CR>', { silent = true })
|
||||||
|
keymap("n", "[e", "<cmd>Lspsaga diagnostic_jump_prev<CR>", { silent = true })
|
||||||
|
keymap("n", "]e", "<cmd>Lspsaga diagnostic_jump_next<CR>", { silent = true })
|
||||||
|
|
||||||
|
keymap("n", "[E", function()
|
||||||
|
require("lspsaga.diagnostic").goto_prev({ severity = vim.diagnostic.severity.ERROR })
|
||||||
|
end, { silent = true })
|
||||||
|
keymap("n", "]E", function()
|
||||||
|
require("lspsaga.diagnostic").goto_next({ severity = vim.diagnostic.severity.ERROR })
|
||||||
|
end, { silent = true })
|
||||||
|
|
||||||
|
-- keymap("n","<leader>o", "<cmd>LSoutlineToggle<CR>",{ silent = true })
|
||||||
|
keymap("n", "K", "<cmd>Lspsaga hover_doc<CR>", { silent = true })
|
||||||
|
keymap("n", "<A-d>", "<cmd>Lspsaga open_floaterm<CR>", { silent = true })
|
||||||
|
keymap("n", "<A-d>", "<cmd>Lspsaga open_floaterm lazygit<CR>", { silent = true })
|
||||||
|
keymap("t", "<A-d>", [[<C-\><C-n><cmd>Lspsaga close_floaterm<CR>]], { silent = true })
|
||||||
|
|
||||||
|
-- Comp
|
||||||
|
|
||||||
|
local cmp = require'cmp'
|
||||||
|
|
||||||
|
cmp.setup{
|
||||||
|
snippet = {
|
||||||
|
expand = function(args)
|
||||||
|
vim.fn["vsnip#anonymous"](args.body)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
window = {
|
||||||
|
completion = {
|
||||||
|
winhighlight = "Normal:Pmenu,FloatBorder:Pmenu,Search:None",
|
||||||
|
col_offset = -3,
|
||||||
|
side_padding = 0,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
formatting = {
|
||||||
|
fields = { "kind", "abbr", "menu" },
|
||||||
|
format = function(entry, vim_item)
|
||||||
|
local kind = require("lspkind").cmp_format({ mode = "symbol_text", maxwidth = 50 })(entry, vim_item)
|
||||||
|
local strings = vim.split(kind.kind, "%s", { trimempty = true })
|
||||||
|
kind.kind = " " .. strings[1] .. " "
|
||||||
|
|
||||||
|
if entry.completion_item.detail then
|
||||||
|
kind.menu = ' "'..entry.completion_item.detail..'"'
|
||||||
|
end
|
||||||
|
|
||||||
|
kind.menu = (kind.menu or "").." (" .. strings[2] .. ") "
|
||||||
|
|
||||||
|
return kind
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
mapping = cmp.mapping.preset.insert({
|
||||||
|
['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
||||||
|
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||||
|
['<C-Space>'] = cmp.mapping.complete(),
|
||||||
|
['<C-e>'] = cmp.mapping.abort(),
|
||||||
|
['<CR>'] = cmp.mapping.confirm({ select = true }),
|
||||||
|
}),
|
||||||
|
sources = cmp.config.sources({
|
||||||
|
{ name = 'nvim_lsp' },
|
||||||
|
{ name = 'vsnip' },
|
||||||
|
}, {
|
||||||
|
{ name = 'buffer' },
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
|
||||||
|
cmp.setup.cmdline({ '/', '?' }, {
|
||||||
|
mapping = cmp.mapping.preset.cmdline(),
|
||||||
|
sources = {
|
||||||
|
{ name = 'buffer' }
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
|
||||||
|
cmp.setup.cmdline(':', {
|
||||||
|
mapping = cmp.mapping.preset.cmdline(),
|
||||||
|
sources = cmp.config.sources({
|
||||||
|
{ name = 'path' }
|
||||||
|
}, {
|
||||||
|
{ name = 'cmdline' }
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Set up lspconfig.
|
||||||
|
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||||
|
|
||||||
|
-- Mappings.
|
||||||
|
-- See `:help vim.diagnostic.*` for documentation on any of the below functions
|
||||||
|
local opts = { noremap=true, silent=true }
|
||||||
|
vim.keymap.set('n', '<space>e', vim.diagnostic.open_float, opts)
|
||||||
|
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts)
|
||||||
|
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts)
|
||||||
|
vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist, opts)
|
||||||
|
|
||||||
|
-- Use an on_attach function to only map the following keys
|
||||||
|
-- after the language server attaches to the current buffer
|
||||||
|
local on_attach = function(client, bufnr)
|
||||||
|
|
||||||
|
require "lsp_signature".on_attach({
|
||||||
|
bind = true,
|
||||||
|
handler_opts = {
|
||||||
|
border = "rounded"
|
||||||
|
}
|
||||||
|
}, bufnr)
|
||||||
|
|
||||||
|
-- Enable completion triggered by <c-x><c-o>
|
||||||
|
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
|
||||||
|
|
||||||
|
-- Mappings.
|
||||||
|
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
||||||
|
local bufopts = { noremap=true, silent=true, buffer=bufnr }
|
||||||
|
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts)
|
||||||
|
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts)
|
||||||
|
vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts)
|
||||||
|
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts)
|
||||||
|
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, bufopts)
|
||||||
|
vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, bufopts)
|
||||||
|
vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder, bufopts)
|
||||||
|
vim.keymap.set('n', '<space>wl', function()
|
||||||
|
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||||
|
end, bufopts)
|
||||||
|
vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, bufopts)
|
||||||
|
vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, bufopts)
|
||||||
|
vim.keymap.set('n', '<space>ca', vim.lsp.buf.code_action, bufopts)
|
||||||
|
vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts)
|
||||||
|
vim.keymap.set('n', '<space>gf', function() vim.lsp.buf.format { async = true } end, bufopts)
|
||||||
|
end
|
||||||
|
|
||||||
|
local lsp_flags = {
|
||||||
|
-- This is the default in Nvim 0.7+
|
||||||
|
debounce_text_changes = 150,
|
||||||
|
}
|
||||||
|
|
||||||
|
require 'andr3.langs.rust'.setup(on_attach, lsp_flags, capabilities)
|
||||||
|
require 'andr3.langs.ts'.setup(on_attach, lsp_flags, capabilities)
|
||||||
|
require 'andr3.langs.prisma'.setup(on_attach, lsp_flags, capabilities)
|
||||||
|
require 'andr3.langs.svelte'.setup(on_attach, lsp_flags, capabilities)
|
||||||
|
require 'andr3.langs.ccls'.setup(on_attach, lsp_flags, capabilities)
|
||||||
|
require 'andr3.langs.python'.setup(on_attach, lsp_flags, capabilities)
|
||||||
|
require 'andr3.langs.bash'.setup(on_attach, lsp_flags, capabilities)
|
||||||
|
require 'andr3.langs.zig'.setup(on_attach, lsp_flags, capabilities)
|
||||||
|
require 'andr3.langs.tex'.setup(on_attach, lsp_flags, capabilities)
|
||||||
|
require 'andr3.langs.ocaml'.setup(on_attach, lsp_flags, capabilities)
|
||||||
|
require 'andr3.langs.go'.setup(on_attach, lsp_flags, capabilities)
|
||||||
|
require 'andr3.langs.htmlcss'.setup(on_attach, lsp_flags, capabilities)
|
||||||
|
|
66
lua/andr3/lsp_adds/icons.lua
Normal file
66
lua/andr3/lsp_adds/icons.lua
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
local O = { }
|
||||||
|
|
||||||
|
local kind_icons = {
|
||||||
|
Text = "",
|
||||||
|
Method = "",
|
||||||
|
Function = "",
|
||||||
|
Constructor = "",
|
||||||
|
Field = '',
|
||||||
|
Variable = "",
|
||||||
|
Class = "ﴯ",
|
||||||
|
Interface = "",
|
||||||
|
Module = "",
|
||||||
|
Property = "ﰠ",
|
||||||
|
Unit = "",
|
||||||
|
Value = "",
|
||||||
|
Enum = "",
|
||||||
|
Keyword = "",
|
||||||
|
Snippet = "",
|
||||||
|
Color = "",
|
||||||
|
File = "",
|
||||||
|
Reference = "",
|
||||||
|
Folder = "",
|
||||||
|
EnumMember = "",
|
||||||
|
Constant = '',
|
||||||
|
Struct = "",
|
||||||
|
Event = "",
|
||||||
|
Operator = "",
|
||||||
|
TypeParameter = ""
|
||||||
|
}
|
||||||
|
O.kind_icons = kind_icons;
|
||||||
|
|
||||||
|
local signs = { Error = "☣️ ", Warn = "😞", Hint = "❤️ ", Info = "🆓", CodeAction = "🈁" }
|
||||||
|
O.signs = signs;
|
||||||
|
|
||||||
|
-- Set the icons {{{
|
||||||
|
require('vim.lsp.protocol').CompletionItemKind = {
|
||||||
|
kind_icons.Text,
|
||||||
|
kind_icons.Method,
|
||||||
|
kind_icons.Function,
|
||||||
|
kind_icons.Constructor,
|
||||||
|
kind_icons.Field,
|
||||||
|
kind_icons.Variable,
|
||||||
|
kind_icons.Class,
|
||||||
|
kind_icons.Interface,
|
||||||
|
kind_icons.Module,
|
||||||
|
kind_icons.Property,
|
||||||
|
kind_icons.Unit,
|
||||||
|
kind_icons.Value,
|
||||||
|
kind_icons.Enum,
|
||||||
|
kind_icons.Keyword,
|
||||||
|
kind_icons.Snippet,
|
||||||
|
kind_icons.Color,
|
||||||
|
kind_icons.File,
|
||||||
|
kind_icons.Reference,
|
||||||
|
kind_icons.Folder,
|
||||||
|
kind_icons.EnumMember,
|
||||||
|
kind_icons.Constant,
|
||||||
|
kind_icons.Struct,
|
||||||
|
kind_icons.Event,
|
||||||
|
kind_icons.Operator,
|
||||||
|
kind_icons.TypeParameter,
|
||||||
|
}
|
||||||
|
|
||||||
|
-- }}}
|
||||||
|
|
||||||
|
return O;
|
61
lua/andr3/lsp_adds/lsp_signature.lua
Normal file
61
lua/andr3/lsp_adds/lsp_signature.lua
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
cfg = {
|
||||||
|
debug = false, -- set to true to enable debug logging
|
||||||
|
log_path = vim.fn.stdpath("cache") .. "/lsp_signature.log", -- log dir when debug is on
|
||||||
|
-- default is ~/.cache/nvim/lsp_signature.log
|
||||||
|
verbose = false, -- show debug line number
|
||||||
|
|
||||||
|
bind = true, -- This is mandatory, otherwise border config won't get registered.
|
||||||
|
-- If you want to hook lspsaga or other signature handler, pls set to false
|
||||||
|
doc_lines = 10, -- will show two lines of comment/doc(if there are more than two lines in doc, will be truncated);
|
||||||
|
-- set to 0 if you DO NOT want any API comments be shown
|
||||||
|
-- This setting only take effect in insert mode, it does not affect signature help in normal
|
||||||
|
-- mode, 10 by default
|
||||||
|
|
||||||
|
max_height = 12, -- max height of signature floating_window
|
||||||
|
max_width = 80, -- max_width of signature floating_window
|
||||||
|
noice = false, -- set to true if you using noice to render markdown
|
||||||
|
wrap = true, -- allow doc/signature text wrap inside floating_window, useful if your lsp return doc/sig is too long
|
||||||
|
|
||||||
|
floating_window = true, -- show hint in a floating window, set to false for virtual text only mode
|
||||||
|
|
||||||
|
floating_window_above_cur_line = true, -- try to place the floating above the current line when possible Note:
|
||||||
|
-- will set to true when fully tested, set to false will use whichever side has more space
|
||||||
|
-- this setting will be helpful if you do not want the PUM and floating win overlap
|
||||||
|
|
||||||
|
floating_window_off_x = 1, -- adjust float windows x position.
|
||||||
|
-- can be either a number or function
|
||||||
|
floating_window_off_y = 0, -- adjust float windows y position. e.g -2 move window up 2 lines; 2 move down 2 lines
|
||||||
|
-- can be either number or function, see examples
|
||||||
|
|
||||||
|
close_timeout = 4000, -- close floating window after ms when laster parameter is entered
|
||||||
|
fix_pos = false, -- set to true, the floating window will not auto-close until finish all parameters
|
||||||
|
hint_enable = true, -- virtual hint enable
|
||||||
|
hint_prefix = "🐼 ", -- Panda for parameter, NOTE: for the terminal not support emoji, might crash
|
||||||
|
hint_scheme = "String",
|
||||||
|
hint_inline = function() return false end, -- should the hint be inline(nvim 0.10 only)? default false
|
||||||
|
hi_parameter = "LspSignatureActiveParameter", -- how your parameter will be highlight
|
||||||
|
handler_opts = {
|
||||||
|
border = "rounded" -- double, rounded, single, shadow, none, or a table of borders
|
||||||
|
},
|
||||||
|
|
||||||
|
always_trigger = false, -- sometime show signature on new line or in middle of parameter can be confusing, set it to false for #58
|
||||||
|
|
||||||
|
auto_close_after = nil, -- autoclose signature float win after x sec, disabled if nil.
|
||||||
|
extra_trigger_chars = {}, -- Array of extra characters that will trigger signature completion, e.g., {"(", ","}
|
||||||
|
zindex = 200, -- by default it will be on top of all floating windows, set to <= 50 send it to bottom
|
||||||
|
|
||||||
|
padding = '', -- character to pad on left and right of signature can be ' ', or '|' etc
|
||||||
|
|
||||||
|
transparency = nil, -- disabled by default, allow floating win transparent value 1~100
|
||||||
|
shadow_blend = 36, -- if you using shadow as border use this set the opacity
|
||||||
|
shadow_guibg = 'Black', -- if you using shadow as border use this set the color e.g. 'Green' or '#121315'
|
||||||
|
timer_interval = 200, -- default timer check interval set to lower value if you want to reduce latency
|
||||||
|
toggle_key = nil, -- toggle signature on and off in insert mode, e.g. toggle_key = '<M-x>'
|
||||||
|
toggle_key_flip_floatwin_setting = false, -- true: toggle float setting after toggle key pressed
|
||||||
|
|
||||||
|
select_signature_key = nil, -- cycle to next signature, e.g. '<M-n>' function overloading
|
||||||
|
move_cursor_key = nil, -- imap, use nvim_set_current_win to move cursor between current win and floating
|
||||||
|
}
|
||||||
|
|
||||||
|
-- recommended:
|
||||||
|
require'lsp_signature'.setup(cfg) -- no need to specify bufnr if you don't use toggle_key
|
7
lua/andr3/lsp_adds/null-ls.lua
Normal file
7
lua/andr3/lsp_adds/null-ls.lua
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
local null_ls = require('null-ls')
|
||||||
|
|
||||||
|
null_ls.setup({
|
||||||
|
sources = {
|
||||||
|
null_ls.builtins.diagnostics.eslint,
|
||||||
|
},
|
||||||
|
})
|
35
lua/andr3/lsp_adds/prettier.lua
Normal file
35
lua/andr3/lsp_adds/prettier.lua
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
-- prettier
|
||||||
|
|
||||||
|
local prettier = require("prettier")
|
||||||
|
|
||||||
|
prettier.setup({
|
||||||
|
bin = 'prettier',
|
||||||
|
filetypes = {
|
||||||
|
"css",
|
||||||
|
"graphql",
|
||||||
|
"html",
|
||||||
|
"javascript",
|
||||||
|
"javascriptreact",
|
||||||
|
"json",
|
||||||
|
"less",
|
||||||
|
"markdown",
|
||||||
|
"scss",
|
||||||
|
"typescript",
|
||||||
|
"typescriptreact",
|
||||||
|
"yaml",
|
||||||
|
"svelte",
|
||||||
|
},
|
||||||
|
["null-ls"] = {
|
||||||
|
condition = function()
|
||||||
|
return prettier.config_exists({
|
||||||
|
-- if `false`, skips checking `package.json` for `"prettier"` key
|
||||||
|
check_package_json = true,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
runtime_condition = function(params)
|
||||||
|
-- return false to skip running prettier
|
||||||
|
return true
|
||||||
|
end,
|
||||||
|
timeout = 5000,
|
||||||
|
}
|
||||||
|
})
|
2
lua/andr3/neogit.lua
Normal file
2
lua/andr3/neogit.lua
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
local neogit = require('neogit')
|
||||||
|
neogit.setup {}
|
84
lua/andr3/packer.lua
Normal file
84
lua/andr3/packer.lua
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
|
||||||
|
vim.cmd [[packadd packer.nvim]]
|
||||||
|
|
||||||
|
return require('packer').startup(function()
|
||||||
|
|
||||||
|
use 'wbthomason/packer.nvim'
|
||||||
|
|
||||||
|
-- themes
|
||||||
|
use 'macguirerintoul/night_owl_light.vim'
|
||||||
|
use 'ayu-theme/ayu-vim'
|
||||||
|
use 'hachy/eva01.vim'
|
||||||
|
use 'thedenisnikulin/vim-cyberpunk'
|
||||||
|
use { "catppuccin/nvim", as = "catppuccin" }
|
||||||
|
use {'nyoom-engineering/oxocarbon.nvim'}
|
||||||
|
use 'NLKNguyen/papercolor-theme'
|
||||||
|
|
||||||
|
-- use 'baskerville/bubblegum'
|
||||||
|
use 'git@git.andr3h3nriqu3s.com:andr3/bubblegum-theme.git'
|
||||||
|
use 'xiyaowong/transparent.nvim'
|
||||||
|
|
||||||
|
-- other stuff
|
||||||
|
|
||||||
|
use 'neovim/nvim-lspconfig'
|
||||||
|
use 'ray-x/lsp_signature.nvim'
|
||||||
|
|
||||||
|
use 'jose-elias-alvarez/null-ls.nvim'
|
||||||
|
|
||||||
|
use 'MunifTanjim/prettier.nvim'
|
||||||
|
|
||||||
|
use { 'NeogitOrg/neogit', requires = 'nvim-lua/plenary.nvim' }
|
||||||
|
|
||||||
|
use 'hrsh7th/cmp-nvim-lsp'
|
||||||
|
use 'hrsh7th/cmp-buffer'
|
||||||
|
use 'hrsh7th/cmp-path'
|
||||||
|
use 'hrsh7th/cmp-cmdline'
|
||||||
|
use 'hrsh7th/nvim-cmp'
|
||||||
|
use 'hrsh7th/vim-vsnip'
|
||||||
|
|
||||||
|
use 'chrisbra/vim-commentary'
|
||||||
|
|
||||||
|
use 'onsails/lspkind.nvim'
|
||||||
|
use 'editorconfig/editorconfig-vim'
|
||||||
|
|
||||||
|
use({
|
||||||
|
"glepnir/lspsaga.nvim",
|
||||||
|
branch = "main",
|
||||||
|
})
|
||||||
|
|
||||||
|
-- use 'junegunn/fzf.vim'
|
||||||
|
use 'nvim-telescope/telescope.nvim'
|
||||||
|
|
||||||
|
use 'othree/html5.vim'
|
||||||
|
use 'pangloss/vim-javascript'
|
||||||
|
use 'evanleck/vim-svelte'
|
||||||
|
|
||||||
|
use 'nvim-lualine/lualine.nvim'
|
||||||
|
-- If you want to have icons in your statusline choose one of these
|
||||||
|
use 'nvim-tree/nvim-web-devicons'
|
||||||
|
|
||||||
|
use 'airblade/vim-gitgutter'
|
||||||
|
|
||||||
|
use 'mbbill/undotree'
|
||||||
|
|
||||||
|
use "nvim-lua/plenary.nvim"
|
||||||
|
|
||||||
|
use {
|
||||||
|
'nvim-tree/nvim-tree.lua',
|
||||||
|
requires = {
|
||||||
|
'nvim-tree/nvim-web-devicons', -- optional, for file icons
|
||||||
|
},
|
||||||
|
tag = 'nightly' -- optional, updated every week. (see issue #1193)
|
||||||
|
}
|
||||||
|
|
||||||
|
use {
|
||||||
|
'nvim-treesitter/nvim-treesitter',
|
||||||
|
run = function()
|
||||||
|
local ts_update = require('nvim-treesitter.install').update({ with_sync = true })
|
||||||
|
ts_update()
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
|
||||||
|
use 'mg979/vim-visual-multi'
|
||||||
|
end)
|
||||||
|
|
@ -1,10 +0,0 @@
|
|||||||
return {
|
|
||||||
"folke/lazy.nvim",
|
|
||||||
|
|
||||||
{ 'nvim-lua/plenary.nvim', name = "plenary" },
|
|
||||||
|
|
||||||
'mbbill/undotree',
|
|
||||||
'tpope/vim-fugitive',
|
|
||||||
|
|
||||||
'eandrju/cellular-automaton.nvim',
|
|
||||||
}
|
|
@ -1,136 +0,0 @@
|
|||||||
function setup_attach()
|
|
||||||
vim.api.nvim_create_autocmd('LspAttach', {
|
|
||||||
group = vim.api.nvim_create_augroup('UserLspConfig', {}),
|
|
||||||
callback = function (ev)
|
|
||||||
-- local lspconfig = require('lspconfig')
|
|
||||||
--
|
|
||||||
vim.bo[ev.buf].omnifunc = 'v:lua.vim.lsp.omnifunc'
|
|
||||||
|
|
||||||
local opts = { buffer = ev.buf }
|
|
||||||
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts)
|
|
||||||
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts)
|
|
||||||
vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts)
|
|
||||||
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, opts)
|
|
||||||
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, opts)
|
|
||||||
-- vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, opts)
|
|
||||||
-- vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder, opts)
|
|
||||||
-- vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, opts)
|
|
||||||
-- vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, opts)
|
|
||||||
vim.keymap.set({ 'n', 'v' }, '<leader>ca', vim.lsp.buf.code_action, opts)
|
|
||||||
vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts)
|
|
||||||
vim.keymap.set('n', 'gf', function()
|
|
||||||
vim.lsp.buf.format { async = true }
|
|
||||||
end, opts)
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
function setup_cmp()
|
|
||||||
local cmp = require('cmp')
|
|
||||||
cmp.setup({
|
|
||||||
snippet = {
|
|
||||||
expand = function(args)
|
|
||||||
require('luasnip').lsp_expand(args.body)
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
window = {
|
|
||||||
-- completion = cmp.config.window.bordered(),
|
|
||||||
-- documentation = cmp.config.window.bordered(),
|
|
||||||
},
|
|
||||||
mapping = cmp.mapping.preset.insert({
|
|
||||||
['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
|
||||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
|
||||||
['<C-Space>'] = cmp.mapping.complete(),
|
|
||||||
['<C-e>'] = cmp.mapping.abort(),
|
|
||||||
['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
|
||||||
}),
|
|
||||||
sources = cmp.config.sources({
|
|
||||||
{ name = 'nvim_lsp' },
|
|
||||||
{ name = 'luasnip' },
|
|
||||||
}, {
|
|
||||||
{ name = 'buffer' },
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
cmp.setup.cmdline(':', {
|
|
||||||
mapping = cmp.mapping.preset.cmdline(),
|
|
||||||
sources = cmp.config.sources({
|
|
||||||
{ name = 'path' }
|
|
||||||
}, {
|
|
||||||
{ name = 'cmdline' }
|
|
||||||
})
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
return {
|
|
||||||
|
|
||||||
{
|
|
||||||
"j-hui/fidget.nvim",
|
|
||||||
name = "fidget",
|
|
||||||
opts = {}
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
"neovim/nvim-lspconfig",
|
|
||||||
dependencies = {
|
|
||||||
'neovim/nvim-lspconfig',
|
|
||||||
'hrsh7th/cmp-nvim-lsp',
|
|
||||||
'hrsh7th/cmp-buffer',
|
|
||||||
'hrsh7th/cmp-path',
|
|
||||||
'hrsh7th/cmp-cmdline',
|
|
||||||
'hrsh7th/nvim-cmp',
|
|
||||||
'saadparwaiz1/cmp_luasnip',
|
|
||||||
"ray-x/lsp_signature.nvim",
|
|
||||||
'luasnip',
|
|
||||||
'fidget',
|
|
||||||
},
|
|
||||||
config = function()
|
|
||||||
local lspconfig = require('lspconfig')
|
|
||||||
|
|
||||||
vim.diagnostic.config({
|
|
||||||
virtual_text = {
|
|
||||||
prefix = "👈",
|
|
||||||
},
|
|
||||||
signs = {
|
|
||||||
text = {
|
|
||||||
[vim.diagnostic.severity.ERROR] = "🆒",
|
|
||||||
[vim.diagnostic.severity.WARN] = "😞",
|
|
||||||
[vim.diagnostic.severity.HINT] = "🆘",
|
|
||||||
[vim.diagnostic.severity.INFO] = "🆓",
|
|
||||||
CodeAction = "🈁",
|
|
||||||
}
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Check out trouble
|
|
||||||
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev)
|
|
||||||
vim.keymap.set('n', ']d', vim.diagnostic.goto_next)
|
|
||||||
|
|
||||||
setup_attach()
|
|
||||||
setup_cmp()
|
|
||||||
|
|
||||||
local capabilities = vim.tbl_deep_extend(
|
|
||||||
"force",
|
|
||||||
{},
|
|
||||||
vim.lsp.protocol.make_client_capabilities(),
|
|
||||||
require('cmp_nvim_lsp').default_capabilities()
|
|
||||||
)
|
|
||||||
|
|
||||||
local def_set_servers = { "tsserver", "svelte", "zls", "gopls" }
|
|
||||||
|
|
||||||
for _, server_name in ipairs(def_set_servers) do
|
|
||||||
lspconfig[server_name].setup({
|
|
||||||
capabilities = capabilities,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
lspconfig.elixirls.setup({
|
|
||||||
cmd = { "elixir-ls" },
|
|
||||||
capabilities = capabilities,
|
|
||||||
})
|
|
||||||
|
|
||||||
require("lsp_signature").on_attach({bind = true})
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
}
|
|
@ -1,11 +0,0 @@
|
|||||||
|
|
||||||
return {
|
|
||||||
'L3MON4D3/LuaSnip',
|
|
||||||
name = "luasnip",
|
|
||||||
dependencies = {
|
|
||||||
"rafamadriz/friendly-snippets"
|
|
||||||
},
|
|
||||||
config = function()
|
|
||||||
require("luasnip.loaders.from_vscode").lazy_load()
|
|
||||||
end
|
|
||||||
}
|
|
@ -1,8 +0,0 @@
|
|||||||
return {
|
|
||||||
"danymat/neogen",
|
|
||||||
dependencies = {"nvim-treesitter/nvim-treesitter"},
|
|
||||||
config = function()
|
|
||||||
require('neogen').setup({})
|
|
||||||
vim.keymap.set("n", "<leader>gc", ":lua require('neogen').generate()<CR>", opts)
|
|
||||||
end,
|
|
||||||
}
|
|
@ -1,20 +0,0 @@
|
|||||||
return {
|
|
||||||
'nvim-telescope/telescope.nvim',
|
|
||||||
dependencies = { "plenary" },
|
|
||||||
config = function()
|
|
||||||
local telescope = require('telescope.builtin')
|
|
||||||
|
|
||||||
vim.keymap.set('n', '<leader>f', telescope.find_files, {})
|
|
||||||
vim.keymap.set('n', '<leader>/', telescope.live_grep, {})
|
|
||||||
vim.keymap.set('n', '<leader>b', telescope.buffers, {})
|
|
||||||
vim.keymap.set('n', '<leader>?', telescope.help_tags, {})
|
|
||||||
vim.keymap.set('n', '<leader>pws', function()
|
|
||||||
local word = vim.fn.expand("<cword>")
|
|
||||||
telescope.grep_string({search = word})
|
|
||||||
end)
|
|
||||||
vim.keymap.set('n', '<leader>pWs', function()
|
|
||||||
local word = vim.fn.expand("<cWORD>")
|
|
||||||
telescope.grep_string({search = word})
|
|
||||||
end)
|
|
||||||
end,
|
|
||||||
}
|
|
@ -1,8 +0,0 @@
|
|||||||
return {
|
|
||||||
{
|
|
||||||
"git@git.andr3h3nriqu3s.com:andr3/bubblegum-theme.git",
|
|
||||||
config = function()
|
|
||||||
vim.cmd('colorscheme bubblegum-256-light')
|
|
||||||
end
|
|
||||||
},
|
|
||||||
}
|
|
@ -1,22 +0,0 @@
|
|||||||
return {
|
|
||||||
{
|
|
||||||
'nvim-treesitter/nvim-treesitter',
|
|
||||||
config = function()
|
|
||||||
local ts_update = require('nvim-treesitter.install').update({ with_sync = true });
|
|
||||||
ts_update()
|
|
||||||
|
|
||||||
require('nvim-treesitter.configs').setup({
|
|
||||||
ensure_installed = {
|
|
||||||
"lua", "svelte", "javascript", "typescript", "html", "elixir", "vim",
|
|
||||||
"jsdoc", "go",
|
|
||||||
},
|
|
||||||
|
|
||||||
auto_install = true,
|
|
||||||
|
|
||||||
highlight = {
|
|
||||||
enable = true
|
|
||||||
}
|
|
||||||
})
|
|
||||||
end
|
|
||||||
},
|
|
||||||
}
|
|
@ -10,10 +10,11 @@ vim.opt.hlsearch = false
|
|||||||
vim.opt.incsearch = true
|
vim.opt.incsearch = true
|
||||||
|
|
||||||
vim.opt.smartindent = true
|
vim.opt.smartindent = true
|
||||||
|
|
||||||
vim.opt.wrap = true
|
vim.opt.wrap = true
|
||||||
|
|
||||||
vim.opt.clipboard = "unnamedplus"
|
vim.opt.clipboard = "unnamedplus"
|
||||||
vim.opt.signcolumn = "number"
|
vim.opt.signcolumn = "number"
|
||||||
|
|
||||||
vim.opt.termguicolors = true
|
vim.g.mapleader = " "
|
||||||
vim.opt.cursorline = true
|
vim.g.maplocalleader = " "
|
||||||
|
274
plugin/packer_compiled.lua
Normal file
274
plugin/packer_compiled.lua
Normal file
@ -0,0 +1,274 @@
|
|||||||
|
-- Automatically generated packer.nvim plugin loader code
|
||||||
|
|
||||||
|
if vim.api.nvim_call_function('has', {'nvim-0.5'}) ~= 1 then
|
||||||
|
vim.api.nvim_command('echohl WarningMsg | echom "Invalid Neovim version for packer.nvim! | echohl None"')
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.api.nvim_command('packadd packer.nvim')
|
||||||
|
|
||||||
|
local no_errors, error_msg = pcall(function()
|
||||||
|
|
||||||
|
_G._packer = _G._packer or {}
|
||||||
|
_G._packer.inside_compile = true
|
||||||
|
|
||||||
|
local time
|
||||||
|
local profile_info
|
||||||
|
local should_profile = false
|
||||||
|
if should_profile then
|
||||||
|
local hrtime = vim.loop.hrtime
|
||||||
|
profile_info = {}
|
||||||
|
time = function(chunk, start)
|
||||||
|
if start then
|
||||||
|
profile_info[chunk] = hrtime()
|
||||||
|
else
|
||||||
|
profile_info[chunk] = (hrtime() - profile_info[chunk]) / 1e6
|
||||||
|
end
|
||||||
|
end
|
||||||
|
else
|
||||||
|
time = function(chunk, start) end
|
||||||
|
end
|
||||||
|
|
||||||
|
local function save_profiles(threshold)
|
||||||
|
local sorted_times = {}
|
||||||
|
for chunk_name, time_taken in pairs(profile_info) do
|
||||||
|
sorted_times[#sorted_times + 1] = {chunk_name, time_taken}
|
||||||
|
end
|
||||||
|
table.sort(sorted_times, function(a, b) return a[2] > b[2] end)
|
||||||
|
local results = {}
|
||||||
|
for i, elem in ipairs(sorted_times) do
|
||||||
|
if not threshold or threshold and elem[2] > threshold then
|
||||||
|
results[i] = elem[1] .. ' took ' .. elem[2] .. 'ms'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if threshold then
|
||||||
|
table.insert(results, '(Only showing plugins that took longer than ' .. threshold .. ' ms ' .. 'to load)')
|
||||||
|
end
|
||||||
|
|
||||||
|
_G._packer.profile_output = results
|
||||||
|
end
|
||||||
|
|
||||||
|
time([[Luarocks path setup]], true)
|
||||||
|
local package_path_str = "/home/andr3/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?.lua;/home/andr3/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?/init.lua;/home/andr3/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?.lua;/home/andr3/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?/init.lua"
|
||||||
|
local install_cpath_pattern = "/home/andr3/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/?.so"
|
||||||
|
if not string.find(package.path, package_path_str, 1, true) then
|
||||||
|
package.path = package.path .. ';' .. package_path_str
|
||||||
|
end
|
||||||
|
|
||||||
|
if not string.find(package.cpath, install_cpath_pattern, 1, true) then
|
||||||
|
package.cpath = package.cpath .. ';' .. install_cpath_pattern
|
||||||
|
end
|
||||||
|
|
||||||
|
time([[Luarocks path setup]], false)
|
||||||
|
time([[try_loadstring definition]], true)
|
||||||
|
local function try_loadstring(s, component, name)
|
||||||
|
local success, result = pcall(loadstring(s), name, _G.packer_plugins[name])
|
||||||
|
if not success then
|
||||||
|
vim.schedule(function()
|
||||||
|
vim.api.nvim_notify('packer.nvim: Error running ' .. component .. ' for ' .. name .. ': ' .. result, vim.log.levels.ERROR, {})
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
return result
|
||||||
|
end
|
||||||
|
|
||||||
|
time([[try_loadstring definition]], false)
|
||||||
|
time([[Defining packer_plugins]], true)
|
||||||
|
_G.packer_plugins = {
|
||||||
|
["ayu-vim"] = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/ayu-vim",
|
||||||
|
url = "https://github.com/ayu-theme/ayu-vim"
|
||||||
|
},
|
||||||
|
["bubblegum-theme.git"] = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/bubblegum-theme.git",
|
||||||
|
url = "git@git.andr3h3nriqu3s.com:andr3/bubblegum-theme"
|
||||||
|
},
|
||||||
|
catppuccin = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/catppuccin",
|
||||||
|
url = "https://github.com/catppuccin/nvim"
|
||||||
|
},
|
||||||
|
["cmp-buffer"] = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/cmp-buffer",
|
||||||
|
url = "https://github.com/hrsh7th/cmp-buffer"
|
||||||
|
},
|
||||||
|
["cmp-cmdline"] = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/cmp-cmdline",
|
||||||
|
url = "https://github.com/hrsh7th/cmp-cmdline"
|
||||||
|
},
|
||||||
|
["cmp-nvim-lsp"] = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/cmp-nvim-lsp",
|
||||||
|
url = "https://github.com/hrsh7th/cmp-nvim-lsp"
|
||||||
|
},
|
||||||
|
["cmp-path"] = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/cmp-path",
|
||||||
|
url = "https://github.com/hrsh7th/cmp-path"
|
||||||
|
},
|
||||||
|
["editorconfig-vim"] = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/editorconfig-vim",
|
||||||
|
url = "https://github.com/editorconfig/editorconfig-vim"
|
||||||
|
},
|
||||||
|
["eva01.vim"] = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/eva01.vim",
|
||||||
|
url = "https://github.com/hachy/eva01.vim"
|
||||||
|
},
|
||||||
|
["html5.vim"] = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/html5.vim",
|
||||||
|
url = "https://github.com/othree/html5.vim"
|
||||||
|
},
|
||||||
|
["lsp_signature.nvim"] = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/lsp_signature.nvim",
|
||||||
|
url = "https://github.com/ray-x/lsp_signature.nvim"
|
||||||
|
},
|
||||||
|
["lspkind.nvim"] = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/lspkind.nvim",
|
||||||
|
url = "https://github.com/onsails/lspkind.nvim"
|
||||||
|
},
|
||||||
|
["lspsaga.nvim"] = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/lspsaga.nvim",
|
||||||
|
url = "https://github.com/glepnir/lspsaga.nvim"
|
||||||
|
},
|
||||||
|
["lualine.nvim"] = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/lualine.nvim",
|
||||||
|
url = "https://github.com/nvim-lualine/lualine.nvim"
|
||||||
|
},
|
||||||
|
neogit = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/neogit",
|
||||||
|
url = "https://github.com/NeogitOrg/neogit"
|
||||||
|
},
|
||||||
|
["night_owl_light.vim"] = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/night_owl_light.vim",
|
||||||
|
url = "https://github.com/macguirerintoul/night_owl_light.vim"
|
||||||
|
},
|
||||||
|
["null-ls.nvim"] = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/null-ls.nvim",
|
||||||
|
url = "https://github.com/jose-elias-alvarez/null-ls.nvim"
|
||||||
|
},
|
||||||
|
["nvim-cmp"] = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/nvim-cmp",
|
||||||
|
url = "https://github.com/hrsh7th/nvim-cmp"
|
||||||
|
},
|
||||||
|
["nvim-lspconfig"] = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/nvim-lspconfig",
|
||||||
|
url = "https://github.com/neovim/nvim-lspconfig"
|
||||||
|
},
|
||||||
|
["nvim-tree.lua"] = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/nvim-tree.lua",
|
||||||
|
url = "https://github.com/nvim-tree/nvim-tree.lua"
|
||||||
|
},
|
||||||
|
["nvim-treesitter"] = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/nvim-treesitter",
|
||||||
|
url = "https://github.com/nvim-treesitter/nvim-treesitter"
|
||||||
|
},
|
||||||
|
["nvim-web-devicons"] = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/nvim-web-devicons",
|
||||||
|
url = "https://github.com/nvim-tree/nvim-web-devicons"
|
||||||
|
},
|
||||||
|
["oxocarbon.nvim"] = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/oxocarbon.nvim",
|
||||||
|
url = "https://github.com/nyoom-engineering/oxocarbon.nvim"
|
||||||
|
},
|
||||||
|
["packer.nvim"] = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/packer.nvim",
|
||||||
|
url = "https://github.com/wbthomason/packer.nvim"
|
||||||
|
},
|
||||||
|
["papercolor-theme"] = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/papercolor-theme",
|
||||||
|
url = "https://github.com/NLKNguyen/papercolor-theme"
|
||||||
|
},
|
||||||
|
["plenary.nvim"] = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/plenary.nvim",
|
||||||
|
url = "https://github.com/nvim-lua/plenary.nvim"
|
||||||
|
},
|
||||||
|
["prettier.nvim"] = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/prettier.nvim",
|
||||||
|
url = "https://github.com/MunifTanjim/prettier.nvim"
|
||||||
|
},
|
||||||
|
["telescope.nvim"] = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/telescope.nvim",
|
||||||
|
url = "https://github.com/nvim-telescope/telescope.nvim"
|
||||||
|
},
|
||||||
|
undotree = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/undotree",
|
||||||
|
url = "https://github.com/mbbill/undotree"
|
||||||
|
},
|
||||||
|
["vim-commentary"] = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/vim-commentary",
|
||||||
|
url = "https://github.com/chrisbra/vim-commentary"
|
||||||
|
},
|
||||||
|
["vim-cyberpunk"] = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/vim-cyberpunk",
|
||||||
|
url = "https://github.com/thedenisnikulin/vim-cyberpunk"
|
||||||
|
},
|
||||||
|
["vim-gitgutter"] = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/vim-gitgutter",
|
||||||
|
url = "https://github.com/airblade/vim-gitgutter"
|
||||||
|
},
|
||||||
|
["vim-javascript"] = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/vim-javascript",
|
||||||
|
url = "https://github.com/pangloss/vim-javascript"
|
||||||
|
},
|
||||||
|
["vim-svelte"] = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/vim-svelte",
|
||||||
|
url = "https://github.com/evanleck/vim-svelte"
|
||||||
|
},
|
||||||
|
["vim-visual-multi"] = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/vim-visual-multi",
|
||||||
|
url = "https://github.com/mg979/vim-visual-multi"
|
||||||
|
},
|
||||||
|
["vim-vsnip"] = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/vim-vsnip",
|
||||||
|
url = "https://github.com/hrsh7th/vim-vsnip"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
time([[Defining packer_plugins]], false)
|
||||||
|
|
||||||
|
_G._packer.inside_compile = false
|
||||||
|
if _G._packer.needs_bufread == true then
|
||||||
|
vim.cmd("doautocmd BufRead")
|
||||||
|
end
|
||||||
|
_G._packer.needs_bufread = false
|
||||||
|
|
||||||
|
if should_profile then save_profiles() end
|
||||||
|
|
||||||
|
end)
|
||||||
|
|
||||||
|
if not no_errors then
|
||||||
|
error_msg = error_msg:gsub('"', '\\"')
|
||||||
|
vim.api.nvim_command('echohl ErrorMsg | echom "Error in packer_compiled: '..error_msg..'" | echom "Please check your config for correctness" | echohl None')
|
||||||
|
end
|
Loading…
Reference in New Issue
Block a user