Removed unnecessary plugins

This commit is contained in:
Kristofers Solo
2023-08-28 21:32:28 +03:00
parent c72c49bc90
commit 047f16fb0e
60 changed files with 1479 additions and 2368 deletions

View File

@@ -1,47 +0,0 @@
local status_ok, alpha = pcall(require, "alpha")
if not status_ok then
return
end
local dashboard = require("alpha.themes.dashboard")
local function header()
return {
[[ ___ ]],
[[ /\_ \ __ ]],
[[ ____ ___\//\ \ ___ __ __ /\_\ ___ ___ ]],
[[ /',__\ / __`\\ \ \ / __`\/\ \/\ \\/\ \ /' __` __`\ ]],
[[/\__, `\/\ \L\ \\_\ \_/\ \L\ \ \ \_/ |\ \ \/\ \/\ \/\ \ ]],
[[\/\____/\ \____//\____\ \____/\ \___/ \ \_\ \_\ \_\ \_\]],
[[ \/___/ \/___/ \/____/\/___/ \/__/ \/_/\/_/\/_/\/_/]],
}
end
local function footer()
return "kristofers.xyz"
end
dashboard.section.header.val = header()
dashboard.section.buttons.val = {
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(
"p",
"" .. " Find project",
"<cmd>lua require('telescope').extensions.projects.projects()<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>"),
}
dashboard.section.footer.val = footer()
dashboard.section.footer.opts.hl = "Type"
dashboard.section.header.opts.hl = "Include"
dashboard.section.buttons.opts.hl = "Keyword"
dashboard.opts.opts.noautocmd = true
alpha.setup(dashboard.opts)

View File

@@ -1,6 +1,6 @@
-- Use 'q' to quit from common plugins
vim.api.nvim_create_autocmd({ "FileType" }, {
pattern = { "qf", "help", "man", "lspinfo", "spectre_panel", "lir" },
pattern = { "qf", "help", "man", "lspinfo", "spectre_panel", "lir", "git" },
callback = function()
vim.cmd([[ nnoremap <silent> <buffer> q :close<cr>
set nobuflisted
@@ -84,6 +84,41 @@ vim.api.nvim_create_autocmd({ "BufWritePost" }, {
end,
})
-- vim.keymap.set("n", "<leader>gs", vim.cmd.Git)
-- vim.api.nvim_create_autocmd({ "BufWinEnter" }, {
-- group = vim.api.nvim_create_augroup("Fugitive", {}),
-- pattern = "*",
-- callback = function()
-- if vim.bo.ft ~= "fugitive" then
-- return
-- end
--
-- local bufnr = vim.api.nvim_get_current_buf()
-- local opts = { buffer = bufnr, remap = false }
-- vim.keymap.set("n", "<leader>p", function()
-- vim.cmd.Git("push")
-- end, opts)
--
-- -- rebase always
-- vim.keymap.set("n", "<leader>P", function()
-- vim.cmd.Git({ "pull", "--rebase" })
-- end, opts)
--
-- -- NOTE: It allows me to easily set the branch I am pushing and any tracking
-- -- needed if i did not set the branch up correctly
-- vim.keymap.set("n", "<leader>t", ":Git push -u origin ", opts)
-- end,
-- })
-- Remove trailing whitespaces on save
-- vim.api.nvim_create_autocmd({ "BufWritePre" }, {
-- group = vim.api.nvim_create_augroup("RemoveTrailingWhitespaces", { clear = true }),
-- pattern = "*",
-- callback = function()
-- vim.cmd([[%s/\s\+$//e]])
-- end,
-- })
-- Run lazy on file save
-- vim.api.nvim_create_autocmd({ "BufWritePost" }, {
-- group = vim.api.nvim_create_augroup("AutoPackerSync", { clear = true }),
@@ -94,10 +129,10 @@ vim.api.nvim_create_autocmd({ "BufWritePost" }, {
-- })
-- Set vertical column for all files
vim.api.nvim_create_autocmd({ "FileType" }, {
group = vim.api.nvim_create_augroup("SetColorColumn", { clear = true }),
pattern = { "*" },
callback = function()
vim.cmd.setlocal("colorcolumn=120")
end,
})
-- vim.api.nvim_create_autocmd({ "FileType" }, {
-- group = vim.api.nvim_create_augroup("SetColorColumn", { clear = true }),
-- pattern = { "" },
-- callback = function()
-- vim.cmd.setlocal("colorcolumn=120")
-- end,
-- })

View File

@@ -1,6 +1,6 @@
require("solo.options")
require("solo.keymaps")
require("solo.plugin")
require("solo.vimwiki")
require("solo.plugins")
require("solo.autocommands")
require("solo.alpha")
require("solo.autosave")

View File

@@ -1,9 +1,8 @@
local bind = vim.keymap.set
local opts = { silent = true }
--Remap space as leader key
bind("", "<Space>", "<Nop>", opts)
vim.g.mapleader = " "
vim.keymap.set("", "<Space>", "<nop>")
vim.keymap.set("n", "Q", "<nop>")
vim.keymap.set("n", "q", "<nop>")
-- Modes
-- normal_mode = "n",
@@ -13,81 +12,60 @@ vim.g.mapleader = " "
-- term_mode = "t",
-- command_mode = "c",
-- Normal --
bind("n", "<C-d>", "<C-d>zz", opts)
bind("n", "<C-u>", "<C-u>zz", opts)
bind("n", "n", "nzzzv", opts)
bind("n", "N", "Nzzzv", opts)
vim.keymap.set("n", "<leader>n", vim.cmd.Ex)
-- Better window navigation with tmux
bind("n", "<C-h>", "<cmd>TmuxNavigateLeft<cr>", opts)
bind("n", "<C-j>", "<cmd>TmuxNavigateDown<cr>", opts)
bind("n", "<C-k>", "<cmd>TmuxNavigateUp<cr>", opts)
bind("n", "<C-l>", "<cmd>TmuxNavigateRight<cr>", opts)
vim.keymap.set("v", "<J>", ":m '>+1<cr>gv=gv")
vim.keymap.set("v", "<K>", ":m '<-2<cr>gv=gv")
-- Resize with arrows
bind("n", "<C-Up>", "<cmd>resize -2<cr>", opts)
bind("n", "<C-Down>", "<cmd>resize +2<cr>", opts)
bind("n", "<C-Left>", "<cmd>vertical resize -2<cr>", opts)
bind("n", "<C-Right>", "<cmd>vertical resize +2<cr>", opts)
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")
-- -- Navigate buffers
-- bind("n", "<S-l>", "<cmd>bnext<cr>", opts)
-- bind("n", "<S-h>", "<cmd>bprevious<cr>", opts)
vim.keymap.set("n", "<C-h>", "<cmd>TmuxNavigateLeft<cr>")
vim.keymap.set("n", "<C-j>", "<cmd>TmuxNavigateDown<cr>")
vim.keymap.set("n", "<C-k>", "<cmd>TmuxNavigateUp<cr>")
vim.keymap.set("n", "<C-l>", "<cmd>TmuxNavigateRight<cr>")
-- Better paste
bind("v", "p", '"_dP', opts)
vim.keymap.set("n", "<C-Up>", "<cmd>resize -2<cr>")
vim.keymap.set("n", "<C-Down>", "<cmd>resize +2<cr>")
vim.keymap.set("n", "<C-Left>", "<cmd>vertical resize -2<cr>")
vim.keymap.set("n", "<C-Right>", "<cmd>vertical resize +2<cr>")
-- Move current line / block with Alt-j/k ala vscode
bind("n", "<A-j>", "<cmd>m .+1<cr>==", opts)
bind("n", "<A-k>", "<cmd>m .-2<cr>==", opts)
vim.keymap.set("x", "<leader>p", '"_dP')
-- QuickFix
bind("n", "]q", "<cmd>cnext<cr>", opts)
bind("n", "[q", "<cmd>cprev<cr>", opts)
vim.keymap.set("n", "<C-f>", "<cmd>!tmux neww tmux-sessionizer<cr>")
bind("n", "<S-s>", ":%s/\\<<C-r><C-w>\\>/<C-r><C-w>/gI<Left><Left><Left>", {})
vim.keymap.set("n", "<A-j>", "<cmd>m .+1<cr>==")
vim.keymap.set("n", "<A-k>", "<cmd>m .-2<cr>==")
bind("n", "<S-j>", "mzJ`z")
vim.keymap.set("n", "<leader>j", "<cmd>lua vim.diagnostic.goto_next()<cr>zz")
vim.keymap.set("n", "<leader>k", "<cmd>lua vim.diagnostic.goto_prev()<cr>zz")
vim.keymap.set("n", "<leader>r", function()
vim.lsp.buf.rename()
end)
-- Insert --
-- Press jk fast to enter
bind("i", "jk", "<ESC>", opts)
vim.keymap.set("n", "<leader>s", ":%s/\\<<C-r><C-w>\\>/<C-r><C-w>/gI<Left><Left><Left>")
vim.keymap.set("n", "<leader>x", "<cmd>!chmod +x %<cr>", { silent = true })
-- Move current line / block with Alt-j/k ala vscode.
bind("i", "<A-j>", "<Esc><cmd>m .+1<cr>==gi", opts)
bind("i", "<A-k>", "<Esc><cmd>m .-2<cr>==gi", opts)
-- navigation
bind("i", "<A-Up>", "<C-\\><C-N><C-w>k", opts)
bind("i", "<A-Down>", "<C-\\><C-N><C-w>j", opts)
bind("i", "<A-Left>", "<C-\\><C-N><C-w>h", opts)
bind("i", "<A-Right>", "<C-\\><C-N><C-w>l", opts)
vim.keymap.set("i", "<A-Up>", "<C-\\><C-N><C-w>k")
vim.keymap.set("i", "<A-Down>", "<C-\\><C-N><C-w>j")
vim.keymap.set("i", "<A-Left>", "<C-\\><C-N><C-w>h")
vim.keymap.set("i", "<A-Right>", "<C-\\><C-N><C-w>l")
-- Visual --
-- Stay in indent mode
bind("v", "<", "<gv", opts)
bind("v", ">", ">gv", opts)
vim.keymap.set("v", ">", ">gv")
vim.keymap.set("v", "<", "<gv")
-- bind("v", "<A-j>", "<cmd>m '>+1<cr>gv=gv")
-- bind("v", "<A-k>", "<cmd>m '<-2<cr>gv=gv")
vim.keymap.set("c", "<C-j>", 'pumvisible() ? "\\<C-n>" : "\\<C-j>"', { expr = true, noremap = true })
vim.keymap.set("c", "<C-k>", 'pumvisible() ? "\\<C-p>" : "\\<C-k>"', { expr = true, noremap = true })
-- Visual Block --
-- Move current line / block with Alt-j/k ala vscode.
-- bind("x", "<A-j>", "<cmd>move '>+1<cr>gv-gv", opts)
-- bind("x", "<A-k>", "<cmd>move '<-2<cr>gv-gv", opts)
vim.keymap.set("t", "<C-h>", "<C-\\><C-N><C-w>h")
vim.keymap.set("t", "<C-j>", "<C-\\><C-N><C-w>j")
vim.keymap.set("t", "<C-k>", "<C-\\><C-N><C-w>k")
vim.keymap.set("t", "<C-l>", "<C-\\><C-N><C-w>l")
-- Command --
-- navigate tab completion with <c-j> and <c-k>
-- runs conditionally
bind("c", "<C-j>", 'pumvisible() ? "\\<C-n>" : "\\<C-j>"', { expr = true, noremap = true })
bind("c", "<C-k>", 'pumvisible() ? "\\<C-p>" : "\\<C-k>"', { expr = true, noremap = true })
vim.keymap.set("n", "<C-b>", "<cmd>w!<cr><cmd>!compiler '%:p'<cr>")
vim.keymap.set("n", "<C-o>", "<cmd>w!<cr><cmd>!opout '%:p'<cr>")
-- Terminal --
-- Terminal window navigation
bind("t", "<C-h>", "<C-\\><C-N><C-w>h", opts)
bind("t", "<C-j>", "<C-\\><C-N><C-w>j", opts)
bind("t", "<C-k>", "<C-\\><C-N><C-w>k", opts)
bind("t", "<C-l>", "<C-\\><C-N><C-w>l", opts)
bind("n", "<C-b>", "<cmd>w!<cr><cmd>!compiler '%:p'<cr>")
bind("n", "<C-o>", "<cmd>w!<cr><cmd>!opout '%:p'<cr>")
vim.keymap.set("n", "<leader>mr", "<cmd>CellularAutomation make_it_rain<cr>")

View File

@@ -48,32 +48,19 @@ vim.opt.fillchars.eob = " "
vim.opt.shortmess:append("c")
vim.opt.whichwrap:append("<,>,[,],h,l")
vim.opt.iskeyword:append("-")
vim.opt.isfname:append("@-@")
for k, v in pairs(options) do
vim.opt[k] = v
end
vim.opt.spelloptions:append("camel")
local g = vim.g
g.mapleader = " "
g.maplocalleader = " "
g.loaded_netrw = 1
g.loaded_netrwPlugin = 1
vim.g.mapleader = " "
vim.g.maplocalleader = " "
vim.g.netrw_browse_split = 0
vim.g.netrw_banner = 0
vim.g.netrw_winsize = 25
vim.opt_local.suffixesadd:prepend(".lua")
vim.opt_local.suffixesadd:prepend("init.lua")
vim.opt_local.path:prepend(vim.fn.stdpath("config") .. "/lua")
vim.g.vimwiki_list = {
{
path = "~/vimwiki",
syntax = "markdown",
ext = ".md",
},
}
vim.g.vimwiki_ext2syntax = {
[".md"] = "markdown",
[".markdown"] = "markdown",
[".mdown"] = "markdown",
}
vim.g.vimwiki_global_ext = 1

View File

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

197
lua/solo/plugins.lua Normal file
View File

@@ -0,0 +1,197 @@
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({
{ "folke/lazy.nvim" },
{ "nvim-lua/plenary.nvim" }, -- Useful lua functions used by lots of plugins
{ "andweeb/presence.nvim" },
{ "alvan/vim-closetag" },
{ "mbbill/undotree" },
{ "preservim/tagbar" },
{ "jghauser/mkdir.nvim", lazy = true },
{ "mtdl9/vim-log-highlighting", lazy = true },
{ "christoomey/vim-tmux-navigator" },
{ "ThePrimeagen/vim-be-good", lazy = true },
{
"chipsenkbeil/distant.nvim",
branch = "v0.3",
config = function()
require("distant"):setup()
end,
},
{
"danymat/neogen",
dependencies = { "nvim-treesitter/nvim-treesitter" },
config = true,
version = "*",
},
{ "eandrju/cellular-automaton.nvim", lazy = true },
{ "laytan/cloak.nvim" },
{ "NvChad/nvim-colorizer.lua" },
{ "uga-rosa/ccc.nvim" },
{
"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,
},
{ "bluz71/vim-nightfly-colors", name = "nightfly" },
"numToStr/Comment.nvim",
{
"VonHeikemen/lsp-zero.nvim",
branch = "v2.x",
dependencies = {
-- LSP Support
{ "neovim/nvim-lspconfig" }, -- Required
{ "williamboman/mason.nvim" }, -- Optional
{ "williamboman/mason-lspconfig.nvim" }, -- Optional
-- Autocompletion
{
"hrsh7th/nvim-cmp",
event = "InsertEnter",
dependencies = {
"hrsh7th/cmp-buffer", -- buffer completions
"hrsh7th/cmp-path", -- path completionsplu
"hrsh7th/cmp-nvim-lua",
"hrsh7th/cmp-nvim-lsp",
},
}, -- Required
{ "hrsh7th/cmp-nvim-lsp" }, -- Required
{
"L3MON4D3/LuaSnip",
build = "make install_jsregexp",
dependencies = {
"rafamadriz/friendly-snippets", -- a bunch of snippets to use
},
}, -- Required
{ "saadparwaiz1/cmp_luasnip" },
},
},
{
"windwp/nvim-autopairs", -- Autopairs, integrates with both cmp and treesitter
event = "InsertEnter",
opts = {
check_ts = true, -- treesitter integration
disable_filetype = {
"NvimTree",
"TelescopePrompt",
"alpha",
},
},
},
{
"jay-babu/mason-null-ls.nvim",
event = { "BufReadPre", "BufNewFile" },
dependencies = {
"williamboman/mason.nvim",
"jose-elias-alvarez/null-ls.nvim",
},
},
-- for formatters and linters
{ "nanotee/sqls.nvim", lazy = true },
{
"rcarriga/nvim-dap-ui",
dependencies = { "jayp0521/mason-nvim-dap.nvim" },
},
{
"jayp0521/mason-nvim-dap.nvim",
dependencies = {
{
"williamboman/mason.nvim",
opts = {
automatic_installation = true,
automatic_setup = true,
},
},
"mfussenegger/nvim-dap",
},
},
{ "ravenxrz/DAPInstall.nvim", lazy = true },
{
"nvim-telescope/telescope.nvim",
dependencies = {
{ "nvim-lua/plenary.nvim" },
{ "nvim-telescope/telescope-fzf-native.nvim", build = "make" },
{ "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" },
},
},
"ThePrimeagen/harpoon",
{ "p00f/clangd_extensions.nvim", ft = { "cpp", "c" } },
{ "Civitasv/cmake-tools.nvim", ft = { "cpp", "c" }, dependencies = { "nvim-lua/plenary.nvim" } },
{ "nvim-lualine/lualine.nvim" },
{
"simrat39/rust-tools.nvim",
dependencies = {
"neovim/nvim-lspconfig",
},
ft = "rust",
},
{
"Saecki/crates.nvim",
ft = { "rust", "toml" },
dependencies = {
"nvim-lua/plenary.nvim",
},
},
{ "folke/todo-comments.nvim", opts = true },
{
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
dependencies = {
"nvim-treesitter/playground",
"p00f/nvim-ts-rainbow",
"mechatroner/rainbow_csv",
"JoosepAlviste/nvim-ts-context-commentstring",
},
},
{ "RRethy/vim-illuminate" },
{ "vimwiki/vimwiki" },
{ "kdheepak/lazygit.nvim" },
{ "tpope/vim-fugitive" },
{ "lewis6991/gitsigns.nvim" },
{ "ThePrimeagen/git-worktree.nvim" },
{ "lukas-reineke/indent-blankline.nvim" },
{ "ahmedkhalf/project.nvim" },
{ "kdheepak/lazygit.nvim" },
{
"epwalsh/obsidian.nvim",
lazy = true,
event = {
"BufReadPre " .. vim.fn.expand("~") .. "/vimwiki/**/*.md",
"BufReadPre " .. vim.fn.expand("~") .. "/obsidian/**/*.md",
},
},
})

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

@@ -0,0 +1,13 @@
vim.g.vimwiki_list = {
{
path = "~/vimwiki",
syntax = "markdown",
ext = ".md",
},
}
vim.g.vimwiki_ext2syntax = {
[".md"] = "markdown",
[".markdown"] = "markdown",
[".mdown"] = "markdown",
}
vim.g.vimwiki_global_ext = 1