summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlouie <louie@example.com>2022-06-22 20:12:42 -0700
committerlouie <louie@example.com>2022-06-22 20:12:42 -0700
commit95bce4610af5ccc7cee4d68633ce6b7af5fe342b (patch)
treeb3383113afbc2732b4269cb1c26903c752a73184
First commit
-rw-r--r--init.lua3
-rw-r--r--lua/user/keymaps.lua83
-rw-r--r--lua/user/options.lua29
-rw-r--r--lua/user/plugins.lua13
-rw-r--r--old_0.4.4/.netrwhist4
-rw-r--r--old_0.4.4/after/ftplugin/c.vim1
-rw-r--r--old_0.4.4/after/ftplugin/cpp.vim1
-rw-r--r--old_0.4.4/after/ftplugin/scm.vim3
-rw-r--r--old_0.4.4/init.vim37
9 files changed, 174 insertions, 0 deletions
diff --git a/init.lua b/init.lua
new file mode 100644
index 0000000..ad27a7f
--- /dev/null
+++ b/init.lua
@@ -0,0 +1,3 @@
+require "user.options"
+require "user.keymaps"
+require "user.plugins"
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("", "<Space>", "<Nop>", 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", "<C-h>", "<C-w>h", opts)
+keymap("n", "<C-j>", "<C-w>j", opts)
+keymap("n", "<C-k>", "<C-w>k", opts)
+keymap("n", "<C-l>", "<C-w>l", opts)
+keymap("n", "<C-Left>", "<C-w>h", opts)
+keymap("n", "<C-Down>", "<C-w>j", opts)
+keymap("n", "<C-Up>", "<C-w>k", opts)
+keymap("n", "<C-Right>", "<C-w>l", opts)
+
+-- Better tab navigation (both hjkl and arrow keys)
+keymap("n", "<S-h>", "gT", opts)
+keymap("n", "<S-l>", "gt", opts)
+keymap("n", "<S-Left>", "gT", opts)
+keymap("n", "<S-Right>", "gt", opts)
+
+-- Open Lexplorer
+--keymap("n", "<leader>e", ":Lex 30<cr>", opts)
+
+-- Resize with ctrl+shift+arrows
+keymap("n", "<C-S-Up>", ":resize -2<CR>", opts)
+keymap("n", "<C-S-Down>", ":resize +2<CR>", opts)
+keymap("n", "<C-S-Left>", ":vertical resize -2<CR>", opts)
+keymap("n", "<C-S-Right>", ":vertical resize +2<CR>", opts)
+
+--[[
+-- Navigate buffers
+keymap("n", "<S-l>", ":bnext<CR>", opts)
+keymap("n", "<S-h>", ":bprevious<CR>", opts)
+
+-- Move text up and down
+keymap("n", "<A-j>", "<Esc>:m .+1<CR>==gi", opts)
+keymap("n", "<A-k>", "<Esc>:m .-2<CR>==gi", opts)
+
+-- Insert --
+-- Press jk fast to enter
+keymap("i", "jk", "<ESC>", opts)
+
+-- Visual --
+-- Stay in indent mode
+keymap("v", "<", "<gv", opts)
+keymap("v", ">", ">gv", opts)
+
+-- Move text up and down
+keymap("v", "<A-j>", ":m .+1<CR>==", opts)
+keymap("v", "<A-k>", ":m .-2<CR>==", opts)
+keymap("v", "p", '"_dP', opts)
+
+-- Visual Block --
+-- Move text up and down
+keymap("x", "J", ":move '>+1<CR>gv-gv", opts)
+keymap("x", "K", ":move '<-2<CR>gv-gv", opts)
+keymap("x", "<A-j>", ":move '>+1<CR>gv-gv", opts)
+keymap("x", "<A-k>", ":move '<-2<CR>gv-gv", opts)
+
+-- Terminal --
+-- Better terminal navigation
+keymap("t", "<C-h>", "<C-\\><C-N><C-w>h", term_opts)
+keymap("t", "<C-j>", "<C-\\><C-N><C-w>j", term_opts)
+keymap("t", "<C-k>", "<C-\\><C-N><C-w>k", term_opts)
+keymap("t", "<C-l>", "<C-\\><C-N><C-w>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)
diff --git a/old_0.4.4/.netrwhist b/old_0.4.4/.netrwhist
new file mode 100644
index 0000000..d3d3113
--- /dev/null
+++ b/old_0.4.4/.netrwhist
@@ -0,0 +1,4 @@
+let g:netrw_dirhistmax =10
+let g:netrw_dirhistcnt =2
+let g:netrw_dirhist_2='/home/louie/Documents/scripts/backup_scripts'
+let g:netrw_dirhist_1='/home/louie/Documents/scripts'
diff --git a/old_0.4.4/after/ftplugin/c.vim b/old_0.4.4/after/ftplugin/c.vim
new file mode 100644
index 0000000..08a344a
--- /dev/null
+++ b/old_0.4.4/after/ftplugin/c.vim
@@ -0,0 +1 @@
+setlocal formatoptions-=c formatoptions-=r formatoptions-=o
diff --git a/old_0.4.4/after/ftplugin/cpp.vim b/old_0.4.4/after/ftplugin/cpp.vim
new file mode 100644
index 0000000..08a344a
--- /dev/null
+++ b/old_0.4.4/after/ftplugin/cpp.vim
@@ -0,0 +1 @@
+setlocal formatoptions-=c formatoptions-=r formatoptions-=o
diff --git a/old_0.4.4/after/ftplugin/scm.vim b/old_0.4.4/after/ftplugin/scm.vim
new file mode 100644
index 0000000..e8a356b
--- /dev/null
+++ b/old_0.4.4/after/ftplugin/scm.vim
@@ -0,0 +1,3 @@
+set expandtab
+set shiftwidth=4
+set softtabstop=4
diff --git a/old_0.4.4/init.vim b/old_0.4.4/init.vim
new file mode 100644
index 0000000..b1e7211
--- /dev/null
+++ b/old_0.4.4/init.vim
@@ -0,0 +1,37 @@
+syntax on
+colorscheme slate
+
+set hlsearch
+set number
+set shiftwidth=4
+set smartindent
+set tabstop=4
+
+set foldmethod=indent
+set foldlevelstart=20
+
+"Pmenu Settings (Popup Menu)
+highlight Pmenu ctermbg=White ctermfg=Black guibg=Gray
+
+
+"" Plugins
+"call plug#begin("~/.local/share/nvim/plugged")
+"
+"Plug 'neoclide/coc.nvim', {'branch': 'release'}
+"
+"call plug#end()
+"
+"" Settings for coc
+"
+"" Use K to show documentation in preview window.
+"nnoremap <silent> K :call <SID>show_documentation()<CR>
+"
+"function! s:show_documentation()
+" if (index(['vim','help'], &filetype) >= 0)
+" execute 'h '.expand('<cword>')
+" elseif (coc#rpc#ready())
+" call CocActionAsync('doHover')
+" else
+" execute '!' . &keywordprg . " " . expand('<cword>')
+" endif
+"endfunction