Moved configs to seperate files

This commit is contained in:
angryluck 2024-05-28 21:08:24 +02:00
parent fdb565ce87
commit 3b96ad1b57
26 changed files with 578 additions and 229 deletions

View file

@ -0,0 +1,9 @@
-- [[ Basic Autocommands ]]
-- See ':help lua-guide-autocommands'
vim.api.nvim_create_autocmd("TextYankPost", {
desc = "Highlight when yanking (copying text)",
group = vim.api.nvim_create_augroup("highlight-yank", { clear = true }),
callback = function()
vim.highlight.on_yank()
end,
})

27
lua/angryluck/keymaps.lua Normal file
View file

@ -0,0 +1,27 @@
-- [[ Basic Keymaps ]]
-- mapleader = " " and maplocalleader = " " are set in init.lua
-- Combined with 'vim.opt.hlssearch = true'
vim.keymap.set("n", "<Esc>", "<cmd>nohlsearch<CR>")
vim.keymap.set({ "n", "v" }, "<Space>", "<Nop>", { silent = true })
-- 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 })
vim.keymap.set("n", "gk", "v:count == 0 ? 'k' : 'k'", { expr = true, silent = true })
vim.keymap.set("n", "gj", "v:count == 0 ? 'j' : 'j'", { expr = true, silent = true })
-- Diagnostic keymaps
vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, { desc = "Go to previous [D]iagnostic message" })
vim.keymap.set("n", "]d", vim.diagnostic.goto_next, { desc = "Go to next [D]iagnostic message" })
vim.keymap.set("n", "<leader>e", vim.diagnostic.open_float, { desc = "Show diagnostic [E]rror messages" })
vim.keymap.set("n", "<leader>q", vim.diagnostic.setloclist, { desc = "Open diagnostic [Q]uickfix list" })
vim.keymap.set("t", "<Esc><Esc>", "<C-\\><C-n>", { desc = "Exit terminal mode" })
-- Easier window movement (but conflicts with Harpoon)
-- vim.keymap.set("n", "<C-h>", "<C-w><C-h>", { desc = "Move focus to the left window" })
-- vim.keymap.set("n", "<C-l>", "<C-w><C-l>", { desc = "Move focus to the right window" })
-- vim.keymap.set("n", "<C-j>", "<C-w><C-j>", { desc = "Move focus to the lower window" })
-- vim.keymap.set("n", "<C-k>", "<C-w><C-k>", { desc = "Move focus to the upper window" })

63
lua/angryluck/options.lua Normal file
View file

@ -0,0 +1,63 @@
-- [[ Options ]]
-- See :help option-list
-- For custom functions later
vim.g.have_nerd_font = true
vim.opt.number = true
vim.opt.relativenumber = true
vim.opt.colorcolumn = "80"
-- Only mouse in [h]elp windows
-- Or [a]llways
vim.opt.mouse = "a"
-- statusline already shows mode
vim.opt.showmode = false
-- Copy from anywhere
vim.opt.clipboard = "unnamedplus"
-- Visual wrap keeps indentation
vim.opt.breakindent = true
vim.opt.undofile = true
-- Case-insensitive searching UNLESS \C or capital in search
vim.opt.ignorecase = true
vim.opt.smartcase = true
-- Text keeps moving, if not always on
vim.opt.signcolumn = "yes"
vim.opt.updatetime = 250
-- For which-key
vim.opt.timeoutlen = 300
vim.opt.list = true
vim.opt.listchars = { tab = "» ", trail = "·", nbsp = "" }
-- Preview substitutions live, as you type!
vim.opt.inccommand = "nosplit"
vim.opt.cursorline = true
vim.opt.scrolloff = 10
vim.opt.splitright = true
vim.opt.splitbelow = true
-- wrap between words
vim.opt.linebreak = true
vim.opt.expandtab = true
vim.opt.shiftwidth = 4
vim.opt.tabstop = 8
vim.opt.softtabstop = 4
-- Don't keep buffer open when opening new file
vim.opt.hidden = false
-- Combined with mapping <Esc> to clear highlights
vim.opt.hlsearch = true

