first commit

This commit is contained in:
test 2024-03-24 16:06:51 -04:00
commit 82fa562c79
6 changed files with 152 additions and 0 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
plugin/
plugin/*
plugin/packer_compiled.lua

1
init.lua Normal file
View File

@ -0,0 +1 @@
require("locker98")

2
lua/locker98/init.lua Normal file
View File

@ -0,0 +1,2 @@
require("locker98.remap")
require("locker98.set")

50
lua/locker98/packer.lua Normal file
View File

@ -0,0 +1,50 @@
-- 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]]
return require('packer').startup(function(use)
-- Packer can manage itself
use 'wbthomason/packer.nvim'
use {
'nvim-telescope/telescope.nvim', branch = '0.1.x',
requires = { {'nvim-lua/plenary.nvim'} }
}
use('nvim-treesitter/nvim-treesitter', {run = 'TSUpdate'})
use({
'rose-pine/neovim',
as = 'rose-pine',
config = function()
vim.cmd('colorscheme rose-pine')
end
})
use('nvim-treesitter/playground')
use('mbbill/undotree')
use('theprimeagen/harpoon')
use("David-Kunz/gen.nvim")
use('tpope/vim-fugitive')
use {
'VonHeikemen/lsp-zero.nvim',
branch = 'v3.x',
requires = {
--- Uncomment the two plugins below if you want to manage the language servers from neovim
{'williamboman/mason.nvim'},
{'williamboman/mason-lspconfig.nvim'},
-- LSP Support
{'neovim/nvim-lspconfig'},
-- Autocompletion
{'hrsh7th/nvim-cmp'},
{'hrsh7th/cmp-nvim-lsp'},
{'L3MON4D3/LuaSnip'},
-- Other
{'hrsh7th/cmp-buffer'},
{'hrsh7th/cmp-path'},
{'hrsh7th/cmp-nvim-lua'},
{'saadparwaiz1/cmp_luasnip'},
{'saadparwaiz1/cmp_luasnip'}
}
}
end)

49
lua/locker98/remap.lua Normal file
View File

@ -0,0 +1,49 @@
-- add leader key
vim.g.mapleader = " "
-- this give me a shortcut to file manager
vim.keymap.set("n", "<leader>pv", vim.cmd.Ex)
-- this allows me to move entyer code blocks up and down
vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv")
vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv")
-- append the line below to the end of the current line
vim.keymap.set("n", "J", "mxJ`x")
-- jump up and down half a page at a time
vim.keymap.set("n", "<C-d>", "<C-d>zz")
vim.keymap.set("n", "<C-u>", "<C-u>zz")
-- forces search terms to stay in the middle
vim.keymap.set("n", "n", "nzzzv")
vim.keymap.set("n", "N", "Nzzzv")
-- remaps jj to Escape
vim.keymap.set('i', "jj", "<Esc>")
-- allows you to paste over without over writing current buffer
vim.keymap.set("x", "<leader>p", "\"_dP")
-- yank to system clipboard
vim.keymap.set("n", "<leader>y", "\"+y")
vim.keymap.set("n", "<leader>Y", "\"+Y")
-- delete to null buffer
vim.keymap.set({"n", "v"}, "<leader>d", "\"_d")
-- quick fix
vim.keymap.set("n", "<C-k>", "<cmd>cnext<CR>zz")
vim.keymap.set("n", "<C-j>", "<cmd>cprev<tCR>zz")
vim.keymap.set("n", "<leader>k", "<cmd>lnext<CR>zz")
vim.keymap.set("n", "<leader>j", "<cmd>lprev<CR>zz")
-- quick find an replace on heighlighted word
vim.keymap.set("n", "<leader>s", ":%s/\\<<C-r><C-w>\\>/<C-r><C-w>/gI<Left><Left><Left>")
-- chmod -x current file
vim.keymap.set("n", "<leader>x", "<cmd>!chmod +x %<CR>", {silent = true})

47
lua/locker98/set.lua Normal file
View File

@ -0,0 +1,47 @@
-- add fat cursor to vim
-- vim.opt.guicursor = ""
-- add line numbers and make them relative
vim.opt.nu = true
vim.opt.relativenumber = true
-- fix indenting in vim and make indents 4 spaces
vim.opt.tabstop = 4
vim.opt.softtabstop = 4
vim.opt.shiftwidth = 4
vim.opt.expandtab = true
-- enable smart indenting
vim.opt.smartindent = true
-- disable word wrap
vim.opt.wrap = false
-- disable backup and add long for undo file
vim.opt.swapfile = false
vim.opt.backup = false
vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir"
vim.opt.undofile = true
-- remove perminate search highliting and add incrementall search
vim.opt.hlsearch = false
vim.opt.incsearch = true
-- make sure we get all terminal color goodness
vim.opt.termguicolors = true
-- add minimum view for scrolling so when you scroll in a file their is always at least 8 lines of code viewable
vim.opt.scrolloff = 8
vim.opt.signcolumn = "yes"
vim.opt.isfname:append("@-@")
-- set refresh rate to 50 times
vim.opt.updatetime = 50
-- adds color column
vim.opt.colorcolumn = "80"