summaryrefslogtreecommitdiffstats
path: root/nvim-primeagen/lua/lemon
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2023-08-13 08:44:49 +0100
committerMatthew Lemon <y@yulqen.org>2023-08-13 08:44:49 +0100
commitc1d6bc6b4fd5208c7f3df0694f7aab501943981b (patch)
treeac34ead54ba6682a5c2e0d1a1f569346c76e9c90 /nvim-primeagen/lua/lemon
parent39c92fea8b9e96b2756d94b285dae8cfb015d68f (diff)
Adds primeagen neovim configuration
Diffstat (limited to 'nvim-primeagen/lua/lemon')
-rw-r--r--nvim-primeagen/lua/lemon/init.lua7
-rw-r--r--nvim-primeagen/lua/lemon/packer.lua108
-rw-r--r--nvim-primeagen/lua/lemon/popup.lua58
-rw-r--r--nvim-primeagen/lua/lemon/remap.lua45
-rw-r--r--nvim-primeagen/lua/lemon/set.lua44
5 files changed, 262 insertions, 0 deletions
diff --git a/nvim-primeagen/lua/lemon/init.lua b/nvim-primeagen/lua/lemon/init.lua
new file mode 100644
index 0000000..e2266b2
--- /dev/null
+++ b/nvim-primeagen/lua/lemon/init.lua
@@ -0,0 +1,7 @@
+require("lemon.set")
+require("lemon.remap")
+require("lemon.packer")
+
+vim.g.netrw_browse_split = 0
+vim.g.netrw_banner = 0
+vim.g.netrw_winsize = 25
diff --git a/nvim-primeagen/lua/lemon/packer.lua b/nvim-primeagen/lua/lemon/packer.lua
new file mode 100644
index 0000000..83da426
--- /dev/null
+++ b/nvim-primeagen/lua/lemon/packer.lua
@@ -0,0 +1,108 @@
+-- This file can be loaded by calling `lua require('plugins')` from your init.vim
+
+-- Only required if you have packer configured as `opt`
+--vim.cmd.packadd('packer.nvim')
+
+local ensure_packer = function()
+ local fn = vim.fn
+ local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim'
+ if fn.empty(fn.glob(install_path)) > 0 then
+ fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path})
+ vim.cmd [[packadd packer.nvim]]
+ return true
+ end
+ return false
+end
+
+local packer_bootstrap = ensure_packer()
+
+return require('packer').startup(function(use)
+ -- Packer can manage itself
+ use 'wbthomason/packer.nvim'
+ use 'dense-analysis/ale'
+ use {
+ 'arnarg/todotxt.nvim',
+ requires = {'MunifTanjim/nui.nvim'},
+ }
+ use("theprimeagen/harpoon")
+ use {
+ 'nvim-telescope/telescope.nvim', tag = '0.1.0',
+ -- or , branch = '0.1.x',
+ requires = { {'nvim-lua/plenary.nvim'} }
+ }
+ use('xiyaowong/telescope-emoji.nvim')
+
+ use({
+ 'rose-pine/neovim',
+ as = 'rose-pine',
+ config = function()
+ vim.cmd('colorscheme rose-pine')
+ end
+ })
+
+ use({
+ "folke/trouble.nvim",
+ config = function()
+ require("trouble").setup {
+ icons = false,
+ -- your configuration comes here
+ -- or leave it empty to use the default settings
+ -- refer to the configuration section below
+ }
+ end
+ })
+
+
+ use({"nvim-treesitter/nvim-treesitter", run = ":TSUpdate"})
+ use("nvim-treesitter/playground")
+ use("mbbill/undotree")
+ use("ledger/vim-ledger")
+ use("tpope/vim-fugitive")
+ use("tpope/vim-commentary")
+ use("nvim-treesitter/nvim-treesitter-context");
+ use('mfussenegger/nvim-dap')
+
+ use {
+ 'VonHeikemen/lsp-zero.nvim',
+ branch = 'v1.x',
+ requires = {
+ -- LSP Support
+ {'neovim/nvim-lspconfig'},
+ {'williamboman/mason.nvim'},
+ {'williamboman/mason-lspconfig.nvim'},
+
+ -- Autocompletion
+ {'hrsh7th/nvim-cmp'},
+ {'hrsh7th/cmp-buffer'},
+ {'hrsh7th/cmp-path'},
+ {'hrsh7th/cmp-cmdline'},
+ {'saadparwaiz1/cmp_luasnip'},
+ {'hrsh7th/cmp-nvim-lsp'},
+ {'hrsh7th/cmp-nvim-lua'},
+
+ -- Snippets
+ {'L3MON4D3/LuaSnip'},
+ {'rafamadriz/friendly-snippets'},
+ }
+ }
+
+ use("folke/zen-mode.nvim")
+ -- use("github/copilot.vim")
+ use("eandrju/cellular-automaton.nvim")
+ -- use("laytan/cloak.nvim")
+ use("jlanzarotta/bufexplorer")
+ use("mhinz/vim-signify")
+ use {
+ "nvim-neotest/neotest",
+ requires = {
+ "nvim-neotest/neotest-python",
+ "nvim-neotest/neotest-plenary",
+ "folke/neodev.nvim",
+ "nvim-lua/plenary.nvim",
+ "nvim-treesitter/nvim-treesitter",
+ "antoinemadec/FixCursorHold.nvim"
+ }
+ }
+
+end)
+
diff --git a/nvim-primeagen/lua/lemon/popup.lua b/nvim-primeagen/lua/lemon/popup.lua
new file mode 100644
index 0000000..b070603
--- /dev/null
+++ b/nvim-primeagen/lua/lemon/popup.lua
@@ -0,0 +1,58 @@
+-- Lemon_win_id = nil
+-- Lemon_bufh = nil
+
+-- local function close_menu(force_save)
+-- force_save = force_save or false
+
+-- vim.api.nvim_win_close(Lemon_win_id, true)
+
+-- Lemon_win_id = nil
+-- Lemon_bufh = nil
+-- end
+
+-- local function create_window()
+-- local popup = require("plenary.popup")
+-- local height = 10
+-- local width = 60
+-- local borderchars = { "─", "│", "─", "│", "╭", "╮", "╯", "╰" }
+-- local bufnr = vim.api.nvim_create_buf(false, true)
+-- local Lemon_id, win = popup.create(bufnr, {
+-- title = "Mesmeric!",
+-- line = math.floor(((vim.o.lines - height) / 2) -1),
+-- col = math.floor((vim.o.columns - width) / 2),
+-- minwidth = width,
+-- mineheight = height,
+-- borderchars = borderchars,
+-- })
+-- return {
+-- bufnr = bufnr,
+-- win_id = Lemon_win_id
+-- }
+-- end
+
+-- create_window()
+
+-- Create a new buffer and set its lines to the contents of myfile.txt
+local buf = vim.api.nvim_create_buf(false, true)
+local file = io.open('/home/lemon/Documents/Notes/Archive/Dr Haugh.md', 'r')
+local height = 10
+local width = 60
+local lines = {}
+for line in file:lines() do
+ table.insert(lines, line)
+end
+file:close()
+vim.api.nvim_buf_set_lines(buf, 0, -1, true, lines)
+
+-- Create a new window and set its options to create a floating buffer
+local win = vim.api.nvim_open_win(buf, true, {
+ relative='editor',
+ width=80,
+ title = "test title",
+ title_pos = "center",
+ height=10,
+ row=10,
+ col=10,
+ border={"╭", "─", "╮", "│", "╯", "─", "╰", "│" },
+})
+
diff --git a/nvim-primeagen/lua/lemon/remap.lua b/nvim-primeagen/lua/lemon/remap.lua
new file mode 100644
index 0000000..0d2f247
--- /dev/null
+++ b/nvim-primeagen/lua/lemon/remap.lua
@@ -0,0 +1,45 @@
+-- ThePrimeagent's stuff
+vim.g.mapleader = " "
+vim.keymap.set("n", "<leader>pv", vim.cmd.Ex)
+
+vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv")
+vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv")
+
+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
+vim.keymap.set("x", "<leader>p", [["_dP]])
+
+-- next greatest remap ever : asbjornHaland
+vim.keymap.set({"n", "v"}, "<leader>y", [["+y]])
+vim.keymap.set("n", "<leader>Y", [["+Y]])
+
+vim.keymap.set({"n", "v"}, "<leader>d", [["_d]])
+
+-- This is going to get me cancelled
+vim.keymap.set("i", "<C-c>", "<Esc>")
+
+vim.keymap.set("n", "Q", "<nop>")
+--vim.keymap.set("n", "<C-f>", "<cmd>silent !tmux neww tmux-sessionizer<CR>")
+-- vim.keymap.set("n", "<leader>f", vim.lsp.buf.format)
+
+vim.keymap.set("n", "<C-k>", "<cmd>cnext<CR>zz")
+vim.keymap.set("n", "<C-j>", "<cmd>cprev<CR>zz")
+vim.keymap.set("n", "<leader>k", "<cmd>lnext<CR>zz")
+vim.keymap.set("n", "<leader>j", "<cmd>lprev<CR>zz")
+
+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 })
+
+vim.keymap.set("n", "<leader>ev", "<cmd>e ~/dotfiles/nvim/lua/lemon/packer.lua<CR>");
+vim.keymap.set("n", "<leader>mr", "<cmd>CellularAutomaton make_it_rain<CR>");
+
+vim.keymap.set("n", "<leader><leader>", function()
+ vim.cmd("so")
+end)
+-- end ThePrimeagent's stuff
+
diff --git a/nvim-primeagen/lua/lemon/set.lua b/nvim-primeagen/lua/lemon/set.lua
new file mode 100644
index 0000000..3c662a9
--- /dev/null
+++ b/nvim-primeagen/lua/lemon/set.lua
@@ -0,0 +1,44 @@
+vim.opt.guicursor = ""
+
+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.autoindent = true
+
+vim.opt.smartindent = true
+
+vim.opt.wrap = false
+
+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 = ""
+
+-- end ThePrimeagen stuff
+
+vim.opt.wildmenu = true
+vim.opt.showmatch = true
+vim.opt.splitbelow = true
+vim.opt.splitright = true
+vim.opt.hidden = true
+vim.opt.path = "+=**"
+vim.opt.more = true
+vim.opt.equalalways = true
+vim.opt.listchars="tab:»→,trail:␣"