Installed tabnine

This commit is contained in:
Kristofers Solo 2023-06-14 17:40:26 +03:00
parent b6665c490e
commit 3bbf37a81b
51 changed files with 866 additions and 524 deletions

View File

@ -1,86 +0,0 @@
local status_ok, bufferline = pcall(require, "bufferline")
if not status_ok then
return
end
bufferline.setup({
options = {
close_command = "Bdelete! %d", -- can be a string | function, see "Mouse actions"
right_mouse_command = "Bdelete! %d", -- can be a string | function, see "Mouse actions"
offsets = { { filetype = "NvimTree", text = "", padding = 1 } },
separator_style = "thin", -- | "thick" | "thin" | { 'any', 'any' },
},
highlights = {
fill = {
fg = { attribute = "fg", highlight = "ff0000" },
bg = { attribute = "bg", highlight = "TabLine" },
},
background = {
fg = { attribute = "fg", highlight = "TabLine" },
bg = { attribute = "bg", highlight = "TabLine" },
},
buffer_visible = {
fg = { attribute = "fg", highlight = "TabLine" },
bg = { attribute = "bg", highlight = "TabLine" },
},
close_button = {
fg = { attribute = "fg", highlight = "TabLine" },
bg = { attribute = "bg", highlight = "TabLine" },
},
close_button_visible = {
fg = { attribute = "fg", highlight = "TabLine" },
bg = { attribute = "bg", highlight = "TabLine" },
},
tab_selected = {
fg = { attribute = "fg", highlight = "Normal" },
bg = { attribute = "bg", highlight = "Normal" },
},
tab = {
fg = { attribute = "fg", highlight = "TabLine" },
bg = { attribute = "bg", highlight = "TabLine" },
},
tab_close = {
fg = { attribute = "fg", highlight = "TabLineSel" },
bg = { attribute = "bg", highlight = "Normal" },
},
duplicate_selected = {
fg = { attribute = "fg", highlight = "TabLineSel" },
bg = { attribute = "bg", highlight = "TabLineSel" },
italic = true,
},
duplicate_visible = {
fg = { attribute = "fg", highlight = "TabLine" },
bg = { attribute = "bg", highlight = "TabLine" },
italic = true,
},
duplicate = {
fg = { attribute = "fg", highlight = "TabLine" },
bg = { attribute = "bg", highlight = "TabLine" },
italic = true,
},
modified = {
fg = { attribute = "fg", highlight = "TabLine" },
bg = { attribute = "bg", highlight = "TabLine" },
},
modified_selected = {
fg = { attribute = "fg", highlight = "Normal" },
bg = { attribute = "bg", highlight = "Normal" },
},
modified_visible = {
fg = { attribute = "fg", highlight = "TabLine" },
bg = { attribute = "bg", highlight = "TabLine" },
},
separator = {
fg = { attribute = "bg", highlight = "TabLine" },
bg = { attribute = "bg", highlight = "TabLine" },
},
separator_selected = {
fg = { attribute = "bg", highlight = "Normal" },
bg = { attribute = "bg", highlight = "Normal" },
},
indicator_selected = {
fg = { attribute = "fg", highlight = "LspDiagnosticsDefaultHint" },
bg = { attribute = "bg", highlight = "Normal" },
},
},
})

21
after/plugin/cmake.lua Normal file
View File

@ -0,0 +1,21 @@
local status_ok, cmake = pcall(require, "cmake-tools")
if not status_ok then
return
end
cmake.setup({
cmake_command = "cmake",
cmake_build_directory = "target/build/",
cmake_build_directory_prefix = "cmake_build_", -- when cmake_build_directory is "", this option will be activated
cmake_generate_options = { "-D", "CMAKE_EXPORT_COMPILE_COMMANDS=1" },
cmake_soft_link_compile_commands = true, -- if softlink compile commands json file
cmake_build_options = {},
cmake_console_size = 15, -- cmake output window height
cmake_console_position = "belowright", -- "belowright", "aboveleft", ...
cmake_show_console = "always", -- "always", "only_on_error"
cmake_dap_configuration = { name = "cpp", type = "codelldb", request = "launch" }, -- dap configuration, optional
cmake_variants_message = {
short = { show = true },
long = { show = true, max_length = 40 },
},
})

View File

