summaryrefslogtreecommitdiff
path: root/.config/nvim/lua
diff options
context:
space:
mode:
authorKashieru1987 <mahdichowdhury07@gmail.com>2025-03-30 13:38:25 +0100
committerKashieru1987 <mahdichowdhury07@gmail.com>2025-03-30 13:38:25 +0100
commit87f42cb4c2abd74d0227cbf7a555a7e28e0c3576 (patch)
tree34fce0c223b9cf81efad4a0204c44860686d685b /.config/nvim/lua
parent452f00a528aa4b77a61c53af5c55b197acffef65 (diff)
added some configs from .config :3HEADdebian-chan
Diffstat (limited to '.config/nvim/lua')
-rw-r--r--.config/nvim/lua/chronoziel/hover.lua35
-rw-r--r--.config/nvim/lua/chronoziel/init.lua4
-rw-r--r--.config/nvim/lua/chronoziel/lazy.lua23
-rw-r--r--.config/nvim/lua/chronoziel/plugins/colours.lua13
-rw-r--r--.config/nvim/lua/chronoziel/plugins/harpoon.lua15
-rw-r--r--.config/nvim/lua/chronoziel/plugins/lsp-zero.lua168
-rw-r--r--.config/nvim/lua/chronoziel/plugins/lualine.lua50
-rw-r--r--.config/nvim/lua/chronoziel/plugins/markview.lua4
-rw-r--r--.config/nvim/lua/chronoziel/plugins/noice.lua36
-rw-r--r--.config/nvim/lua/chronoziel/plugins/nvim-surround.lua3
-rw-r--r--.config/nvim/lua/chronoziel/plugins/telescope.lua16
-rw-r--r--.config/nvim/lua/chronoziel/plugins/treesitter.lua26
-rw-r--r--.config/nvim/lua/chronoziel/plugins/undotree.lua6
-rw-r--r--.config/nvim/lua/chronoziel/plugins/vim-be-good.lua3
-rw-r--r--.config/nvim/lua/chronoziel/remap.lua57
-rw-r--r--.config/nvim/lua/chronoziel/set.lua41
16 files changed, 500 insertions, 0 deletions
diff --git a/.config/nvim/lua/chronoziel/hover.lua b/.config/nvim/lua/chronoziel/hover.lua
new file mode 100644
index 0000000..0a49574
--- /dev/null
+++ b/.config/nvim/lua/chronoziel/hover.lua
@@ -0,0 +1,35 @@
+
+-- Function to enable the hover autocmd
+function EnableHoverAutocmd()
+ vim.cmd [[
+ augroup HoverInfo
+ autocmd!
+ autocmd CursorHold * lua vim.lsp.buf.hover()
+ augroup END
+ ]]
+end
+
+-- Function to disable the hover autocmd
+function DisableHoverAutocmd()
+ vim.cmd [[
+ augroup HoverInfo
+ autocmd!
+ augroup END
+ ]]
+end
+
+-- Variable to keep track of the autocmd state
+local hover_autocmd_enabled = false
+
+-- Toggle function
+function ToggleHoverAutocmd()
+ if hover_autocmd_enabled then
+ DisableHoverAutocmd()
+ hover_autocmd_enabled = false
+ print("Hover autocmd disabled")
+ else
+ EnableHoverAutocmd()
+ hover_autocmd_enabled = true
+ print("Hover autocmd enabled")
+ end
+end
diff --git a/.config/nvim/lua/chronoziel/init.lua b/.config/nvim/lua/chronoziel/init.lua
new file mode 100644
index 0000000..6c7c0e9
--- /dev/null
+++ b/.config/nvim/lua/chronoziel/init.lua
@@ -0,0 +1,4 @@
+require("chronoziel.remap")
+require("chronoziel.set")
+require("chronoziel.lazy")
+require("chronoziel.hover")
diff --git a/.config/nvim/lua/chronoziel/lazy.lua b/.config/nvim/lua/chronoziel/lazy.lua
new file mode 100644
index 0000000..605c0b0
--- /dev/null
+++ b/.config/nvim/lua/chronoziel/lazy.lua
@@ -0,0 +1,23 @@
+-- Bootstrap lazy.nvim
+local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
+if not (vim.uv or vim.loop).fs_stat(lazypath) then
+ local lazyrepo = "https://github.com/folke/lazy.nvim.git"
+ local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
+ if vim.v.shell_error ~= 0 then
+ vim.api.nvim_echo({
+ { "Failed to clone lazy.nvim:\n", "ErrorMsg" },
+ { out, "WarningMsg" },
+ { "\nPress any key to exit..." },
+ }, true, {})
+ vim.fn.getchar()
+ os.exit(1)
+ end
+end
+vim.opt.rtp:prepend(lazypath)
+
+-- Make sure to setup `mapleader` and `maplocalleader` before
+-- loading lazy.nvim so that mappings are correct.
+-- This is also a good place to setup other settings (vim.opt)
+
+-- Setup lazy.nvim
+require("lazy").setup("chronoziel.plugins")
diff --git a/.config/nvim/lua/chronoziel/plugins/colours.lua b/.config/nvim/lua/chronoziel/plugins/colours.lua
new file mode 100644
index 0000000..b952d54
--- /dev/null
+++ b/.config/nvim/lua/chronoziel/plugins/colours.lua
@@ -0,0 +1,13 @@
+return {
+ "rose-pine/neovim",
+ name = "rose-pine",
+ config = function()
+ vim.cmd("colorscheme rose-pine");
+ -- vim.cmd.colorscheme(color)
+
+ vim.api.nvim_set_hl(0, "Normal", {bg = "none"})
+ vim.api.nvim_set_hl(0, "NormalFloat", {bg = "none"})
+
+
+ end
+}
diff --git a/.config/nvim/lua/chronoziel/plugins/harpoon.lua b/.config/nvim/lua/chronoziel/plugins/harpoon.lua
new file mode 100644
index 0000000..b22c104
--- /dev/null
+++ b/.config/nvim/lua/chronoziel/plugins/harpoon.lua
@@ -0,0 +1,15 @@
+return {
+ "theprimeagen/harpoon",
+ config = function()
+ local mark = require("harpoon.mark")
+ local ui = require("harpoon.ui")
+
+ vim.keymap.set("n", "<leader>a", mark.add_file)
+ vim.keymap.set("n", "<C-e>", ui.toggle_quick_menu)
+
+ vim.keymap.set("n", "<C-h>", function() ui.nav_file(1) end)
+ vim.keymap.set("n", "<C-j>", function() ui.nav_file(2) end)
+ vim.keymap.set("n", "<C-k>", function() ui.nav_file(3) end)
+ vim.keymap.set("n", "<C-l>", function() ui.nav_file(4) end)
+ end
+}
diff --git a/.config/nvim/lua/chronoziel/plugins/lsp-zero.lua b/.config/nvim/lua/chronoziel/plugins/lsp-zero.lua
new file mode 100644
index 0000000..dd58ee4
--- /dev/null
+++ b/.config/nvim/lua/chronoziel/plugins/lsp-zero.lua
@@ -0,0 +1,168 @@
+return {
+ "VonHeikemen/lsp-zero.nvim",
+
+ dependencies = {
+ {'williamboman/mason.nvim'},
+ {'williamboman/mason-lspconfig.nvim'},
+
+ {'neovim/nvim-lspconfig'},
+ {'hrsh7th/nvim-cmp'},
+ {'hrsh7th/cmp-nvim-lsp'},
+ },
+
+ config = function()
+ -- "Avoids annoying layout shift in the screen"
+ vim.opt.signcolumn = 'yes'
+
+ -- Adds cmp_nvim_lsp capabilities settings to lspconfig
+ local lspconfig_defaults = require('lspconfig').util.default_config
+ lspconfig_defaults.capabilities = vim.tbl_deep_extend(
+ 'force',
+ lspconfig_defaults.capabilities,
+ require('cmp_nvim_lsp').default_capabilities()
+ )
+
+ -- This is where you enable features that only work
+ -- if there is a language server active in the file
+ vim.api.nvim_create_autocmd('LspAttach', {
+ desc = 'LSP actions',
+ callback = function(event)
+ local opts = {buffer = event.buf}
+
+ vim.keymap.set('n', 'K', '<cmd>lua vim.lsp.buf.hover()<cr>', opts)
+ vim.keymap.set('n', 'gd', '<cmd>lua vim.lsp.buf.definition()<cr>', opts)
+ vim.keymap.set('n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<cr>', opts)
+ vim.keymap.set('n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<cr>', opts)
+ vim.keymap.set('n', 'go', '<cmd>lua vim.lsp.buf.type_definition()<cr>', opts)
+ vim.keymap.set('n', 'gr', '<cmd>lua vim.lsp.buf.references()<cr>', opts)
+ vim.keymap.set('n', 'gs', '<cmd>lua vim.lsp.buf.signature_help()<cr>', opts)
+ vim.keymap.set('n', '<F2>', '<cmd>lua vim.lsp.buf.rename()<cr>', opts)
+ vim.keymap.set({'n', 'x'}, '<F3>', '<cmd>lua vim.lsp.buf.format({async = true})<cr>', opts)
+ vim.keymap.set('n', '<F4>', '<cmd>lua vim.lsp.buf.code_action()<cr>', opts)
+ end,
+ })
+
+ -- to learn how to use mason.nvim
+ -- read this: https://github.com/VonHeikemen/lsp-zero.nvim/blob/v3.x/doc/md/guides/integrate-with-mason-nvim.md
+ require('mason').setup({})
+
+ require('mason-lspconfig').setup({
+ ensure_installed = {},
+ handlers = {
+ function(server_name)
+ require('lspconfig')[server_name].setup({})
+ end,
+ },
+ })
+
+ require('lspconfig').harper_ls.setup {
+ settings = {
+ ["harper-ls"] = {
+ linters = {
+ spell_check = false,
+ spelled_numbers = false,
+ an_a = true,
+ sentence_capitalization = false,
+ unclosed_quotes = true,
+ wrong_quotes = false,
+ long_sentences = false,
+ repeated_words = false,
+ spaces = true,
+ matcher = true,
+ correct_number_suffix = true,
+ number_suffix_capitalization = true,
+ multiple_sequential_pronouns = true,
+ linking_verbs = false,
+ avoid_curses = false,
+ terminating_conjunctions = true
+ }
+ }
+ },
+ }
+
+ local cmp = require('cmp')
+
+ cmp.setup({
+ sources = {
+ {name = 'nvim_lsp'},
+ },
+ snippet = {
+ expand = function(args)
+ -- You need Neovim v0.10 to use vim.snippet
+ vim.snippet.expand(args.body)
+ end,
+ },
+-- mapping = cmp.mapping.preset.insert({}),
+
+ mapping = {
+ ["<Tab>"] = cmp.mapping.select_next_item(),
+ ["<S-Tab>"] = cmp.mapping.select_prev_item(),
+ ["<C-Tab>"] = cmp.mapping.complete(),
+ }
+
+ })
+
+
+ end,
+
+ -- "VonHeikemen/lsp-zero.nvim",
+ -- dependencies = {
+ -- {'williamboman/mason.nvim'},
+ -- {'williamboman/mason-lspconfig.nvim'},
+ --
+ -- {'neovim/nvim-lspconfig'},
+ -- {'hrsh7th/nvim-cmp'},
+ -- {'hrsh7th/cmp-nvim-lsp'},
+ --
+ -- {'L3MON4D3/LuaSnip'},
+ -- },
+ --
+ -- config = function()
+ -- local lsp_zero = require('lsp-zero')
+ --
+ -- lsp_zero.on_attach(function(client, bufnr)
+ -- -- see :help lsp-zero-keybindings
+ -- -- to learn the available actions
+ -- lsp_zero.default_keymaps({buffer = bufnr})
+ -- end)
+ --
+ --
+ -- -- to learn how to use mason.nvim
+ -- -- read this: https://github.com/VonHeikemen/lsp-zero.nvim/blob/v3.x/doc/md/guides/integrate-with-mason-nvim.md
+ -- require('mason').setup({})
+ --
+ -- require('mason-lspconfig').setup({
+ -- ensure_installed = {},
+ -- handlers = {
+ -- function(server_name)
+ -- require('lspconfig')[server_name].setup({})
+ -- end,
+ -- },
+ -- })
+ --
+ -- require('lspconfig').harper_ls.setup {
+ -- settings = {
+ -- ["harper-ls"] = {
+ -- linters = {
+ -- spell_check = false,
+ -- spelled_numbers = false,
+ -- an_a = true,
+ -- sentence_capitalization = false,
+ -- unclosed_quotes = true,
+ -- wrong_quotes = false,
+ -- long_sentences = false,
+ -- repeated_words = false,
+ -- spaces = true,
+ -- matcher = true,
+ -- correct_number_suffix = true,
+ -- number_suffix_capitalization = true,
+ -- multiple_sequential_pronouns = true,
+ -- linking_verbs = false,
+ -- avoid_curses = false,
+ -- terminating_conjunctions = true
+ -- }
+ -- }
+ -- },
+ -- }
+ -- end
+ }
diff --git a/.config/nvim/lua/chronoziel/plugins/lualine.lua b/.config/nvim/lua/chronoziel/plugins/lualine.lua
new file mode 100644
index 0000000..bf0fb8e
--- /dev/null
+++ b/.config/nvim/lua/chronoziel/plugins/lualine.lua
@@ -0,0 +1,50 @@
+return {
+ "nvim-lualine/lualine.nvim",
+ dependencies = {
+ "nvim-tree/nvim-web-devicons"
+ },
+ config = function()
+ local lualine = require('lualine')
+
+ lualine.setup {
+ options = {
+ icons_enabled = true,
+ theme = 'horizon',
+ component_separators = { left = '', right = ''},
+ section_separators = { left = '', right = ''},
+ disabled_filetypes = {
+ statusline = {},
+ winbar = {},
+ },
+ ignore_focus = {},
+ always_divide_middle = true,
+ globalstatus = false,
+ refresh = {
+ statusline = 1000,
+ tabline = 1000,
+ winbar = 1000,
+ }
+ },
+ sections = {
+ lualine_a = {'mode'},
+ lualine_b = {'branch', 'diff', 'diagnostics'},
+ lualine_c = {'filename'},
+ lualine_x = {'encoding', 'fileformat', 'filetype'},
+ lualine_y = {'progress'},
+ lualine_z = {'location'}
+ },
+ inactive_sections = {
+ lualine_a = {},
+ lualine_b = {},
+ lualine_c = {'filename'},
+ lualine_x = {'location'},
+ lualine_y = {},
+ lualine_z = {}
+ },
+ tabline = {},
+ winbar = {},
+ inactive_winbar = {},
+ extensions = {}
+ }
+ end
+}
diff --git a/.config/nvim/lua/chronoziel/plugins/markview.lua b/.config/nvim/lua/chronoziel/plugins/markview.lua
new file mode 100644
index 0000000..d2af8fd
--- /dev/null
+++ b/.config/nvim/lua/chronoziel/plugins/markview.lua
@@ -0,0 +1,4 @@
+return {
+ "OXY2DEV/markview.nvim",
+ lazy = false
+};
diff --git a/.config/nvim/lua/chronoziel/plugins/noice.lua b/.config/nvim/lua/chronoziel/plugins/noice.lua
new file mode 100644
index 0000000..dc9de97
--- /dev/null
+++ b/.config/nvim/lua/chronoziel/plugins/noice.lua
@@ -0,0 +1,36 @@
+return {
+-- "folke/noice.nvim",
+-- event = "VeryLazy",
+-- opts = {
+-- -- add any options here
+-- },
+-- dependencies = {
+-- -- if you lazy-load any plugin below, make sure to add proper `module="..."` entries
+-- "MunifTanjim/nui.nvim",
+-- -- OPTIONAL:
+-- -- `nvim-notify` is only needed, if you want to use the notification view.
+-- -- If not available, we use `mini` as the fallback
+-- "rcarriga/nvim-notify",
+-- },
+-- config = function()
+-- require("noice").setup({
+-- lsp = {
+-- -- override markdown rendering so that **cmp** and other plugins use **Treesitter**
+-- override = {
+-- ["vim.lsp.util.convert_input_to_markdown_lines"] = true,
+-- ["vim.lsp.util.stylize_markdown"] = true,
+-- ["cmp.entry.get_documentation"] = true, -- requires hrsh7th/nvim-cmp
+-- },
+-- },
+-- -- you can enable a preset for easier configuration
+-- presets = {
+-- bottom_search = true, -- use a classic bottom cmdline for search
+-- command_palette = true, -- position the cmdline and popupmenu together
+-- long_message_to_split = true, -- long messages will be sent to a split
+-- inc_rename = false, -- enables an input dialog for inc-rename.nvim
+-- lsp_doc_border = false, -- add a border to hover docs and signature help
+-- },
+-- })
+-- vim.keymap.set("n", "<leader>nd", "<cmd>NoiceDismiss<CR>")
+-- end
+}
diff --git a/.config/nvim/lua/chronoziel/plugins/nvim-surround.lua b/.config/nvim/lua/chronoziel/plugins/nvim-surround.lua
new file mode 100644
index 0000000..2e2e019
--- /dev/null
+++ b/.config/nvim/lua/chronoziel/plugins/nvim-surround.lua
@@ -0,0 +1,3 @@
+return {
+ "kylechui/nvim-surround",
+}
diff --git a/.config/nvim/lua/chronoziel/plugins/telescope.lua b/.config/nvim/lua/chronoziel/plugins/telescope.lua
new file mode 100644
index 0000000..7740e83
--- /dev/null
+++ b/.config/nvim/lua/chronoziel/plugins/telescope.lua
@@ -0,0 +1,16 @@
+return {
+ "nvim-telescope/telescope.nvim",
+ dependencies = {
+ "nvim-lua/plenary.nvim"
+ },
+ config = function()
+ local builtin = require('telescope.builtin')
+
+ -- PRIMEAGEN KEYBINDS
+ vim.keymap.set('n', '<leader>pf', builtin.find_files, {})
+ vim.keymap.set('n', '<C-p>', builtin.git_files, {})
+ vim.keymap.set('n', '<leader>ps', function()
+ builtin.grep_string({ search = vim.fn.input("Grep > ") });
+ end)
+ end
+}
diff --git a/.config/nvim/lua/chronoziel/plugins/treesitter.lua b/.config/nvim/lua/chronoziel/plugins/treesitter.lua
new file mode 100644
index 0000000..710a6f4
--- /dev/null
+++ b/.config/nvim/lua/chronoziel/plugins/treesitter.lua
@@ -0,0 +1,26 @@
+return {
+ "nvim-treesitter/nvim-treesitter",
+ config = function()
+ require'nvim-treesitter.configs'.setup {
+ -- A list of parser names, or "all" (the listed parsers MUST always be installed)
+ ensure_installed = { "c", "lua", "java", "rust", "vim", "vimdoc", "query", "markdown", "markdown_inline" },
+
+ -- Install parsers synchronously (only applied to `ensure_installed`)
+ sync_install = false,
+
+ -- Automatically install missing parsers when entering buffer
+ -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
+ auto_install = true,
+
+ highlight = {
+ enable = true,
+
+ -- Setting this to true will run `:h syntax` and tree-sitter at the same time.
+ -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
+ -- Using this option may slow down your editor, and you may see some duplicate highlights.
+ -- Instead of true it can also be a list of languages
+ additional_vim_regex_highlighting = false,
+ },
+ }
+ end
+}
diff --git a/.config/nvim/lua/chronoziel/plugins/undotree.lua b/.config/nvim/lua/chronoziel/plugins/undotree.lua
new file mode 100644
index 0000000..1404add
--- /dev/null
+++ b/.config/nvim/lua/chronoziel/plugins/undotree.lua
@@ -0,0 +1,6 @@
+return {
+ "mbbill/undotree",
+ config = function()
+ vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle)
+ end
+}
diff --git a/.config/nvim/lua/chronoziel/plugins/vim-be-good.lua b/.config/nvim/lua/chronoziel/plugins/vim-be-good.lua
new file mode 100644
index 0000000..e27b7b1
--- /dev/null
+++ b/.config/nvim/lua/chronoziel/plugins/vim-be-good.lua
@@ -0,0 +1,3 @@
+return {
+ "ThePrimeagen/vim-be-good"
+}
diff --git a/.config/nvim/lua/chronoziel/remap.lua b/.config/nvim/lua/chronoziel/remap.lua
new file mode 100644
index 0000000..edf5d7b
--- /dev/null
+++ b/.config/nvim/lua/chronoziel/remap.lua
@@ -0,0 +1,57 @@
+vim.g.mapleader = " "
+
+--PERSONAL ADDITIONS
+
+--Allows Control Delete
+vim.keymap.set("i", "<C-H>", "<C-W>")
+
+--Java compile and run mappings
+vim.keymap.set("n", "<leader>jc", ":!javac %:p<CR>", { noremap = true })
+vim.keymap.set("n", "<leader>jr", ":!javac %:t:r<CR>", { noremap = true })
+
+--Open terminal
+vim.keymap.set("n", "<leader>t", ":term<CR>a")
+
+--Show properties from LSP
+vim.keymap.set("n", "<leader>1", ":lua vim.lsp.buf.hover()<CR>", { noremap = true })
+
+--Toggle cursor hover auto-show properties
+vim.keymap.set("n", "<leader>2", ":lua ToggleHoverAutocmd()<CR>", { noremap = true, silent = true});
+
+--PRIMEAGEN KEYBINDS
+
+vim.keymap.set("n", "<leader>pv", vim.cmd.Ex)
+--cool moving and auto-indent with visual mode
+vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv")
+vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv")
+
+
+--keeps cursor in same place when removing newline
+vim.keymap.set("n", "J", "mzJ`z")
+
+--centers cursor on half page jumps
+vim.keymap.set("n", "<C-d>", "<C-d>zz")
+vim.keymap.set("n", "<C-u>", "<C-u>zz")
+
+--centers cursor on search terms
+vim.keymap.set("n", "n", "nzzzv")
+vim.keymap.set("n", "N", "Nzzzv")
+
+--pastes and preserves current paste buffer
+vim.keymap.set("x", "<leader>pp", "\"_dP")
+
+--copying to system clipboard : asbjornHaland
+vim.keymap.set("n", "<leader>y", "\"+y")
+vim.keymap.set("v", "<leader>y", "\"+y")
+vim.keymap.set("n", "<leader>Y", "\"+Y")
+
+--deleting to void register : asbjornHaland
+vim.keymap.set("n", "<leader>d", "\"_d")
+vim.keymap.set("v", "<leader>d", "\"_d")
+
+--annex capital Q
+vim.keymap.set("n", "Q", "<nop>")
+
+--edit all instances of selected word in file
+vim.keymap.set("n", "<leader>s", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]])
+
diff --git a/.config/nvim/lua/chronoziel/set.lua b/.config/nvim/lua/chronoziel/set.lua
new file mode 100644
index 0000000..b42c4a8
--- /dev/null
+++ b/.config/nvim/lua/chronoziel/set.lua
@@ -0,0 +1,41 @@
+
+--changes the directory for cmd to the directory in netrw
+vim.g.netrw_keepdir = 0
+
+--allows clipboard to work
+vim.opt.clipboard = "unnamedplus"
+
+--primeagen keys
+vim.opt.nu = true
+vim.opt.relativenumber = true
+
+vim.opt.tabstop = 4
+vim.opt.softtabstop = 4
+vim.opt.shiftwidth = 4
+vim.opt.expandtab = true
+
+vim.opt.smartindent = true
+
+vim.opt.wrap = false
+vim.opt.linebreak = true
+
+vim.opt.swapfile = false
+vim.opt.backup = false
+vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir"
+vim.opt.undofile = true
+
+vim.opt.hlsearch = false
+vim.opt.incsearch = true
+
+vim.opt.termguicolors = true
+
+vim.opt.scrolloff = 8
+vim.opt.signcolumn = "yes"
+vim.opt.isfname:append("@-@")
+
+vim.opt.updatetime = 50
+
+vim.opt.colorcolumn = "100"
+
+vim.g.mapleader = " "
+