commit aa07c202cb577f7381f5107c4faa0490b559cdd6 Author: theonepath Date: Thu Apr 20 13:51:47 2023 +0100 Added init.lua diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..dd59fda --- /dev/null +++ b/init.lua @@ -0,0 +1,54 @@ +-- Plugins for Nevim via Packer +require('plugins') + +-- Instantiate the gruvbox theme via native vimscript +-- Note: this always comes before anything, or the theme breaks +vim.cmd([[ + set termguicolors + let g:gruvbox_italic=1 + colorscheme gruvbox + set cursorline + set cursorcolumn + set number + set spell + set textwidth=120 sw=4 ts=4 et colorcolumn=120 + highlight ColorColumn ctermbg=0 + set splitbelow splitright +]]) + +-- import the ability to reload and restart Neovim without closing (Experimental) +vim.cmd([[ + command! Reload lua require("reload").Reload() + command! Restart lua require("reload").Restart() +]]) + +-- Custom extension presser (WIP) +local presser = require'presser' +presser.setup( { } ) + +-- Custom keybindings using the util `map` function +local map = require("utils").map +local opts = { silent=true } + +vim.g.mapleader = 'e' -- leader for Edit Mode functions +--- Mappings for Edit Mode --- +map("v", "h", ":s//") -- visual selection replace with last buffer item +map("n", "g", "Telescope live_grep", opts) -- Telescope live grep search +map("n", "o", "Telescope file_browser", opts) -- Open Telescope to grab new file + +vim.g.mapleader = 'f' -- leader for File Mode functions +--- Mappings for File Mode --- +--map("n", "o", "Telescope file_browser", opts) -- Telescope file browser +map("ni", "T", "tabnew | Telescope file_browser", opts) -- Open a new tab buffer +map("ni", "v", "v | Telescope file_browserA", opts) -- Open a new verticle split +map("ni", "s", "s | Telescope file_browserA", opts) -- Open a new horizontal split + +vim.g.mapleader = 't' -- leader for Terminal Mode functions +--- Mappings for Terminal Mode --- +map("n", "vr", ":vert res 80") -- change verticle size of focused window to x (Default: x = 80) +map("n", "hr", ":horizontal res ") -- change horizontal size of focused window to x (No default) + + +--- Import custom configurations --- +require('custom_configs.lspconfig') -- nvim-lspconfig +require('custom_configs.telescope') -- telescope