Update 24.01.2024

This commit is contained in:
Kristofers Solo
2024-01-24 21:28:12 +02:00
parent f37a67d62f
commit 5f7013e770
105 changed files with 3389 additions and 2488 deletions

View File

@@ -1,4 +1,4 @@
-- Use 'q' to quit from common plugins
-- Use 'q' to quit from common pluginscmd
vim.api.nvim_create_autocmd({ "FileType" }, {
pattern = { "qf", "help", "man", "lspinfo", "spectre_panel", "lir", "git", "dap-float" },
callback = function()

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

@@ -0,0 +1,9 @@
vim.api.nvim_create_user_command("CopilotToggle", function()
if vim.g.copilot_enabled == 1 then
vim.g.copilot_enabled = 0
vim.api.nvim_echo({ { "Copilot disabled", "WarningMsg" } }, true, {})
else
vim.g.copilot_enabled = 1
vim.api.nvim_echo({ { "Copilot enabled", "WarningMsg" } }, true, {})
end
end, { desc = "Toggle Copilot" })

View File

@@ -1,5 +1,7 @@
--require("solo.options")
--require("solo.keymaps")
require("solo.keymaps")
require("solo.options")
require("solo.vimwiki")
require("solo.typst")
require("solo.lazy")
require("solo.autocmds")
require("solo.cmds")

75
lua/solo/keymaps.lua Normal file
View File

@@ -0,0 +1,75 @@
local nmap = require("solo.mappings").nmap
local xmap = require("solo.mappings").xmap
local vmap = require("solo.mappings").vmap
local tmap = require("solo.mappings").tmap
local imap = require("solo.mappings").imap
-- Unpam keys
vim.keymap.set("", "<space>", "<nop>")
nmap("Q", "<nop>")
nmap("<C-space>", "<nop>")
nmap("<F1>", "<nop>")
nmap("<F2>", "<nop>")
nmap("<F3>", "<nop>")
nmap("<F4>", "<nop>")
nmap("<leader>v", "<nop>")
nmap("<leader>p", "<nop>")
nmap("J", "mzJ`z")
nmap("<C-d>", "<C-d>zz")
nmap("<C-u>", "<C-u>zz")
nmap("n", "nzzzv")
nmap("N", "Nzzzv")
-- nmap("'", ":normal! zz<CR>")
vim.keymap.set({ "n" }, "j", "gj", { desc = "Allows to navigate though wrapped lines", noremap = true })
vim.keymap.set({ "n" }, "k", "gk", { desc = "Allows to navigate though wrapped lines", noremap = true })
vim.keymap.set({ "n", "t" }, "<C-h>", vim.cmd.TmuxNavigateLeft, { desc = "Focus window left", noremap = true })
vim.keymap.set({ "n", "t" }, "<C-j>", vim.cmd.TmuxNavigateDown, { desc = "Focus window down", noremap = true })
vim.keymap.set({ "n", "t" }, "<C-k>", vim.cmd.TmuxNavigateUp, { desc = "Focus window up", noremap = true })
vim.keymap.set({ "n", "t" }, "<C-l>", vim.cmd.TmuxNavigateRight, { desc = "Focus window right", noremap = true })
nmap("<C-Up>", "<cmd>resize -2<cr>", "Resize window up")
nmap("<C-Down>", "<cmd>resize +2<cr>", "Resize window down")
nmap("<C-Left>", "<cmd>vertical resize -2<cr>", "Resize window left")
nmap("<C-Right>", "<cmd>vertical resize +2<cr>", "Resize window right")
nmap("<C-f>", "<cmd>!tmux neww tmux-sessionizer<cr>", "Open tmux sessionizer")
nmap("<A-k>", "<cmd>m .-2<cr>==", "Move line up")
nmap("<A-j>", "<cmd>m .+1<cr>==", "Move line down")
nmap("<S-s>", ":%s/<C-r><C-w>/<C-r><C-w>/gI<Left><Left><Left>", "[S]ubstitute word")
-- nmap("<C-b>", "<cmd>w!<cr><cmd>!compiler '%:p'<cr>")
-- nmap("<C-o>", "<cmd>w!<cr><cmd>!opout '%:p'<cr>")
nmap("Q", "@qj", "Run macro")
xmap("Q", ":norm @q<CR>", "Run macro")
xmap("p", '"_dP')
vim.keymap.set(
"c",
"<C-j>",
'pumvisible() ? "\\<C-n>" : "\\<C-j>"',
{ expr = true, noremap = true, desc = "Prev command" }
)
vim.keymap.set(
"c",
"<C-k>",
'pumvisible() ? "\\<C-p>" : "\\<C-k>"',
{ expr = true, noremap = true, desc = "Next command" }
)
vmap(">", ">gv", "Right Indent")
vmap("<", "<gv", "Left Indent")
vmap("<A-k>", ":m '<-2<cr>gv=gv", "Move lines up")
vmap("<A-j>", ":m '>+1<cr>gv=gv", "Move lines down")
-- nmap("-", vim.cmd.Oil, "Open parent directory")
-- tmap("t", "<C-h>", "<C-\\><C-N><C-w>h")
-- tmap("t", "<C-j>", "<C-\\><C-N><C-w>j")
-- tmap("t", "<C-k>", "<C-\\><C-N><C-w>k")
-- tmap("t", "<C-l>", "<C-\\><C-N><C-w>l")

66
lua/solo/options.lua Normal file
View File

@@ -0,0 +1,66 @@
vim.opt.backup = false -- creates a backup file
vim.opt.breakindent = true -- Enable break indent
vim.opt.clipboard = "unnamedplus" -- allows neovim to access the system clipboard
vim.opt.cmdheight = 1 -- more space in the neovim command line for displaying messages
vim.opt.colorcolumn = "120"
vim.opt.completeopt = { "menuone", "noselect" } -- mostly just for cmp
vim.opt.conceallevel = 2 -- so that `` is visible in markdown files
vim.opt.cursorcolumn = true -- highlight the current column
vim.opt.cursorline = true -- highlight the current line
vim.opt.expandtab = true -- convert tabs to spaces
vim.opt.fileencoding = "utf-8" -- the encoding written to a file
vim.opt.fillchars.eob = " "
vim.opt.foldmethod = "manual"
vim.opt.guifont = "JetBrainsMono NF:h11" -- the font used in graphical neovim applications
vim.opt.hlsearch = false -- highlight all matches on previous search pattern
vim.opt.ignorecase = true -- ignore case in search patterns
vim.opt.incsearch = true
vim.opt.isfname:append("@-@")
vim.opt.iskeyword:append("-")
vim.opt.laststatus = 3
vim.opt.mouse = "a" -- allow the mouse to be used in neovim
vim.opt.number = true -- set numbered lines
vim.opt.numberwidth = 4 -- set number column width to 4 {default 4}
vim.opt.pumheight = 10 -- pop up menu height
vim.opt.relativenumber = true -- set relative numbered lines
vim.opt.ruler = false
vim.opt.scrolloff = 8 -- is one of my fav
vim.opt.shiftwidth = 4 -- the number of spaces inserted for each indentation
vim.opt.shortmess:append("c")
vim.opt.showcmd = false
vim.opt.showmode = false -- we don't need to see things like -- INSERT -- anymore
vim.opt.showtabline = 0 -- disable tabs
vim.opt.sidescrolloff = 8
vim.opt.signcolumn = "yes" -- always show the sign column otherwise it would shift the text each time
vim.opt.smartcase = true -- smart case
vim.opt.smartindent = true -- make indenting smarter again
vim.opt.softtabstop = 4
vim.opt.spell = false
vim.opt.spelloptions:append("camel")
vim.opt.splitbelow = true -- force all horizontal splits to go below current window
vim.opt.splitright = true -- force all vertical splits to go to the right of current window
vim.opt.swapfile = false -- creates a swapfile
vim.opt.tabstop = 4 -- insert 4 spaces for a tab
vim.opt.termguicolors = true -- set term gui colors (most terminals support this)
vim.opt.timeoutlen = 250 -- time to wait for a mapped sequence to complete (in milliseconds)
vim.opt.undodir = vim.fn.stdpath("data") .. "/nvim/undodir"
vim.opt.undofile = true -- enable persistent undo
vim.opt.updatetime = 50 -- faster completion (4000ms default)
vim.opt.whichwrap:append("<,>,[,],h,l")
vim.opt.wrap = false -- display lines as one long line
vim.opt.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 edit
vim.opt_local.path:prepend(vim.fn.stdpath("config") .. "/lua")
vim.opt_local.suffixesadd:prepend(".lua")
vim.opt_local.suffixesadd:prepend("init.lua")
vim.opt.list = true
vim.opt.listchars:append("space:⋅")
vim.opt.listchars:append("tab:▎ ")
vim.opt.listchars:append("eol:↴")
vim.g.netrw_banner = 0
vim.g.netrw_browse_split = 0
vim.g.netrw_keepdir = 0
vim.g.netrw_localcopydircmd = "cp -r"
vim.g.netrw_winsize = 30

View File

@@ -37,8 +37,6 @@ local parse = require("luasnip.util.parser").parse_snippet
local ms = ls.multi_snippet
]]
require("luasnip/loaders/from_vscode").lazy_load()
local shortcut = function(val)
if type(val) == "string" then
return { t({ val }), i(0) }

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

@@ -0,0 +1,9 @@
vim.g.typst_cmd = "typst" -- Specifies the location of the Typst executable. Default: 'typst'
vim.g.typst_pdf_viewer = "zathura" -- Specifies pdf viewer that typst watch --open will use. Default: ''
vim.g.typst_conceal = 0 -- Enable concealment. Default: 0
vim.g.typst_conceal_math = vim.g.typst_conceal -- Enable concealment for math symbols in math mode (i.e. replaces symbols with their actual unicode character).
-- OBS: this can affect performance, see issue #64. Default: g:typst_conceal
vim.g.typst_conceal_emoji = vim.g.typst_conceal -- Enable concealing emojis, e.g. #emoji.alien becomes 👽. Default: g:typst_conceal
vim.g.typst_auto_close_toc = 0 -- Specifies whether TOC will be automatically closed after using it. Default: 0
vim.g.typst_auto_open_quickfix = 1 -- Specifies whether the quickfix list should automatically open when there are errors from typst. Default: 1
vim.g.typst_embedded_languages = { "python", "rust", "c", "cpp" } -- A list of languages that will be highlighted in code blocks. Typst is always highlighted. Default: []