theonepath.nvim/init.lua
2023-04-20 13:51:47 +01:00

55 lines
2.1 KiB
Lua

-- 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", "<Leader>h", ":s//") -- visual selection replace with last buffer item
map("n", "<Leader>g", "<Cmd>Telescope live_grep<CR>", opts) -- Telescope live grep search
map("n", "<Leader>o", "<Cmd>Telescope file_browser<CR>", opts) -- Open Telescope to grab new file
vim.g.mapleader = 'f' -- leader for File Mode functions
--- Mappings for File Mode ---
--map("n", "<Leader>o", "<Cmd>Telescope file_browser<CR>", opts) -- Telescope file browser
map("ni", "<C-w>T", "<Esc><Cmd>tabnew<CR> | <Cmd>Telescope file_browser<CR>", opts) -- Open a new tab buffer
map("ni", "<C-w>v", "<Esc><C-w>v<CR> | <Cmd>Telescope file_browser<CR>A", opts) -- Open a new verticle split
map("ni", "<C-w>s", "<Esc><C-w>s<CR> | <Cmd>Telescope file_browser<CR>A", opts) -- Open a new horizontal split
vim.g.mapleader = 't' -- leader for Terminal Mode functions
--- Mappings for Terminal Mode ---
map("n", "<Leader>vr", ":vert res 80") -- change verticle size of focused window to x (Default: x = 80)
map("n", "<Leader>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