@ -57,7 +57,7 @@ cmp.setup({
{ name = "nvim_lsp" },
{ name = "path" },
{ name = "luasnip" },
{ name = "buffer", keyword_length = 1 },
{ name = "buffer" },
},
snippet = {
expand = function(args)
@ -82,7 +82,6 @@ cmp.setup({
},
experimental = {
ghost_text = true,
native_menu = false,
},
window = {
completion = cmp.config.window.bordered(),

View File

@ -6,14 +6,14 @@ end
colorizer.setup({
filetypes = { "html", "css", "js", "lua", "yaml", "conf", "toml" },
user_default_options = {
RGB = true, -- #RGB hex codes
RGB = true, -- #RGB hex codes
RRGGBB = true, -- #RRGGBB hex codes
names = false, -- "Name" codes like Blue or blue
RRGGBBAA = true, -- #RRGGBBAA hex codes
AARRGGBB = true, -- 0xAARRGGBB hex codes
rgb_fn = true, -- CSS rgb() and rgba() functions
hsl_fn = true, -- CSS hsl() and hsla() functions
css = true, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB
css = true, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB
css_fn = true, -- Enable all CSS *functions*: rgb_fn, hsl_fn
-- Available modes for `mode`: foreground, background, virtualtext
mode = "background", -- Set the display mode.

17
after/plugin/harpoon.lua Normal file
View File

@ -0,0 +1,17 @@
local status_ok, harpoon = pcall(require, "harpoon")
if not status_ok then
return
end
local mark = require("harpoon.mark")
local ui = require("harpoon.ui")
harpoon.setup()
local keymap = vim.keymap.set
local opts = { silent = true }
for i = 1, 12, 1 do
keymap("n", "<F" .. i .. ">", function()
ui.nav_file(i)
end)
end

View File

@ -0,0 +1,8 @@
local status_ok, hologram = pcall(require, "hologram")
if not status_ok then
return
end
hologram.setup({
auto_display = true,
})

View File

@ -3,40 +3,6 @@ if not status_ok then
return
end
local hide_in_width = function()
return vim.fn.winwidth(0) > 80
end
local diagnostics = {
"diagnostics",
sources = { "nvim_diagnostic" },
sections = { "error", "warn" },
symbols = { error = "", warn = "" },
colored = false,
always_visible = true,
}
local diff = {
"diff",
colored = false,
symbols = { added = "", modified = "", removed = "" }, -- changes diff symbols
cond = hide_in_width,
}
local filetype = {
"filetype",
icons_enabled = false,
}
local location = {
"location",
padding = 0,
}
local spaces = function()
return "spaces: " .. vim.api.nvim_buf_get_option(0, "shiftwidth")
end
lualine.setup({
options = {
globalstatus = true,
@ -50,9 +16,9 @@ lualine.setup({
sections = {
lualine_a = { "mode" },
lualine_b = { "branch" },
lualine_c = { diagnostics },
lualine_x = { diff, "encoding", filetype },
lualine_y = { location },
lualine_z = { "progress" },
lualine_c = { "diff" },
lualine_x = { "diagnostics" },
lualine_y = { "filename" },
lualine_z = { "location", "progress" },
},
})

View File

@ -112,13 +112,13 @@ ls.add_snippets(nil, {
fmt(
[[
#[cfg(test)]
mod test {{
mod tests {{
{}
{}
}}
]],
{
c(1, { t(" use super::*"), t("") }),
c(1, { t(" use super::*;"), t("") }),
i(0),
}
)
@ -127,13 +127,13 @@ ls.add_snippets(nil, {
python = {},
cpp = {
s(
"copy",
"auth",
fmt(
[[
// Copyright {}
// Author - Kristiāns Francis Cagulis, kc22015
// {}
// Programma izveidota: {}
// Created: {}
]],
{
get_year(),
@ -147,7 +147,7 @@ ls.add_snippets(nil, {
fmt(
[[
// {};
// funkcija {}({}) -
// Funkcija {}({}) -
// {}
{} {{
}}
@ -170,5 +170,48 @@ ls.add_snippets(nil, {
}
)
),
s(
"templ",
fmt(
[[
template <class {}>
{}({}){{
{}
}}
]],
{
c(1, { t("T"), t("T1, class T2") }),
i(2),
i(3),
i(0),
}
)
),
},
norg = {
s(
"meta",
fmt(
[[
@document.meta
title: {}
author: {}
categories: {}
@end
]],
{
i(1),
c(
2,
{
t("Kristofers Solo"),
t("Kristiāns Francis Cagulis, kc22015"),
t("Kristiāns Francis Cagulis"),
}
),
i(0),
}
)
),
},
})

124
after/plugin/oil.lua Normal file
View File

@ -0,0 +1,124 @@
local status_ok, oil = pcall(require, "oil")
if not status_ok then
return
end
oil.setup({
-- Id is automatically added at the beginning, and name at the end
-- See :help oil-columns
columns = {
"icon",
-- "permissions",
-- "size",
-- "mtime",
},
-- Buffer-local options to use for oil buffers
buf_options = {
buflisted = false,
bufhidden = "hide",
},
-- Window-local options to use for oil buffers
win_options = {
wrap = false,
signcolumn = "no",
cursorcolumn = false,
foldcolumn = "0",
spell = false,
list = false,
conceallevel = 3,
concealcursor = "n",
},
-- Oil will take over directory buffers (e.g. `vim .` or `:e src/`
default_file_explorer = true,
-- Restore window options to previous values when leaving an oil buffer
restore_win_options = true,
-- Skip the confirmation popup for simple operations
skip_confirm_for_simple_edits = false,
-- Deleted files will be removed with the `trash-put` command.
delete_to_trash = true,
-- Selecting a new/moved/renamed file or directory will prompt you to save changes first
prompt_save_on_select_new_entry = true,
-- Keymaps in oil buffer. Can be any value that `vim.keymap.set` accepts OR a table of keymap
-- options with a `callback` (e.g. { callback = function() ... end, desc = "", nowait = true })
-- Additionally, if it is a string that matches "actions.<name>",
-- it will use the mapping at require("oil.actions").<name>
-- Set to `false` to remove a keymap
-- See :help oil-actions for a list of all available actions
keymaps = {
["?"] = "actions.show_help",
["<CR>"] = "actions.select",
["<C-L>"] = "actions.select_vsplit",
["C-J>"] = "actions.select_split",
["<C-t>"] = "actions.select_tab",
["<C-p>"] = "actions.preview",
["<C-c>"] = "actions.close",
["<C-r>"] = "actions.refresh",
["-"] = "actions.parent",
["_"] = "actions.open_cwd",
["`"] = "actions.cd",
["~"] = "actions.tcd",
["."] = "actions.toggle_hidden",
},
-- Set to false to disable all of the above keymaps
use_default_keymaps = true,
view_options = {
-- Show files and directories that start with "."
show_hidden = true,
-- This function defines what is considered a "hidden" file
is_hidden_file = function(name, bufnr)
return vim.startswith(name, ".")
end,
-- This function defines what will never be shown, even when `show_hidden` is set
is_always_hidden = function(name, bufnr)
return false
end,
},
-- Configuration for the floating window in oil.open_float
float = {
-- Padding around the floating window
padding = 2,
max_width = 0,
max_height = 0,
border = "rounded",
win_options = {
winblend = 10,
},
},
-- Configuration for the actions floating preview window
preview = {
-- Width dimensions can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
-- min_width and max_width can be a single value or a list of mixed integer/float types.
-- max_width = {100, 0.8} means "the lesser of 100 columns or 80% of total"
max_width = 0.9,
-- min_width = {40, 0.4} means "the greater of 40 columns or 40% of total"
min_width = { 40, 0.4 },
-- optionally define an integer/float for the exact width of the preview window
width = nil,
-- Height dimensions can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
-- min_height and max_height can be a single value or a list of mixed integer/float types.
-- max_height = {80, 0.9} means "the lesser of 80 columns or 90% of total"
max_height = 0.9,
-- min_height = {5, 0.1} means "the greater of 5 columns or 10% of total"
min_height = { 5, 0.1 },
-- optionally define an integer/float for the exact height of the preview window
height = nil,
border = "rounded",
win_options = {
winblend = 0,
},
},
-- Configuration for the floating progress window
progress = {
max_width = 0.9,
min_width = { 40, 0.4 },
width = nil,
max_height = { 10, 0.9 },
min_height = { 5, 0.1 },
height = nil,
border = "rounded",
minimized_border = "none",
win_options = {
winblend = 0,
},
},
})

View File

@ -6,7 +6,7 @@ project.setup({
-- detection_methods = { "lsp", "pattern" }, -- NOTE: lsp detection will get annoying with multiple langs in one project
detection_methods = { "pattern" },
-- patterns used to detect root dir, when **"pattern"** is in detection_methods
patterns = { ".git", "Makefile", "package.json", ".venv", "Cargo.toml", "requirements.txt" },
patterns = { ".git", "package.json", ".venv", "Cargo.toml", "requirements.txt", "CMakeLists.txt" },
})
local tele_status_ok, telescope = pcall(require, "telescope")

14
after/plugin/tabnine.lua Normal file
View File

@ -0,0 +1,14 @@
local status_ok, tabnine = pcall(require, "tabnine")
if not status_ok then
return
end
tabnine.setup({
disable_auto_comment = true,
accept_keymap = "<Tab>",
dismiss_keymap = "<C-c>",
debounce_ms = 800,
suggestion_color = { gui = "#808080", cterm = 244 },
exclude_filetypes = { "TelescopePrompt" },
log_file_path = nil, -- absolute path to Tabnine log file,
})

View File

@ -7,10 +7,20 @@ local actions = require("telescope.actions")
telescope.setup({
defaults = {
vimgrep_arguments = {
"rg",
"--color=never",
"--no-heading",
"--with-filename",
"--line-number",
"--column",
"--smart-case",
"--hidden",
},
prompt_prefix = "",
selection_caret = "",
path_display = { "smart" },
file_ignore_patterns = { ".git/", "node_modules" },
file_ignore_patterns = { ".git/", "node_modules", ".venv/" },
mappings = {
i = {
["<Down>"] = actions.cycle_history_next,
@ -20,6 +30,12 @@ telescope.setup({
},
},
},
pickers = {
find_files = {
hidden = true,
follow = true,
},
},
extensions = {
fzf = {
fuzzy = true, -- false will only do exact matching
@ -44,9 +60,30 @@ telescope.setup({
-- vim.api.nvim_put({ emoji.value }, 'c', false, true)
end,
},
["ui-select"] = {
require("telescope.themes").get_dropdown({
-- even more opts
}),
-- pseudo code / specification for writing custom displays, like the one
-- for "codeactions"
-- specific_opts = {
-- [kind] = {
-- make_indexed = function(items) -> indexed_items, width,
-- make_displayer = function(widths) -> displayer
-- make_display = function(displayer) -> function(e)
-- make_ordinal = function(e) -> string
-- },
-- -- for example to disable the custom builtin "codeactions" display
-- do the following
-- codeactions = false,
-- }
},
},
})
telescope.load_extension("fzf")
telescope.load_extension("media_files")
telescope.load_extension("emoji")
telescope.load_extension("ui-select")
telescope.load_extension("color_names")

View File

@ -95,9 +95,8 @@ local mappings = {
[";"] = { vim.cmd.Alpha, "Dashboard" },
["/"] = { "<Plug>(comment_toggle_linewise_current)", "Comment toggle current line" },
c = { vim.cmd.Bdelete, "Close Buffer" },
h = { "<cmd>nohlsearch<cr>", "No Highlight" },
f = {
"<cmd>lua require('telescope.builtin').find_files(require('telescope.themes').get_dropdown{previewer = false})<cr>",
"<cmd>lua require('telescope.builtin').find_files(require('telescope.themes').get_dropdown({previewer = false}))<cr>",
"Find files",
},
e = { vim.cmd.NvimTreeToggle, "Explorer" },
@ -105,61 +104,14 @@ local mappings = {
P = { "<cmd>lua require('telescope').extensions.projects.projects()<cr>", "Projects" },
b = { "<cmd>Telescope buffers<cr>", "Find Buffers" },
u = { vim.cmd.UndotreeToggle, "UndotreeToggle" },
x = { "<cmd>!chmod +x %<cr>", "Make executable" },
B = {
name = "Buffers",
j = { "<cmd>BufferLinePick<cr>", "Jump" },
f = { "<cmd>Telescope buffers<cr>", "Find" },
b = { "<cmd>BufferLineCyclePrev<cr>", "Previous" },
n = { "<cmd>BufferLineCycleNext<cr>", "Next" },
-- w = { "<cmd>BufferWipeout<cr>", "Wipeout" }, -- TODO: implement this for bufferline
e = {
"<cmd>BufferLinePickClose<cr>",
"Pick which buffer to close",
},
h = { "<cmd>BufferLineCloseLeft<cr>", "Close all to the left" },
l = {
"<cmd>BufferLineCloseRight<cr>",
"Close all to the right",
},
D = {
"<cmd>BufferLineSortByDirectory<cr>",
"Sort by directory",
},
L = {
"<cmd>BufferLineSortByExtension<cr>",
"Sort by language",
},
},
p = {
name = "Packer",
c = { "<cmd>PackerCompile<cr>", "Compile" },
i = { "<cmd>PackerInstall<cr>", "Install" },
s = { "<cmd>PackerSync<cr>", "Sync" },
S = { "<cmd>PackerStatus<cr>", "Status" },
u = { "<cmd>PackerUpdate<cr>", "Update" },
},
t = { vim.cmd.TagbarToggle, "Toggle Tagbar" },
m = { require("harpoon.mark").add_file, "Add file to harpoon" },
h = { require("harpoon.ui").toggle_quick_menu, "Add file to harpoon" },
n = { vim.cmd.Oil, "Open Oil" },
g = {
name = "Git",
g = { "<cmd>lua _LAZYGIT_TOGGLE()<cr>", "Lazygit" },
j = { "<cmd>lua require('gitsigns').next_hunk()<cr>", "Next Hunk" },
k = { "<cmd>lua require('gitsigns').prev_hunk()<cr>", "Prev Hunk" },
l = { "<cmd>lua require('gitsigns').blame_line()<cr>", "Blame" },
p = { "<cmd>lua require('gitsigns').preview_hunk()<cr>", "Preview Hunk" },
r = { "<cmd>lua require('gitsigns').reset_hunk()<cr>", "Reset Hunk" },
R = { "<cmd>lua require('gitsigns').reset_buffer()<cr>", "Reset Buffer" },
s = { "<cmd>lua require('gitsigns').stage_hunk()<cr>", "Stage Hunk" },
u = {
"<cmd>lua require 'gitsigns'.undo_stage_hunk()<cr>",
"Undo Stage Hunk",
},
o = { "<cmd>Telescope git_status<cr>", "Open changed file" },
b = { "<cmd>Telescope git_branches<cr>", "Checkout branch" },
c = { "<cmd>Telescope git_commits<cr>", "Checkout commit" },
d = {
"<cmd>Gitsigns diffthis HEAD<cr>",
"Git Diff",
},
},
l = {
name = "LSP",
@ -169,18 +121,11 @@ local mappings = {
"<cmd>Telescope diagnostics<cr>",
"Workspace Diagnostics",
},
f = { "<cmd>lua vim.lsp.buf.format({ async = true })<cr>", "Format" },
i = { "<cmd>LspInfo<cr>", "Info" },
j = {
"<cmd>lua vim.diagnostic.goto_next()<cr>",
"Next Diagnostic",
},
j = { "<cmd>lua vim.diagnostic.goto_next()<cr>", "Next Diagnostic" },
k = {
"<cmd>lua vim.diagnostic.goto_prev()<cr>",
"Prev Diagnostic",
},
l = { "<cmd>lua vim.lsp.codelens.run()<cr>", "CodeLens Action" },
q = { "<cmd>lua vim.lsp.diagnostic.set_loclist()<cr>", "Quickfix" },
r = { "<cmd>lua vim.lsp.buf.rename()<cr>", "Rename" },
s = { "<cmd>Telescope lsp_document_symbols<cr>", "Document Symbols" },
S = {
@ -190,12 +135,13 @@ local mappings = {
e = { "<cmd>Telescope quickfix<cr>", "Telescope Quickfix" },
R = {
name = "Rust",
e = { "<cmd>RustExpandMacro<cr>", "Expand macro" },
c = { "<cmd>RustOpenCargo<cr>", "Open cargo.toml" },
p = { "<cmd>RustParentModule<cr>", "Parent module" },
h = { "<cmd>RustHoverActions<cr>", "Hover actions" },
g = { "<cmd>RustViewCrateGraph<cr>", "View create graph" },
d = { "<cmd>RustOpenExternalDocs<cr>", "Open external docs" },
e = { vim.cmd.RustExpandMacro, "Expand macro" },
c = { vim.cmd.RustOpenCargo, "Open cargo.toml" },
p = { vim.cmd.RustParentModule, "Parent module" },
h = { vim.cmd.RustHoverActions, "Hover actions" },
g = { vim.cmd.RustViewCrateGraph, "View create graph" },
d = { vim.cmd.RustOpenExternalDocs, "Open external docs" },
R = { vim.cmd.RustRunnables, "Open runnables" },
},
},
s = {
@ -218,29 +164,17 @@ local mappings = {
"Colorscheme with Preview",
},
},
t = {
name = "Terminal",
n = { "<cmd>lua _NODE_TOGGLE()<cr>", "Node" },
u = { "<cmd>lua _NCDU_TOGGLE()<cr>", "NCDU" },
b = { "<cmd>lua _BTOP_TOGGLE()<cr>", "Btop" },
p = { "<cmd>lua _PYTHON_TOGGLE()<cr>", "Python" },
c = { "<cmd>lua _CARGO_RUN()<cr>", "Cargo run" },
f = { "<cmd>ToggleTerm direction=float<cr>", "Float" },
h = { "<cmd>ToggleTerm size=10 direction=horizontal<cr>", "Horizontal" },
v = { "<cmd>ToggleTerm size=80 direction=vertical<cr>", "Vertical" },
},
w = {
name = "Vimwiki",
w = { "<Plug>VimwikiIndex", "Open index file" },
t = { "<Plug>VimwikiTabIndex", "Open index file in new tab" },
s = { "<Plug>VimwikiUISelect", "Display list of wikis" },
i = { "<Plug>VimwikiDiaryIndex", "Open diary index" },
h = { "<Plug>Vimwiki2HTML", "Convert file to HTML" },
H = { "<Plug>Vimwiki2HTMLBrowse", "Convert file to HTML and open in browser" },
n = { "<Plug>VimwikiGoto", "Goto link provided by an argument" },
d = { "<Plug>VimwikiDeleteFile", "Rename file" },
r = { "<Plug>VimwikiRenameFile", "Delete file" },
},
-- T = {
-- name = "Terminal",
-- n = { "<cmd>lua _NODE_TOGGLE()<cr>", "Node" },
-- u = { "<cmd>lua _NCDU_TOGGLE()<cr>", "NCDU" },
-- b = { "<cmd>lua _BTOP_TOGGLE()<cr>", "Btop" },
-- p = { "<cmd>lua _PYTHON_TOGGLE()<cr>", "Python" },
-- c = { "<cmd>lua _CARGO_RUN()<cr>", "Cargo run" },
-- f = { "<cmd>ToggleTerm direction=float<cr>", "Float" },
-- h = { "<cmd>ToggleTerm size=10 direction=horizontal<cr>", "Horizontal" },
-- v = { "<cmd>ToggleTerm size=80 direction=vertical<cr>", "Vertical" },
-- },
L = {
name = "Language settings",
c = { "<cmd>setlocal formatoptions-=cro<cr>", "Disable autocomment" },
@ -259,15 +193,21 @@ local mappings = {
i = { "<cmd>lua require('dap').step_into()<cr>", "Step into code" },
o = { "<cmd>lua require('dap').step_over()<cr>", "Step over code" },
O = { "<cmd>lua require('dap').step_out()<cr>", "Step out of code" },
r = { "<cmd>lua require('dap).repl.open()<cr>", "Inspect state" },
r = { "<cmd>lua require('dap').repl.open()<cr>", "Inspect state" },
T = { "<cmd>lua require('dap').terminate()<cr>", "Terminate" },
l = { "<cmd>lua require('dap').run_last()<cr>", "Run last" },
},
q = {
name = "Persistence",
s = { "<cmd>lua require('persistence').load()<cr>", "Current directory" },
l = { "<cmd>lua require('persistence').load({ last = true })<cr>", "Last session" },
d = { "<cmd>lua require('persistence').stop()<cr>", "Stop" },
w = {
name = "VimWiki",
w = { "<Plug>VimwikiIndex", "Open index file" },
t = { "<Plug>VimwikiTabIndex", "Open index file in new tab" },
s = { "<Plug>VimwikiUISelect", "Display list of wikis" },
i = { "<Plug>VimwikiDiaryIndex", "Open diary index" },
h = { "<Plug>Vimwiki2HTML", "Convert file to HTML" },
H = { "<Plug>Vimwiki2HTMLBrowse", "Convert file to HTML and open in browser" },
n = { "<Plug>VimwikiGoto", "Goto link provided by an argument" },
d = { "<Plug>VimwikiDeleteFile", "Rename file" },
r = { "<Plug>VimwikiRenameFile", "Delete file" },
},
}

65
after/plugin/zen.lua Normal file
View File

@ -0,0 +1,65 @@
local status_ok, zen_mode = pcall(require, "zen-mode")
if not status_ok then
return
end
zen_mode.setup({
window = {
backdrop = 0.95, -- shade the backdrop of the Zen window. Set to 1 to keep the same as Normal
-- height and width can be:
-- * an absolute number of cells when > 1
-- * a percentage of the width / height of the editor when <= 1
-- * a function that returns the width or the height
width = 120, -- width of the Zen window
height = 1, -- height of the Zen window
-- by default, no options are changed for the Zen window
-- uncomment any of the options below, or add other vim.wo options you want to apply
options = {
signcolumn = "no", -- disable signcolumn
-- number = false, -- disable number column
-- relativenumber = false, -- disable relative numbers
cursorline = false, -- disable cursorline
cursorcolumn = false, -- disable cursor column
foldcolumn = "0", -- disable fold column
list = false, -- disable whitespace characters
},
},
plugins = {
-- disable some global vim options (vim.o...)
-- comment the lines to not apply the options
options = {
enabled = true,
ruler = false, -- disables the ruler text in the cmd line area
showcmd = false, -- disables the command in the last line of the screen
},
twilight = { enabled = true }, -- enable to start Twilight when zen mode opens
gitsigns = { enabled = false }, -- disables git signs
tmux = { enabled = false }, -- disables the tmux statusline
-- this will change the font size on kitty when in zen mode
-- to make this work, you need to set the following kitty options:
-- - allow_remote_control socket-only
-- - listen_on unix:/tmp/kitty
kitty = {
enabled = false,
font = "+4", -- font size increment
},
-- this will change the font size on alacritty when in zen mode
-- requires Alacritty Version 0.10.0 or higher
-- uses `alacritty msg` subcommand to change font size
alacritty = {
enabled = false,
font = "14", -- font size
},
-- this will change the font size on wezterm when in zen mode
-- See also the Plugins/Wezterm section in this projects README
wezterm = {
enabled = false,
-- can be either an absolute font size or the number of incremental steps
font = "+4", -- (10% increase per step)
},
},
-- callback where you can add custom code when the Zen window opens
on_open = function(win) end,
-- callback where you can add custom code when the Zen window closes
on_close = function() end,
})

View File

@ -1 +1 @@
require("user")
require("solo")

78
lazy-lock.json Normal file
View File

@ -0,0 +1,78 @@
{
"Comment.nvim": { "branch": "master", "commit": "176e85eeb63f1a5970d6b88f1725039d85ca0055" },
"DAPInstall.nvim": { "branch": "main", "commit": "8798b4c36d33723e7bba6ed6e2c202f84bb300de" },
"LuaSnip": { "branch": "master", "commit": "a13af80734eb28f744de6c875330c9d3c24b5f3b" },
"alpha-nvim": { "branch": "main", "commit": "9e33db324b8bb7a147bce9ea5496686ee859461d" },
"clangd_extensions.nvim": { "branch": "main", "commit": "6d0bf36870d15c0c2284f4b6693a66552a6bf127" },
"cmake-tools.nvim": { "branch": "master", "commit": "77d4ad94381c41c91f91b165d213fc32f6bf6c62" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-nvim-lsp": { "branch": "main", "commit": "0e6b2ed705ddcff9738ec4ea838141654f12eeef" },
"cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" },
"crates.nvim": { "branch": "main", "commit": "3648f8787656d7572740560331553abdaa8cb982" },
"darkplus.nvim": { "branch": "master", "commit": "7c236649f0617809db05cd30fb10fed7fb01b83b" },
"dracula.nvim": { "branch": "main", "commit": "5716b1395b32a5865476dd3314bd8888e5f91532" },
"friendly-snippets": { "branch": "main", "commit": "49ca2a0e0e26427b550b1f64272d7fe7e4d7d51b" },
"gitsigns.nvim": { "branch": "main", "commit": "30446e30d15dcfa48d74fcaf3787b7a5226c8079" },
"harpoon": { "branch": "master", "commit": "21f4c47c6803d64ddb934a5b314dcb1b8e7365dc" },
"hologram.nvim": { "branch": "main", "commit": "f5194f71ec1578d91b2e3119ff08e574e2eab542" },
"impatient.nvim": { "branch": "main", "commit": "47302af74be7b79f002773011f0d8e85679a7618" },
"indent-blankline.nvim": { "branch": "master", "commit": "7075d7861f7a6bbf0de0298c83f8a13195e6ec01" },
"kanagawa.nvim": { "branch": "master", "commit": "14a7524a8b259296713d4d77ef3c7f4dec501269" },
"lazy.nvim": { "branch": "main", "commit": "10d4371745f88837c78c8daab00c5be6e48abea4" },
"lualine.nvim": { "branch": "master", "commit": "05d78e9fd0cdfb4545974a5aa14b1be95a86e9c9" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "d381fcb78d7a562c3244e1c8f76406954649db36" },
"mason-null-ls.nvim": { "branch": "main", "commit": "54d702020bf94e4eefd357f0b738317af30217eb" },
"mason-nvim-dap.nvim": { "branch": "main", "commit": "e4d56b400e9757b1dc77d620fd3069396e92d5fc" },
"mason.nvim": { "branch": "main", "commit": "4be1226f48bc2011024110f37b17f5ee468df58f" },
"melange-nvim": { "branch": "master", "commit": "f15922543dd70b360335effb61411c05c710b99c" },
"mkdir.nvim": { "branch": "main", "commit": "c55d1dee4f099528a1853b28bb28caa802eba217" },
"nightfly": { "branch": "master", "commit": "182e2c225b73a391aa46a5b89ed3fc484621fb95" },
"nightfox.nvim": { "branch": "main", "commit": "77aa7458d2b725c2d9ff55a18befe1b891ac473e" },
"null-ls.nvim": { "branch": "main", "commit": "a138b14099e9623832027ea12b4631ddd2a49256" },
"nvim": { "branch": "main", "commit": "ad6305594737e16155c41c176c611e865c26bb6d" },
"nvim-autopairs": { "branch": "master", "commit": "41803bdbf75569571f93fd4571f6c654635b1b46" },
"nvim-cmp": { "branch": "main", "commit": "b8c2a62b3bd3827aa059b43be3dd4b5c45037d65" },
"nvim-colorizer.lua": { "branch": "master", "commit": "dde3084106a70b9a79d48f426f6d6fec6fd203f7" },
"nvim-dap": { "branch": "master", "commit": "7c1d47cf7188fc31acdf951f9eee22da9d479152" },
"nvim-dap-ui": { "branch": "master", "commit": "c020f660b02772f9f3d11f599fefad3268628a9e" },
"nvim-lspconfig": { "branch": "master", "commit": "fefba589c56a5568a089299e36a4c8242502faaa" },
"nvim-tree.lua": { "branch": "master", "commit": "f873625d0636889af4cd47a01e486beb865db205" },
"nvim-treesitter": { "branch": "master", "commit": "5822a8c6886f0238a315b57e5e96acdd74d04448" },
"nvim-ts-context-commentstring": { "branch": "main", "commit": "0bf8fbc2ca8f8cdb6efbd0a9e32740d7a991e4c3" },
"nvim-ts-rainbow": { "branch": "master", "commit": "ef95c15a935f97c65a80e48e12fe72d49aacf9b9" },
"nvim-web-devicons": { "branch": "master", "commit": "2a125024a137677930efcfdf720f205504c97268" },
"oil.nvim": { "branch": "master", "commit": "f322209a4a2b4685adeda5df00b29cdfd64db08e" },
"onedark.nvim": { "branch": "master", "commit": "462b45758ea94ff30ad48979268094590a6b7b7e" },
"persistence.nvim": { "branch": "main", "commit": "4b8051c01f696d8849a5cb8afa9767be8db16e40" },
"playground": { "branch": "master", "commit": "2b81a018a49f8e476341dfcb228b7b808baba68b" },
"plenary.nvim": { "branch": "master", "commit": "36aaceb6e93addd20b1b18f94d86aecc552f30c4" },
"presence.nvim": { "branch": "main", "commit": "87c857a56b7703f976d3a5ef15967d80508df6e6" },
"project.nvim": { "branch": "main", "commit": "8c6bad7d22eef1b71144b401c9f74ed01526a4fb" },
"rainbow_csv": { "branch": "master", "commit": "7453a3f9679f0c753ec9d77f9ea8588778f35aeb" },
"rust-tools.nvim": { "branch": "master", "commit": "71d2cf67b5ed120a0e31b2c8adb210dd2834242f" },
"tabnine-nvim": { "branch": "master", "commit": "0acbdc535ca31f5065fd215e746b64ddb814db25" },
"tagbar": { "branch": "master", "commit": "be563539754b7af22bbe842ef217d4463f73468c" },
"telescope-color-names.nvim": { "branch": "main", "commit": "95b372b9a8ba0fc7cf6a67be637ee37453f322da" },
"telescope-emoji.nvim": { "branch": "master", "commit": "86248d97be84a1ce83f0541500ef9edc99ea2aa1" },
"telescope-frecency.nvim": { "branch": "master", "commit": "3ddaaa0a6084592eed451ded5fcd279e4a60c122" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "9bc8237565ded606e6c366a71c64c0af25cd7a50" },
"telescope-media-files.nvim": { "branch": "master", "commit": "0826c7a730bc4d36068f7c85cf4c5b3fd9fb570a" },
"telescope-ui-select.nvim": { "branch": "master", "commit": "62ea5e58c7bbe191297b983a9e7e89420f581369" },
"telescope.nvim": { "branch": "master", "commit": "00cf15074a2997487813672a75f946d2ead95eb0" },
"todo-comments.nvim": { "branch": "main", "commit": "09b0b17d824d2d56f02ff15967e8a2499a89c731" },
"toggleterm.nvim": { "branch": "main", "commit": "cf146a267a6a7db62b1e2aff40414b20081048a1" },
"tokyonight.nvim": { "branch": "main", "commit": "161114bd39b990995e08dbf941f6821afbdcd666" },
"undotree": { "branch": "master", "commit": "485f01efde4e22cb1ce547b9e8c9238f36566f21" },
"vim-bbye": { "branch": "master", "commit": "25ef93ac5a87526111f43e5110675032dbcacf56" },
"vim-be-good": { "branch": "master", "commit": "c290810728a4f75e334b07dc0f3a4cdea908d351" },
"vim-closetag": { "branch": "master", "commit": "d0a562f8bdb107a50595aefe53b1a690460c3822" },
"vim-illuminate": { "branch": "master", "commit": "a2907275a6899c570d16e95b9db5fd921c167502" },
"vim-log-highlighting": { "branch": "master", "commit": "1037e26f3120e6a6a2c0c33b14a84336dee2a78f" },
"vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" },
"vim-tmux-navigator": { "branch": "master", "commit": "cdd66d6a37d991bba7997d593586fc51a5b37aa8" },
"vimwiki": { "branch": "dev", "commit": "cd9cfd299ef148721eaef532021c53da3d595710" },
"which-key.nvim": { "branch": "main", "commit": "e271c28118998c93a14d189af3395812a1aa646c" },
"zen-mode.nvim": { "branch": "main", "commit": "68f554702de63f4b7b6b6d4bcb10178f41a0acc7" }
}

13
lua/plugins/cmp.lua Normal file
View File

@ -0,0 +1,13 @@
return {
{
"hrsh7th/nvim-cmp",
-- event = "InsertEnter",
dependencies = {
"hrsh7th/cmp-buffer", -- buffer completions
"hrsh7th/cmp-path", -- path completionsplu
"hrsh7th/cmp-nvim-lua",
"hrsh7th/cmp-nvim-lsp",
},
}, -- The completion pluginpluguse "nvim-lua/plenary.nvim"
"saadparwaiz1/cmp_luasnip", -- snippet completions
}

View File

@ -0,0 +1,51 @@
return {
{ "lunarvim/darkplus.nvim" },
{
"catppuccin/nvim",
lazy = false,
priority = 1000,
config = function()
require("catppuccin").setup({
flavour = "frappe",
transparent_background = true,
term_colors = true,
})
-- vim.cmd.colorscheme("catppuccin")
end,
},
{
"Mofiqul/dracula.nvim",
lazy = false,
priority = 1000,
config = function()
require("dracula").setup({
transparent_bg = true,
italic_comment = true,
})
-- vim.cmd.colorscheme("dracula")
end,
},
{
"folke/tokyonight.nvim",
lazy = false,
priority = 1000,
config = function()
require("tokyonight").setup({
style = "night",
transparent = true,
styles = {
keywords = { italic = false },
sidebars = "transparent",
floats = "transparent",
},
lualine_bold = true,
})
vim.cmd.colorscheme("tokyonight")
end,
},
{ "rebelot/kanagawa.nvim" },
{ "EdenEast/nightfox.nvim" },
{ "navarasu/onedark.nvim" },
{ "savq/melange-nvim" },
{ "bluz71/vim-nightfly-colors", name = "nightfly" },
}

6
lua/plugins/dap.lua Normal file
View File

@ -0,0 +1,6 @@
return {
{ "mfussenegger/nvim-dap", lazy = true },
{ "rcarriga/nvim-dap-ui", lazy = true },
{ "jayp0521/mason-nvim-dap.nvim", lazy = true },
{ "ravenxrz/DAPInstall.nvim", lazy = true },
}

56
lua/plugins/general.lua Normal file
View File

@ -0,0 +1,56 @@
return {
{ "folke/lazy.nvim" },
{ "nvim-lua/plenary.nvim" }, -- Useful lua functions used by lots of plugins
{ "windwp/nvim-autopairs" }, -- Autopairs, integrates with both cmp and treesitter
{ "numToStr/Comment.nvim" },
{ "JoosepAlviste/nvim-ts-context-commentstring" },
{ "nvim-tree/nvim-web-devicons", lazy = true },
{ "nvim-tree/nvim-tree.lua" },
{ "moll/vim-bbye" },
{ "nvim-lualine/lualine.nvim" },
{ "akinsho/toggleterm.nvim" },
{ "ahmedkhalf/project.nvim" },
{ "lewis6991/impatient.nvim" },
{ "lukas-reineke/indent-blankline.nvim" },
{ "goolord/alpha-nvim", lazy = true },
{ "andweeb/presence.nvim" },
{ "NvChad/nvim-colorizer.lua" },
{ "alvan/vim-closetag" },
{ "tpope/vim-surround" },
{ "mbbill/undotree", lazy = true },
{ "preservim/tagbar" },
{ "jghauser/mkdir.nvim", lazy = true },
{ "mtdl9/vim-log-highlighting", lazy = true },
{ "edluffy/hologram.nvim", lazy = true },
{ "folke/which-key.nvim", lazy = true },
{ "folke/todo-comments.nvim", lazy = false },
{
"folke/persistence.nvim",
event = "BufReadPre", -- this will only start session saving when an actual file was opened
module = "persistence",
},
{ "folke/zen-mode.nvim" },
{ "christoomey/vim-tmux-navigator" },
{ "ThePrimeagen/harpoon" },
{ "ThePrimeagen/vim-be-good", lazy = true },
-- Vimwiki
{ "vimwiki/vimwiki" },
{ "stevearc/oil.nvim" },
-- C++
{ "p00f/clangd_extensions.nvim", lazy = true },
{ "Civitasv/cmake-tools.nvim", lazy = true },
-- Rust
{ "Saecki/crates.nvim", lazy = true },
{ "simrat39/rust-tools.nvim", lazy = true },
-- Git
{ "lewis6991/gitsigns.nvim" },
{ "codota/tabnine-nvim", build = "./dl_binaries.sh" },
}

8
lua/plugins/lsp.lua Normal file
View File

@ -0,0 +1,8 @@
return {
"williamboman/mason.nvim",
"williamboman/mason-lspconfig.nvim",
"neovim/nvim-lspconfig", -- enable LSP
"jose-elias-alvarez/null-ls.nvim", -- for formatters and linters
"jayp0521/mason-null-ls.nvim",
"RRethy/vim-illuminate",
}

9
lua/plugins/snip.lua Normal file
View File

@ -0,0 +1,9 @@
return {
{
"L3MON4D3/LuaSnip",
run = "make install_jsregexp",
dependencies = {
"rafamadriz/friendly-snippets", -- a bunch of snippets to use
},
}, --snippet engine
}

View File

@ -0,0 +1,9 @@
return {
"nvim-telescope/telescope.nvim",
"nvim-telescope/telescope-media-files.nvim",
"xiyaowong/telescope-emoji.nvim",
"nvim-telescope/telescope-frecency.nvim",
"nvim-telescope/telescope-ui-select.nvim",
{ "nvim-telescope/telescope-fzf-native.nvim", build = "make" },
"nat-418/telescope-color-names.nvim",
}

View File

@ -0,0 +1,11 @@
return {
{
"nvim-treesitter/nvim-treesitter",
run = ":TSUpdate",
dependencies = {
"nvim-treesitter/playground",
"p00f/nvim-ts-rainbow",
"mechatroner/rainbow_csv",
},
},
}

View File

@ -23,16 +23,17 @@ end
dashboard.section.header.val = header()
dashboard.section.buttons.val = {
dashboard.button("f", "" .. " Find file", "<cmd>Telescope find_files <cr>"),
dashboard.button("e", "" .. " New file", "<cmd>ene <BAR> startinsert <cr>"),
dashboard.button("f", "" .. " Find file", "<cmd>lua require('telescope.builtin').find_files()<cr>"),
dashboard.button("e", "" .. " New file", "<cmd>ene <BAR> startinsert<cr>"),
dashboard.button("\\", "" .. " Persistence", "<cmd>lua require('persistence').load()<cr>"),
dashboard.button("r", "" .. " Recent files", "<cmd>Telescope oldfiles <cr>"),
dashboard.button("t", "" .. " Find text", "<cmd>Telescope live_grep <cr>"),
dashboard.button("r", "" .. " Recent files", "<cmd>Telescope oldfiles<cr>"),
dashboard.button("t", "" .. " Find text", "<cmd>Telescope live_grep<cr>"),
dashboard.button(
"p",
"" .. " Find project",
"<cmd>lua require('telescope').extensions.projects.projects()<cr>"
),
dashboard.button("n", "" .. " Neorg", "<cmd>Neorg index<cr>"),
dashboard.button("g", "" .. " Git", "<cmd>lua _LAZYGIT_TOGGLE()<cr>"),
dashboard.button("c", "" .. " Config", "<cmd>e ~/.config/nvim/init.lua <cr>"),
dashboard.button("q", "" .. " Quit", "<cmd>qa<cr>"),

View File

@ -9,15 +9,15 @@ vim.api.nvim_create_autocmd({ "FileType" }, {
})
-- Remove statusline and tabline when in Alpha
vim.api.nvim_create_autocmd({ "User" }, {
pattern = { "AlphaReady" },
callback = function()
vim.cmd([[
set showtabline=0 | autocmd BufUnload <buffer> set showtabline=2
set laststatus=0 | autocmd BufUnload <buffer> set laststatus=3
]])
end,
})
-- vim.api.nvim_create_autocmd({ "User" }, {
-- pattern = { "AlphaReady" },
-- callback = function()
-- vim.cmd([[
-- set showtabline=0 | autocmd BufUnload <buffer> set showtabline=2
-- set laststatus=0 | autocmd BufUnload <buffer> set laststatus=3
-- ]])
-- end,
-- })
-- Set wrap and spell in markdown and gitcommit
vim.api.nvim_create_autocmd({ "FileType" }, {
@ -76,29 +76,12 @@ vim.api.nvim_create_autocmd({ "FileType" }, {
end,
})
-- Change Cursorline/Columnt color
vim.cmd([[
highlight CursorLine ctermbg=White cterm=bold guibg=#222222
highlight CursorColumn ctermbg=White cterm=bold guibg=#222222
]])
-- Autocommand that reloads waybar whenever you save the ~/.config/waybar/config file
-- vim.cmd([[
-- augroup waybar_user_config
-- autocmd!
-- autocmd BufWritePost ~/Nextcloud/solorice/.config/waybar/config silent !pkill waybar && waybar & disown <afile>
-- autocmd BufWritePost ~/Nextcloud/solorice/.config/waybar/style.css silent !pkill waybar && waybar & disown <afile>
-- augroup end
-- ]])
-- Autocommand that reloads waybar whenever you save the ~/.config/waybar/config file
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
group = vim.api.nvim_create_augroup("AutoReloadWaybar", { clear = true }),
pattern = { "**/waybar/config", "**/waybar/style.css" },
callback = function()
vim.cmd.pkill({ "waybar", bang = true })
vim.cmd.waybar()
vim.cmd("!pkill waybar && waybar & disown")
end,
})
@ -115,8 +98,24 @@ vim.api.nvim_create_autocmd({ "BufWritePost" }, {
-- Run PackerSync on file save
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
group = vim.api.nvim_create_augroup("AutoPackerSync", { clear = true }),
pattern = { "**/plugins.lua" },
pattern = { "**/lua/plugins/*" },
callback = function()
vim.cmd.PackerSync()
require("lazy").sync()
end,
})
-- vim.api.nvim_create_autocmd({ "BufWinLeave" }, {
-- group = vim.api.nvim_create_augroup("AutoSaveFold", { clear = true }),
-- pattern = { "*.*" },
-- callback = function()
-- vim.cmd.mkview()
-- end,
-- })
--
-- vim.api.nvim_create_autocmd({ "BufWinEnter" }, {
-- group = vim.api.nvim_create_augroup("LoadFold", { clear = true }),
-- pattern = { "*.*" },
-- callback = function()
-- vim.cmd.loadview()
-- end,
-- })

9
lua/solo/init.lua Normal file
View File

@ -0,0 +1,9 @@
require("solo.options")
require("solo.keymaps")
require("solo.vimwiki")
require("solo.plugin")
require("solo.autocommands")
require("solo.alpha")
require("solo.autopairs")
require("solo.autosave")
require("solo.mason")

View File

@ -21,21 +21,21 @@ keymap("n", "<C-u>", "<C-u>zz", opts)
keymap("n", "n", "nzzzv", opts)
keymap("n", "N", "Nzzzv", opts)
-- Better window navigation
keymap("n", "<C-h>", "<C-w>h", opts)
keymap("n", "<C-j>", "<C-w>j", opts)
keymap("n", "<C-k>", "<C-w>k", opts)
keymap("n", "<C-l>", "<C-w>l", opts)
-- Better window navigation with tmux
keymap("n", "<C-h>", "<cmd>TmuxNavigateLeft<cr>", opts)
keymap("n", "<C-j>", "<cmd>TmuxNavigateDown<cr>", opts)
keymap("n", "<C-k>", "<cmd>TmuxNavigateUp<cr>", opts)
keymap("n", "<C-l>", "<cmd>TmuxNavigateRight<cr>", opts)
-- Resize with arrows
keymap("n", "<C-Up>", ":resize -2<cr>", opts)
keymap("n", "<C-Down>", ":resize +2<cr>", opts)
keymap("n", "<C-Left>", ":vertical resize -2<cr>", opts)
keymap("n", "<C-Right>", ":vertical resize +2<cr>", opts)
keymap("n", "<C-Up>", "<cmd>resize -2<cr>", opts)
keymap("n", "<C-Down>", "<cmd>resize +2<cr>", opts)
keymap("n", "<C-Left>", "<cmd>vertical resize -2<cr>", opts)
keymap("n", "<C-Right>", "<cmd>vertical resize +2<cr>", opts)
-- -- Navigate buffers
keymap("n", "<S-l>", ":bnext<cr>", opts)
keymap("n", "<S-h>", ":bprevious<cr>", opts)
-- keymap("n", "<S-l>", "<cmd>bnext<cr>", opts)
-- keymap("n", "<S-h>", "<cmd>bprevious<cr>", opts)
-- Better paste
keymap("v", "p", '"_dP', opts)

View File

@ -23,7 +23,7 @@ M.setup = function()
end
local config = {
virtual_text = true, -- virtual text
virtual_text = false, -- virtual text
signs = {
active = signs, -- show signs
},

8
lua/solo/mason/init.lua Normal file
View File

@ -0,0 +1,8 @@
local status_ok, _ = pcall(require, "mason-lspconfig")
if not status_ok then
return
end
require("solo.mason.mason-installer")
require("solo.mason.handlers").setup()
require("solo.mason.null-ls")

View File

@ -25,6 +25,7 @@ local servers = {
"phpactor",
"ruff_lsp",
"rust_analyzer",
"sqlls",
"taplo",
"texlab",
"tsserver",
@ -36,8 +37,8 @@ mason_lspconfig.setup({
ensure_installed = servers,
})
local on_attach = require("user.mason.handlers").on_attach
local capabilities = require("user.mason.handlers").capabilities
local on_attach = require("solo.mason.handlers").on_attach
local capabilities = require("solo.mason.handlers").capabilities
for _, server in pairs(servers) do
local opts = {
capabilities = capabilities,
@ -45,36 +46,36 @@ for _, server in pairs(servers) do
}
if server == "bashls" then
local bashls_opts = require("user.mason.settings.bashls")
local bashls_opts = require("solo.mason.settings.bashls")
opts = vim.tbl_deep_extend("force", bashls_opts, opts)
end
if server == "lua_ls" then
local lua_ls_opts = require("user.mason.settings.lua_ls")
local lua_ls_opts = require("solo.mason.settings.lua_ls")
opts = vim.tbl_deep_extend("force", lua_ls_opts, opts)
end
if server == "emmet_ls" then
local emmet_ls_opts = require("user.mason.settings.emmet_ls")
local emmet_ls_opts = require("solo.mason.settings.emmet_ls")
opts = vim.tbl_deep_extend("force", emmet_ls_opts, opts)
end
if server == "rust_analyzer" then
local rust_analyzer_opts = require("user.mason.settings.rust_analyzer")
local rust_analyzer_opts = require("solo.mason.settings.rust_analyzer")
opts = vim.tbl_deep_extend("force", rust_analyzer_opts, opts)
require("rust-tools").setup(opts)
goto continue
end
if server == "clangd" then
local clangd_opts = require("user.mason.settings.clangd")
local clangd_opts = require("solo.mason.settings.clangd")
opts = vim.tbl_deep_extend("force", clangd_opts, opts)
require("clangd_extensions").setup(opts)
goto continue
end
if server == "texlab" then
local texlab_opts = require("user.mason.settings.texlab")
local texlab_opts = require("solo.mason.settings.texlab")
opts = vim.tbl_deep_extend("force", texlab_opts, opts)
end

View File

@ -29,6 +29,7 @@ mason_null_ls.setup({
"sql-formatter",
"shfmt",
"yamlfmt",
"cmakelang",
},
automatic_installation = true,
automatic_setup = true,
@ -52,6 +53,8 @@ null_ls.setup({
}),
diagnostics.misspell,
diagnostics.mypy,
diagnostics.cmake_lint,
formatting.cmake_format,
formatting.autopep8,
formatting.beautysh,
formatting.clang_format,
@ -82,8 +85,14 @@ null_ls.setup({
"zsh",
},
}),
formatting.sql_formatter,
-- formatting.sql_formatter.with({
-- extra_args = {
-- "-c",
-- "/home/kristofers/.config/sql/sql-formatter.json",
-- },
-- }),
formatting.stylua,
formatting.yamlfmt,
formatting.black,
},
})

View File

@ -3,7 +3,7 @@ return {
capabilities = {
offsetEncoding = { "utf-16" },
},
on_attach = require("user.mason.handlers").on_attach,
on_attach = require("solo.mason.handlers").on_attach,
},
extensions = {
-- defaults:

View File

@ -0,0 +1,35 @@
return {
settings = {
Lua = {
runtime = {
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
version = "LuaJIT",
},
diagnostics = {
-- Get the language server to recognize the `vim` global
globals = { "vim", "awesome", "client" },
},
-- workspace = {
-- Make the server aware of Neovim runtime files
-- library = vim.api.nvim_get_runtime_file("", true),
-- },
-- Do not send telemetry data containing a randomized but unique identifier
telemetry = {
enable = false,
},
root_pattern = {
".stylua.toml",
".luarc.json",
".luarc.jsonc",
".luacheckrc",
"stylua.toml",
"selene.toml",
"selene.yml",
".git",
},
format = {
enable = false,
},
},
},
}

View File

@ -0,0 +1,105 @@
return {
server = {
on_attach = require("solo.mason.handlers").on_attach,
capabilities = require("solo.mason.handlers").capabilities,
},
tools = {
-- how to execute terminal commands
-- options right now: termopen / quickfix
executor = require("rust-tools.executors").termopen,
-- callback to execute once rust-analyzer is done initializing the workspace
-- The callback receives one parameter indicating the `health` of the server: "ok" | "warning" | "error"
on_initialized = function()
vim.api.nvim_create_autocmd({ "BufEnter", "CursorHold", "InsertLeave", "BufWritePost" }, {
group = vim.api.nvim_create_augroup("InitializeRustAnalyzer", { clear = true }),
pattern = { "*.rs" },
callback = function()
vim.lsp.codelens.refresh()
end,
})
end,
-- automatically call RustReloadWorkspace when writing to a Cargo.toml file.
reload_workspace_from_cargo_toml = true,
-- These apply to the default RustSetInlayHints command
inlay_hints = {
-- automatically set inlay hints (type hints)
-- default: true
auto = true,
-- Only show inlay hints for the current line
only_current_line = false,
-- whether to show parameter hints with the inlay hints or not
-- default: true
show_parameter_hints = true,
-- prefix for parameter hints
-- default: "<-"
parameter_hints_prefix = " <- ",
-- prefix for all the other hints (type, chaining)
-- default: "=>"
other_hints_prefix = " => ",
-- whether to align to the length of the longest line in the file
max_len_align = false,
-- padding from the left if max_len_align is true
max_len_align_padding = 1,
-- whether to align to the extreme right or not
right_align = false,
-- padding from the right if right_align is true
right_align_padding = 7,
-- The color of the hints
highlight = "Comment",
},
-- options same as lsp hover / vim.lsp.util.open_floating_preview()
hover_actions = {
-- the border that is used for the hover window
-- see vim.api.nvim_open_win()
border = {
{ "", "FloatBorder" },
{ "", "FloatBorder" },
{ "", "FloatBorder" },
{ "", "FloatBorder" },
{ "", "FloatBorder" },
{ "", "FloatBorder" },
{ "", "FloatBorder" },
{ "", "FloatBorder" },
},
-- Maximal width of the hover window. Nil means no max.
max_width = nil,
-- Maximal height of the hover window. Nil means no max.
max_height = nil,
-- whether the hover action window gets automatically focused
-- default: false
auto_focus = false,
},
-- settings for showing the crate graph based on graphviz and the dot
-- command
crate_graph = {
-- Backend used for displaying the graph
-- see: https://graphviz.org/docs/outputs/
-- default: x11
backend = "x11",
-- where to store the output, nil for no output stored (relative
-- path from pwd)
-- default: nil
output = nil,
-- true for all crates.io and external crates, false only the local
-- crates
-- default: true
full = true,
},
-- all the opts to send to nvim-lspconfig
-- these override the defaults set by rust-tools.nvim
-- see https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#rust_analyzer
server = {
-- standalone file support
-- setting it to false may improve startup time
standalone = true,
}, -- rust-analyzer options
-- debugging stuff
dap = {
adapter = {
type = "executable",
command = "codelldb",
name = "rt_lldb",
},
},
},
}

View File

@ -9,9 +9,8 @@ local options = {
incsearch = true,
ignorecase = true, -- ignore case in search patterns
mouse = "a", -- allow the mouse to be used in neovim
pumheight = 10, -- pop up menu height
showmode = false, -- we don't need to see things like -- INSERT -- anymore
showtabline = 0, -- always show tabs
pumheight = 10, -- pop up menu height showmode = false, -- we don't need to see things like -- INSERT -- anymore
showtabline = 0, -- disable tabs
smartcase = true, -- smart case
smartindent = true, -- make indenting smarter again
splitbelow = true, -- force all horizontal splits to go below current window
@ -20,7 +19,7 @@ local options = {
termguicolors = true, -- set term gui colors (most terminals support this)
timeoutlen = 250, -- time to wait for a mapped sequence to complete (in milliseconds)
undofile = true, -- enable persistent undo
undodir = os.getenv("XDG_DATA_HOME") .. "//nvim/undodir",
undodir = vim.fn.stdpath("data") .. "/nvim/undodir",
updatetime = 50, -- faster completion (4000ms default)
writebackup = false, -- if a file is being edited by another program (or was written to file while editing with another program), it is not allowed to be edited
expandtab = true, -- convert tabs to spaces
@ -40,6 +39,7 @@ local options = {
sidescrolloff = 8,
guifont = "JetBrainsMono NF:h11", -- the font used in graphical neovim applications
spell = false,
foldmethod = "manual",
}
vim.opt.fillchars.eob = " "
@ -55,6 +55,8 @@ vim.opt.spelloptions:append("camel")
local g = vim.g
g.mapleader = " "
g.maplocalleader = " "
g.loaded_netrw = 1
g.loaded_netrwPlugin = 1
vim.opt_local.suffixesadd:prepend(".lua")
vim.opt_local.suffixesadd:prepend("init.lua")

13
lua/solo/plugin.lua Normal file
View File

@ -0,0 +1,13 @@
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("plugins")

View File

@ -10,3 +10,5 @@ vim.g.vimwiki_ext2syntax = {
[".markdown"] = "markdown",
[".mdown"] = "markdown",
}
vim.g.vimwiki_global_ext = 1

View File

@ -1,27 +0,0 @@
local theme_status_ok, dracula = pcall(require, "dracula")
if not theme_status_ok then
return
end
dracula.setup({
-- show the '~' characters after the end of buffers
show_end_of_buffer = true, -- default false
-- use transparent background
transparent_bg = true, -- default false
-- set custom lualine background color
-- lualine_bg_color = "#44475a", -- default nil
-- set italic comment
italic_comment = true, -- default false
-- overrides the default highlights see `:h synIDattr`
overrides = {
-- Examples
-- NonText = { fg = dracula.colors().white }, -- set NonText fg to white
-- NvimTreeIndentMarker = { link = "NonText" }, -- link to NonText highlight
-- Nothing = {} -- clear highlight of Nothing
},
})
local status_ok, _ = pcall(vim.cmd.colorscheme("dracula"))
if not status_ok then
return
end

View File

@ -1,9 +0,0 @@
require("user.options")
require("user.colorscheme")
require("user.keymaps")
require("user.autocommands")
require("user.plugins")
require("user.alpha")
require("user.autopairs")
require("user.autosave")
require("user.mason")

View File

@ -1,8 +0,0 @@
local status_ok, _ = pcall(require, "mason-lspconfig")
if not status_ok then
return
end
require("user.mason.mason-installer")
require("user.mason.handlers").setup()
require("user.mason.null-ls")

View File

@ -1,32 +0,0 @@
return {
settings = {
Lua = {
runtime = {
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
version = "LuaJIT",
},
diagnostics = {
-- Get the language server to recognize the `vim` global
globals = { "vim", "awesome", "client" },
},
-- workspace = {
-- -- Make the server aware of Neovim runtime files
-- library = vim.api.nvim_get_runtime_file("", true),
-- },
-- Do not send telemetry data containing a randomized but unique identifier
telemetry = {
enable = false,
},
root_pattern = {
".stylua.toml",
".luarc.json",
".luarc.jsonc",
".luacheckrc",
"stylua.toml",
"selene.toml",
"selene.yml",
".git",
},
},
},
}

View File

@ -1,22 +0,0 @@
return {
server = {
on_attach = require("user.mason.handlers").on_attach,
},
tools = {
on_initialized = function()
vim.cmd([[
autocmd BufEnter,CursorHold,InsertLeave,BufWritePost *.rs silent! lua vim.lsp.codelens.refresh()
]])
end,
},
settings = {
["rust-analyzer"] = {
lens = {
enable = true,
},
checkOnSave = {
command = "clippy",
},
},
},
}

View File

@ -1,135 +0,0 @@
local fn = vim.fn
-- Automatically install packer
local install_path = fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim"
if fn.empty(fn.glob(install_path)) > 0 then
PACKER_BOOTSTRAP = fn.system({
"git",
"clone",
"--depth",
"1",
"https://github.com/wbthomason/packer.nvim",
install_path,
})
print("Installing packer close and reopen Neovim...")
vim.cmd([[packadd packer.nvim]])
end
-- Use a protected call so we don't error out on first use
local status_ok, packer = pcall(require, "packer")
if not status_ok then
return
end
-- Have packer use a popup window
packer.init({
display = {
open_fn = function()
return require("packer.util").float({ border = "rounded" })
end,
},
})
-- Install your plugins here
return packer.startup(function(use)
use("wbthomason/packer.nvim") -- Have packer manage itself
use("nvim-lua/plenary.nvim") -- Useful lua functions used by lots of plugins
use("windwp/nvim-autopairs") -- Autopairs, integrates with both cmp and treesitter
use("numToStr/Comment.nvim")
use("JoosepAlviste/nvim-ts-context-commentstring")
use("nvim-tree/nvim-web-devicons")
use("nvim-tree/nvim-tree.lua")
use({ "akinsho/bufferline.nvim", tag = "v3.*" })
use("moll/vim-bbye")
use("nvim-lualine/lualine.nvim")
use("akinsho/toggleterm.nvim")
use("ahmedkhalf/project.nvim")
use("lewis6991/impatient.nvim")
use("lukas-reineke/indent-blankline.nvim")
use("goolord/alpha-nvim")
use("andweeb/presence.nvim")
use("NvChad/nvim-colorizer.lua")
use("alvan/vim-closetag")
use("tpope/vim-surround")
use("mbbill/undotree")
use("folke/which-key.nvim")
use("folke/todo-comments.nvim")
use({
"folke/persistence.nvim",
event = "BufReadPre", -- this will only start session saving when an actual file was opened
module = "persistence",
})
-- Colorschemes
use("lunarvim/darkplus.nvim")
use("Mofiqul/dracula.nvim")
use("folke/tokyonight.nvim")
use("rebelot/kanagawa.nvim")
use("EdenEast/nightfox.nvim")
use("navarasu/onedark.nvim")
use("savq/melange-nvim")
use({ "bluz71/vim-nightfly-colors", as = "nightfly" })
-- Vimwiki
use("vimwiki/vimwiki")
-- cmp plugins
use("hrsh7th/nvim-cmp") -- The completion pluginpluguse "nvim-lua/plenary.nvim"
use("hrsh7th/cmp-buffer") -- buffer completions
use("hrsh7th/cmp-path") -- path completionsplu
use("hrsh7th/cmp-nvim-lua")
use("hrsh7th/cmp-nvim-lsp")
use("saadparwaiz1/cmp_luasnip") -- snippet completions
-- snippets
use({ "L3MON4D3/LuaSnip", run = "make install_jsregexp" }) --snippet engine
use("rafamadriz/friendly-snippets") -- a bunch of snippets to use
-- LSP
-- use("williamboman/nvim-lsp-installer") -- simple to use language server installer
use("williamboman/mason.nvim")
use("williamboman/mason-lspconfig.nvim")
use("neovim/nvim-lspconfig") -- enable LSP
use("jose-elias-alvarez/null-ls.nvim") -- for formatters and linters
use("jayp0521/mason-null-ls.nvim")
use("RRethy/vim-illuminate")
-- C++
use("p00f/clangd_extensions.nvim")
-- Rust
use("Saecki/crates.nvim")
use("simrat39/rust-tools.nvim")
-- Telescope
use("nvim-telescope/telescope.nvim")
use({ "nvim-telescope/telescope-fzf-native.nvim", run = "make" })
use("nvim-telescope/telescope-media-files.nvim")
use("xiyaowong/telescope-emoji.nvim")
use("nvim-telescope/telescope-frecency.nvim")
-- Treesitter
use({ "nvim-treesitter/nvim-treesitter", run = ":TSUpdate" })
use("nvim-treesitter/playground")
use("p00f/nvim-ts-rainbow")
use("mechatroner/rainbow_csv")
use("mtdl9/vim-log-highlighting")
-- Git
use("lewis6991/gitsigns.nvim")
-- DAP
use("mfussenegger/nvim-dap")
use("rcarriga/nvim-dap-ui")
use("jayp0521/mason-nvim-dap.nvim")
use("ravenxrz/DAPInstall.nvim")
use("ThePrimeagen/vim-be-good")
-- Automatically set up your configuration after cloning packer.nvim
-- Put this at the end after all plugins
if PACKER_BOOTSTRAP then
vim.cmd.PackerSync()
end
end)

2
spell/en.utf-8.add Normal file
View File

@ -0,0 +1,2 @@
crate
teksts

BIN
spell/en.utf-8.add.spl Normal file

Binary file not shown.