chore: make it modular

This commit is contained in:
MBvisti 2024-03-18 16:52:33 +01:00
parent a222805c61
commit 1a37e123f5
4 changed files with 239 additions and 21 deletions

View file

@ -2,4 +2,115 @@
-- I promise not to create any merge conflicts in this directory :)
--
-- See the kickstart.nvim README for more information
return {}
return {
"github/copilot.vim",
-- lazy.nvim
{
"m4xshen/hardtime.nvim",
dependencies = { "MunifTanjim/nui.nvim", "nvim-lua/plenary.nvim" },
opts = {}
},
-- Lua
{
"folke/twilight.nvim",
opts = {
-- your configuration comes here
-- or leave it empty to use the default settings
-- refer to the configuration section below
}
},
"mbbill/undotree",
{ 'numToStr/Comment.nvim', opts = {} },
{
"NoahTheDuke/vim-just",
ft = { "just" },
},
'vimwiki/vimwiki',
'lervag/wiki.vim',
-- Lua
{
"folke/zen-mode.nvim",
opts = {
window = {
-- width = 1.0, -- recording full screen
width = 55, -- recording shorts screen
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 = {
twilight = { enabled = false },
kitty = {
enabled = true,
}
},
}
},
{
"ray-x/go.nvim",
dependencies = {},
config = function()
require("go").setup()
end,
event = { "CmdlineEnter" },
ft = { "go", 'gomod' },
build = ':lua require("go.install").update_all_sync()' -- if you need to install/update all binaries
},
{
"sainnhe/gruvbox-material",
lazy = false, -- make sure we load this during startup if it is your main colorscheme
priority = 1000, -- make sure to load this before all the other start plugins
config = function()
-- load the colorscheme here
vim.cmd([[colorscheme gruvbox-material]])
end,
},
-- comes statusline with tmux
-- 'vimpostor/vim-tpipeline',
{
'stevearc/oil.nvim',
opts = {
-- Set to false if you still want to use netrw.
default_file_explorer = false,
},
},
{
"kdheepak/lazygit.nvim",
cmd = {
"LazyGit",
"LazyGitConfig",
"LazyGitCurrentFile",
"LazyGitFilter",
"LazyGitFilterCurrentFile",
},
-- optional for floating window border decoration
dependencies = {
"nvim-lua/plenary.nvim",
},
},
{
"mistricky/codesnap.nvim",
build = "make",
opts = {
mac_window_bar = false, -- (Optional) MacOS style title bar switch
opacity = true, -- (Optional) The code snap has some opacity by default, set it to false for 100% opacity
watermark = "@mbvisti", -- (Optional) you can custom your own watermark, but if you don't like it, just set it to ""
preview_title = "mbv labs", -- (Optional) preview page title
editor_font_family = "CaskaydiaCove Nerd Font", -- (Optional) preview code font family
watermark_font_family = "Pacifico", -- (Optional) watermark font family
},
},
}

62
lua/keymaps.lua Normal file
View file

@ -0,0 +1,62 @@
vim.keymap.set("n", "<leader>pq", vim.cmd.Ex)
-- Remap for dealing with word wrap
vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
-- move a selection up and down
vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv")
vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv")
-- not sure
-- vim.keymap.set("n", "J", "mzJ`z")
-- vim.keymap.set("n", "<C-d>", "<C-d>zz")
-- vim.keymap.set("n", "<C-u>", "<C-u>zz")
-- vim.keymap.set("n", "n", "nzzzv")
-- vim.keymap.set("n", "N", "Nzzzv")
-- greatest remap ever, also not sure
-- vim.keymap.set("x", "<leader>p", "\"_dP")
-- This is going to get me cancelled
vim.keymap.set("i", "<C-c>", "<Esc>")
-- thank theprimeagen later
vim.keymap.set('n', '<leader>re', "oif err != nil {<CR>}<ESC>Oreturn err")
-- wiki
vim.keymap.set('n', '<leader>ww', vim.cmd.WikiIndex, { noremap = true, silent = true, desc = "Open Wiki" })
vim.keymap.set('n', '<leader>mj', vim.cmd.WikiJournal, { noremap = true, silent = true, desc = "[M]ake [J]ournal" })
vim.keymap.set('n', '<leader>ji', vim.cmd.WikiJournalIndex,
{ noremap = true, silent = true, desc = "Make [J]ournal [I]ndex" })
-- diffview
vim.keymap.set("n", '<leader>vf', '<cmd>DiffviewFileHistory %<CR>')
vim.keymap.set("n", '<leader>vb', '<cmd>DiffviewFileHistory<CR>')
vim.keymap.set("n", '<leader>vc', '<cmd>DiffviewClose<CR>')
-- zenmode
vim.keymap.set("n", '<leader>zm', '<cmd>ZenMode<CR>')
-- undo tree
vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle)
-- copilot
vim.keymap.set('i', "<M-CR>", "copilot#Accept('<CR>')", {
expr = true,
replace_keycodes = false
})
vim.keymap.set('i', "<M-]>", "<Plug>(copilot-next)")
vim.keymap.set('i', "<M-[>", "<Plug>(copilot-previous)")
vim.keymap.set('i', "<M-a>", "<Plug>(copilot-accept-word)")
vim.keymap.set('i', "<M-/>", "<Plug>(copilot-suggest)")
-- oil
vim.keymap.set("n", "<leader>o", "<CMD>Oil<CR>", { desc = "Open parent directory" })
-- lazygit
vim.keymap.set("n", "<leader>gg", "<CMD>LazyGit<CR>", { desc = "Open lazygit" })

30
lua/options.lua Normal file
View file

@ -0,0 +1,30 @@
vim.opt.relativenumber = true
vim.o.undodir = os.getenv("HOME") .. "/.neovim/undodir"
-- TODO check if needed
vim.o.incsearch = true
vim.o.swapfile = false
vim.o.backup = false
vim.o.colorcolumn = "120" -- sets the separator bar
vim.o.errorbells = false
vim.o.cursorline = true
vim.g.netrw_banner = 0
vim.g.netrw_winsize = 25
vim.g.wiki_root = "~/wiki"
vim.cmd [[
let g:wiki_journal_index = {
\ 'link_text_parser': { b, d, p -> d },
\ 'link_url_parser': { b, d, p -> 'journal/' . d }
\}
]]
vim.o.guicursor = "a:blinkon0"
vim.g.copilot_no_tab_map = true