View file

@ -1,17 +1,18 @@
return {
{
-- Best colorscheme
'catppuccin/nvim',
name = 'catppuccin',
"catppuccin/nvim",
lazy = false,
name = "catppuccin",
priority = 1000,
config = function()
vim.cmd.colorscheme 'catppuccin'
vim.cmd.colorscheme "catppuccin"
end,
},
{
-- Theme inspired by Atom
'navarasu/onedark.nvim',
"navarasu/onedark.nvim",
priority = 1000,
-- config = function()
-- vim.cmd.colorscheme 'onedark'

View file

@ -0,0 +1,64 @@
return {
-- "ThePrimeagen/harpoon",
-- branch = "harpoon2",
-- dependencies = { "nvim-lua/plenary.nvim" },
-- config = function()
-- local harpoon = require "harpoon"
--
-- -- REQUIRED
-- harpoon:setup {}
-- -- REQUIRED
--
-- vim.keymap.set("n", "<leader>a", function()
-- harpoon:list():append()
-- end)
-- -- vim.keymap.set("n", "<C-g>", function()
-- -- harpoon.ui:toggle_quick_menu(harpoon:list())
-- -- end)
--
-- vim.keymap.set("n", "<C-h>", function()
-- harpoon:list():select(1)
-- end)
-- vim.keymap.set("n", "<C-j>", function()
-- harpoon:list():select(2)
-- end)
-- vim.keymap.set("n", "<C-k>", function()
-- harpoon:list():select(3)
-- end)
-- vim.keymap.set("n", "<C-l>", function()
-- harpoon:list():select(4)
-- end)
--
-- -- Toggle previous & next buffers stored within Harpoon list
-- vim.keymap.set("n", "<C-S-P>", function()
-- harpoon:list():prev()
-- end)
-- vim.keymap.set("n", "<C-S-N>", function()
-- harpoon:list():next()
-- end)
--
-- -- basic telescope configuration
-- local conf = require("telescope.config").values
-- local function toggle_telescope(harpoon_files)
-- local file_paths = {}
-- for _, item in ipairs(harpoon_files.items) do
-- table.insert(file_paths, item.value)
-- end
--
-- require("telescope.pickers")
-- .new({}, {
-- prompt_title = "Harpoon",
-- finder = require("telescope.finders").new_table {
-- results = file_paths,
-- },
-- previewer = conf.file_previewer {},
-- sorter = conf.generic_sorter {},
-- })
-- :find()
-- end
--
-- vim.keymap.set("n", "<C-g>", function()
-- toggle_telescope(harpoon:list())
-- end, { desc = "Open harpoon window" })
-- end,
}

View file

@ -0,0 +1,6 @@
return {
-- "mrcjkb/haskell-tools.nvim",
-- version = "^3", -- Recommended
-- lazy = false,
-- ft = { "haskell", "stack", "lhaskell", "cabal", "cabalproject" },
}

View file

@ -0,0 +1,78 @@
-- Own plugins, too small for own file
-- Probably better to add one file for each
return {
"fladson/vim-kitty",
-- OWN PLUGINS
-- Better scrolloff
{
"Aasim-A/scrollEOF.nvim",
event = { "CursorMoved", "WinScrolled" },
opts = {},
},
{
"renerocksai/telekasten.nvim",
dependencies = { "nvim-telescope/telescope.nvim" },
},
-- install without yarn or npm
{
"iamcco/markdown-preview.nvim",
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
ft = { "markdown" },
build = function()
vim.fn["mkdp#util#install"]()
end,
},
-- Better than mini.surround, imo
-- Remember: y for "yadd".
{
"kylechui/nvim-surround",
version = "*", -- Use for stability; omit to use `main` branch for the latest features
event = "VeryLazy",
config = function()
require("nvim-surround").setup({
-- Configuration here, or leave empty to use defaults
})
end,
},
-- "." repeats plugincommands
"tpope/vim-repeat",
-- {
-- "ggandor/leap.nvim",
-- -- opts = {},
-- config = function()
-- require("leap").create_default_mappings()
-- end,
-- },
{
"folke/flash.nvim",
event = "VeryLazy",
opts = {},
keys = {
-- stylua: ignore start
{ "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash", },
{ "S", mode = { "n", "x", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter", },
{ "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash", },
{ "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search", },
{ "<c-s>", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search", },
-- stylua: ignore end
},
},
-- Edit files like nvim buffer
{
"stevearc/oil.nvim",
opts = {},
-- Optional dependencies
dependencies = { "nvim-tree/nvim-web-devicons" },
config = function()
require("oil").setup()
end,
},
}

View file

@ -0,0 +1,29 @@
return {
-- "nvim-neorg/neorg",
-- dependencies = { "nvim-lua/plenary.nvim" },
-- build = ":Neorg sync-parsers",
-- -- tag = "*",
-- lazy = true, -- enable lazy load
-- ft = "norg", -- lazy load on file type
-- cmd = "Neorg", -- lazy load on command
-- config = function()
-- require("neorg").setup {
-- load = {
-- ["core.defaults"] = {}, -- Loads default behaviour
-- ["core.concealer"] = {}, -- Adds pretty icons to your documents
-- ["core.dirman"] = { -- Manages Neorg workspaces
-- config = {
-- workspaces = {
-- notes = "~/documents/notes",
-- },
-- },
-- },
-- ["core.completion"] = {
-- config = {
-- engine = "nvim-cmp",
-- }
-- }
-- },
-- }
-- end,
}

View file

@ -0,0 +1,4 @@
return {
-- Syntax highlight for rofi config (config.rasi)
"Fymyte/rasi.vim",
}

View file

@ -0,0 +1,10 @@
return {
-- -- TREESITTER SHOULD HANDLE THIS!
-- "AndrewRadev/sideways.vim",
-- config = function()
-- vim.keymap.set("n", "<leader>s<", ":SidewaysLeft<Cr>")
-- vim.keymap.set("n", "<leader>s>", ":SidewaysRight<Cr>")
-- vim.keymap.set("n", "<leader>sh", ":SidewaysJumpLeft<Cr>")
-- vim.keymap.set("n", "<leader>sl", ":SidewaysJumpRight<Cr>")
-- end,
}

View file

@ -0,0 +1,83 @@
return {
"nvim-orgmode/orgmode",
dependencies = {
{
"nvim-treesitter/nvim-treesitter",
lazy = true,
config = function()
-- Setup treesitter
require("nvim-treesitter.configs").setup {
highlight = {
enable = true,
},
ensure_installed = { "org" },
}
end,
},
{
"akinsho/org-bullets.nvim",
config = function()
require("org-bullets").setup()
end,
},
-- "joaomsa/telescope-orgmode.nvim",
-- "nvim-telescope/telescope.nvim",
-- {
-- "lukas-reineke/headlines.nvim",
-- dependencies = "nvim-treesitter/nvim-treesitter",
-- config = function()
-- vim.cmd [[highlight Headline1 guibg=#1e2718]]
-- vim.cmd [[highlight Headline2 guibg=#21262d]]
-- vim.cmd [[highlight CodeBlock guibg=#1c1c1c]]
-- vim.cmd [[highlight Dash guibg=#D19A66 gui=bold]]
--
-- require("headlines").setup {
-- org = {
-- headline_highlights = { "Headline1", "Headline2" },
-- },
-- }
-- end, -- or `opts = {}`
-- },
},
-- ADD THIS BACK LATER - SOMETHING WRONG, SO DOESNT START
-- event = 'VeryLazy',
config = function()
-- Load treesitter grammar for org
-- require("orgmode").setup_ts_grammar()
-- require("telescope").load_extension "orgmode"
-- vim.api.nvim_create_autocmd("FileType", {
-- pattern = "org",
-- group = vim.api.nvim_create_augroup("orgmode_telescope_nvim", { clear = true }),
-- callback = function()
-- vim.keymap.set("n", "<leader>or", require("telescope").extensions.orgmode.refile_heading)
-- end,
-- })
-- Setup orgmode
require("orgmode").setup {
org_agenda_files = { "~/documents/orgfiles/**/*", "~/gtd/**/*" },
-- org_default_notes_file = "~/documents/orgfiles/refile.org",
org_default_notes_file = "~/gtd/inbox.org",
org_archive_location = "~/gtd/archive/%s_archive::",
org_todo_keywords = {
"NEXT(n)",
"TODO(t)",
"WAITING(w)",
-- "SCHEDULED(s)",
"|",
"DONE(d)",
"CANCELLED(c)",
},
-- org_hide_leading_stars = true,
mappings = {
capture = {
org_capture_finalize = "<Leader>ow",
},
note = {
org_note_finalize = "<Leader>ow",
},
},
}
end,
}

View file

@ -1,5 +0,0 @@
return {
'mrcjkb/haskell-tools.nvim',
version = '^3', -- Recommended
ft = { 'haskell', 'lhaskell', 'cabal', 'cabalproject' },
}

View file

@ -1,9 +0,0 @@
-- You can add your own plugins here or in other files in this directory!
-- I promise not to create any merge conflicts in this directory :)
--
-- See the kickstart.nvim README for more information
--
-- FOR PLUGINS NOT REQUIRING CONFIGURATION:
return {
"fladson/vim-kitty"
}

View file

@ -1,29 +0,0 @@
return {
"nvim-neorg/neorg",
dependencies = { "nvim-lua/plenary.nvim" },
build = ":Neorg sync-parsers",
-- tag = "*",
lazy = true, -- enable lazy load
ft = "norg", -- lazy load on file type
cmd = "Neorg", -- lazy load on command
config = function()
require("neorg").setup {
load = {
["core.defaults"] = {}, -- Loads default behaviour
["core.concealer"] = {}, -- Adds pretty icons to your documents
["core.dirman"] = { -- Manages Neorg workspaces
config = {
workspaces = {
notes = "~/documents/notes",
},
},
},
["core.completion"] = {
config = {
engine = "nvim-cmp",
}
}
},
}
end,
}

View file

@ -1,3 +0,0 @@
return {
"Fymyte/rasi.vim"
}

View file

@ -1,9 +0,0 @@
return {
"AndrewRadev/sideways.vim",
config = function()
vim.keymap.set("n", "<leader>s<", ":SidewaysLeft<Cr>")
vim.keymap.set("n", "<leader>s>", ":SidewaysRight<Cr>")
vim.keymap.set("n", "<leader>sh", ":SidewaysJumpLeft<Cr>")
vim.keymap.set("n", "<leader>sl", ":SidewaysJumpRight<Cr>")
end,
}

View file

@ -1,26 +0,0 @@
return {
'nvim-orgmode/orgmode',
dependencies = {
{ 'nvim-treesitter/nvim-treesitter', lazy = true },
},
-- ADD THIS BACK LATER - SOMETHING WRONG, SO DOESNT START
-- event = 'VeryLazy',
config = function()
-- Load treesitter grammar for org
require('orgmode').setup_ts_grammar()
-- Setup treesitter
require('nvim-treesitter.configs').setup({
highlight = {
enable = true,
},
ensure_installed = { 'org' },
})
-- Setup orgmode
require('orgmode').setup({
org_agenda_files = '~/documents/orgfiles/**/*',
org_default_notes_file = '~/documents/orgfiles/refile.org',
})
end,
}