From 95bce4610af5ccc7cee4d68633ce6b7af5fe342b Mon Sep 17 00:00:00 2001 From: louie Date: Wed, 22 Jun 2022 20:12:42 -0700 Subject: First commit --- lua/user/keymaps.lua | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++++ lua/user/options.lua | 29 ++++++++++++++++++ lua/user/plugins.lua | 13 ++++++++ 3 files changed, 125 insertions(+) create mode 100644 lua/user/keymaps.lua create mode 100644 lua/user/options.lua create mode 100644 lua/user/plugins.lua (limited to 'lua/user') diff --git a/lua/user/keymaps.lua b/lua/user/keymaps.lua new file mode 100644 index 0000000..26fb9f7 --- /dev/null +++ b/lua/user/keymaps.lua @@ -0,0 +1,83 @@ +local opts = { noremap = true, silent = true } + +local term_opts = { silent = true } + +-- Shorten function name +local keymap = vim.api.nvim_set_keymap + +--Remap space as leader key +keymap("", "", "", opts) +vim.g.mapleader = " " +vim.g.maplocalleader = " " + +-- Modes +-- normal_mode = "n", +-- insert_mode = "i", +-- visual_mode = "v", +-- visual_block_mode = "x", +-- term_mode = "t", +-- command_mode = "c", + +-- Normal -- +-- Better window navigation (both hjkl and arrow keys) +keymap("n", "", "h", opts) +keymap("n", "", "j", opts) +keymap("n", "", "k", opts) +keymap("n", "", "l", opts) +keymap("n", "", "h", opts) +keymap("n", "", "j", opts) +keymap("n", "", "k", opts) +keymap("n", "", "l", opts) + +-- Better tab navigation (both hjkl and arrow keys) +keymap("n", "", "gT", opts) +keymap("n", "", "gt", opts) +keymap("n", "", "gT", opts) +keymap("n", "", "gt", opts) + +-- Open Lexplorer +--keymap("n", "e", ":Lex 30", opts) + +-- Resize with ctrl+shift+arrows +keymap("n", "", ":resize -2", opts) +keymap("n", "", ":resize +2", opts) +keymap("n", "", ":vertical resize -2", opts) +keymap("n", "", ":vertical resize +2", opts) + +--[[ +-- Navigate buffers +keymap("n", "", ":bnext", opts) +keymap("n", "", ":bprevious", opts) + +-- Move text up and down +keymap("n", "", ":m .+1==gi", opts) +keymap("n", "", ":m .-2==gi", opts) + +-- Insert -- +-- Press jk fast to enter +keymap("i", "jk", "", opts) + +-- Visual -- +-- Stay in indent mode +keymap("v", "<", "", ">gv", opts) + +-- Move text up and down +keymap("v", "", ":m .+1==", opts) +keymap("v", "", ":m .-2==", opts) +keymap("v", "p", '"_dP', opts) + +-- Visual Block -- +-- Move text up and down +keymap("x", "J", ":move '>+1gv-gv", opts) +keymap("x", "K", ":move '<-2gv-gv", opts) +keymap("x", "", ":move '>+1gv-gv", opts) +keymap("x", "", ":move '<-2gv-gv", opts) + +-- Terminal -- +-- Better terminal navigation +keymap("t", "", "h", term_opts) +keymap("t", "", "j", term_opts) +keymap("t", "", "k", term_opts) +keymap("t", "", "l", term_opts) +]] diff --git a/lua/user/options.lua b/lua/user/options.lua new file mode 100644 index 0000000..338d207 --- /dev/null +++ b/lua/user/options.lua @@ -0,0 +1,29 @@ +-- Syntax Highlighting Settings +vim.syntax = true --turn on syntax highlighting +vim.cmd("colorscheme slate") --set colorscheme to slate + +-- Misc. Settings +vim.opt.hlsearch = true --highlight search matches +vim.opt.number = true --number rows +vim.opt.shiftwidth = 4 --set shiftwidth +vim.opt.smartindent = true --auto-indent +vim.opt.tabstop = 4 --set tab length + +-- Fold Settings +vim.opt.foldmethod = "indent" --enable fold detection +vim.opt.foldlevelstart = 20 --set initial fold + +-- Color Settings [TODO] +--highlight Pmenu ctermbg=White ctermfg=Black guibg=Gray + +-- Additional Settings from Video Series +-- :help options +-- Autocomplete Settings +vim.opt.completeopt = { "menuone", "noselect" } -- show menu even if only one entry; do not auto-select from menu +vim.opt.signcolumn = "yes" -- always show the sign column, otherwise it would shift the text each time +vim.opt.shortmess:append "c" -- for autocompletion, don't give standard messages +-- Misc. Settings +vim.opt.conceallevel = 0 -- do not conceal text +vim.opt.fileencoding = "utf-8" -- the encoding written to a file +--vim.opt.pumheight = 10 -- pop up menu height +--vim.opt.termguicolors = true -- set term gui colors (most terminals support this) diff --git a/lua/user/plugins.lua b/lua/user/plugins.lua new file mode 100644 index 0000000..b491d35 --- /dev/null +++ b/lua/user/plugins.lua @@ -0,0 +1,13 @@ +-- Use a protected call so we don't error out on first use +local status_ok, packer = pcall(require, "packer") +if not status_ok then + return +end + +-- Install your plugins here +return packer.startup(function(use) + -- My plugins here + use "wbthomason/packer.nvim" -- Have packer manage itself + --use "nvim-lua/popup.nvim" -- An implementation of the Popup API from vim in Neovim + --use "nvim-lua/plenary.nvim" -- Useful lua functions used by lots of plugins +end) -- cgit