feature/DOTF-17 (#30)
Reviewed-on: #30 Co-authored-by: Ethan Lane <ethan@vylpes.com> Co-committed-by: Ethan Lane <ethan@vylpes.com>
This commit is contained in:
parent
5136097447
commit
22d13ffafa
12 changed files with 322 additions and 102 deletions
36
.config/nvim/lua/configs.lua
Normal file
36
.config/nvim/lua/configs.lua
Normal file
|
@ -0,0 +1,36 @@
|
|||
-- Imports
|
||||
local U = require("utils")
|
||||
|
||||
-- Neovim Alias
|
||||
local exec = vim.api.nvim_exec -- execute Vimscript
|
||||
local api = vim.api -- neovim commands
|
||||
local autocmd = vim.api.nvim_create_autocmd -- execute autocommands
|
||||
local set = vim.opt -- global options
|
||||
local cmd = vim.cmd -- execute Vim commands
|
||||
|
||||
-- Configs
|
||||
vim.g.mapleader = " "
|
||||
|
||||
set.compatible = false
|
||||
set.showmatch = true
|
||||
set.ignorecase = true
|
||||
set.mouse = "v"
|
||||
set.hlsearch = true
|
||||
set.incsearch = true
|
||||
set.tabstop = 4
|
||||
set.softtabstop = 4
|
||||
set.expandtab = true
|
||||
set.shiftwidth = 4
|
||||
set.autoindent = true
|
||||
set.number = true
|
||||
set.relativenumber = true
|
||||
set.wildmode = "longest,list"
|
||||
set.cc = "80"
|
||||
set.mouse = "a"
|
||||
set.clipboard = "unnamedplus"
|
||||
set.cursorline = true
|
||||
set.ttyfast = true
|
||||
set.fixeol = false
|
||||
set.splitright = true
|
||||
set.splitbelow = true
|
||||
set.termguicolors = true
|
0
.config/nvim/lua/functions.lua
Normal file
0
.config/nvim/lua/functions.lua
Normal file
0
.config/nvim/lua/functions/.gitkeep
Normal file
0
.config/nvim/lua/functions/.gitkeep
Normal file
63
.config/nvim/lua/keybindings.lua
Normal file
63
.config/nvim/lua/keybindings.lua
Normal file
|
@ -0,0 +1,63 @@
|
|||
-- Helper function
|
||||
function map(mode, lhs, rhs, opts)
|
||||
local options = { noremap = true }
|
||||
if opts then
|
||||
options = vim.tbl_extend("force", options, opts)
|
||||
end
|
||||
vim.keymap.set(mode, lhs, rhs, options)
|
||||
end
|
||||
|
||||
local opts = { silent = true, noremap = true }
|
||||
local optsExpr = { silent = true, noremap = true, expr = true }
|
||||
|
||||
-- Move Lines Up/Down
|
||||
map("i", "<A-j>", "<Esc>:m .+1<CR>==gi", opts)
|
||||
map("i", "<A-k>", "<Esc>:m .-2<CR>==gi", opts)
|
||||
map("v", "<A-j>", ":m '>+1<CR>gv=gv", opts)
|
||||
map("v", "<A-k>", ":m '<-2<CR>gv=gv", opts)
|
||||
|
||||
-- Move Splits
|
||||
map("n", "<A-h>", "<C-W>H", opts)
|
||||
map("n", "<A-j>", "<C-W>J", opts)
|
||||
map("n", "<A-k>", "<C-W>K", opts)
|
||||
map("n", "<A-l>", "<C-W>L", opts)
|
||||
|
||||
-- Navigate Splits
|
||||
map("n", "<C-h>", "<C-w>h", opts)
|
||||
map("n", "<C-j>", "<C-w>j", opts)
|
||||
map("n", "<C-k>", "<C-w>k", opts)
|
||||
map("n", "<C-l>", "<C-w>l", opts)
|
||||
|
||||
-- Coc
|
||||
map("i", "<cr>", [[coc#pum#visible() ? coc#_select_confirm() : "\<C-g>u\<CR>"]], optsExpr)
|
||||
map("i", "<Tab>", [[coc#pum#visible() ? coc#pum#next(1) : "\<Tab>"]], optsExpr)
|
||||
map("i", "<S-Tab>", [[coc#pum#visible() ? coc#pum#prev(1) : "\<S-Tab>"]], optsExpr)
|
||||
|
||||
-- NerdTree
|
||||
map("n", "<leader>n", ":NERDTreeFocus<CR>", opts)
|
||||
map("n", "<C-n>", ":NERDTree<CR>", opts)
|
||||
map("n", "<C-t>", ":NERDTreeToggle<CR>", opts)
|
||||
map("n", "<C-f>", ":NERDTreeFind<CR>", opts)
|
||||
|
||||
-- Harpoon
|
||||
map("n", "<leader>ha", [[<cmd>lua require("harpoon.mark").add_file()<CR>]], opts)
|
||||
map("n", "<leader>hh", [[<cmd>lua require("harpoon.ui").toggle_quick_menu()<CR>]], opts)
|
||||
map("n", "<leader>1", [[<cmd>lua require("harpoon.ui").nav_file(1)<CR>]], opts)
|
||||
map("n", "<leader>2", [[<cmd>lua require("harpoon.ui").nav_file(2)<CR>]], opts)
|
||||
map("n", "<leader>3", [[<cmd>lua require("harpoon.ui").nav_file(3)<CR>]], opts)
|
||||
map("n", "<leader>4", [[<cmd>lua require("harpoon.ui").nav_file(4)<CR>]], opts)
|
||||
map("n", "<A-[>", [[<cmd>lua require("harpoon.ui").nav_prev()<CR>]], opts)
|
||||
map("n", "<A-]>", [[<cmd>lua require("harpoon.ui").nav_next()<CR>]], opts)
|
||||
|
||||
-- FZF: Files
|
||||
map("n", "<leader>ff", [[<Cmd>lua require"fzf-lua".files()<CR>]], opts)
|
||||
map("n", "<leader>fg", [[<Cmd>lua require"fzf-lua".grep()<CR>]], opts)
|
||||
|
||||
-- FZF: Git
|
||||
map("n", "<leader>gs", [[<Cmd>lua require"fzf-lua".git_status()<CR>]], opts)
|
||||
map("n", "<leader>gd", [[<Cmd>lua require"fzf-lua".git_diff()<CR>]], opts)
|
||||
map("n", "<leader>gb", [[<Cmd>lua require"fzf-lua".git_branches()<CR>]], opts)
|
||||
map("n", "<leader>gc", [[<Cmd>lua require"fzf-lua".git_commits()<CR>]], opts)
|
||||
|
||||
-- General
|
||||
map("n", "mm", ":nohl<CR>", opts)
|
40
.config/nvim/lua/plugins.lua
Normal file
40
.config/nvim/lua/plugins.lua
Normal file
|
@ -0,0 +1,40 @@
|
|||
local install_path = vim.fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim"
|
||||
if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
|
||||
packer_bootstrap =
|
||||
vim.fn.system({"git", "clone", "--depth", "1", "https://github.com/wbthomason/packer.nvim", install_path})
|
||||
end
|
||||
-- Register Packer with vim
|
||||
vim.api.nvim_cmd({
|
||||
cmd = "packadd",
|
||||
args = {"packer.nvim"},
|
||||
}, {})
|
||||
|
||||
return require("packer").startup {
|
||||
function(use)
|
||||
-- Packer can manage itself
|
||||
use "wbthomason/packer.nvim"
|
||||
|
||||
-- Plugins go here
|
||||
use 'dracula/vim'
|
||||
use 'ryanoasis/vim-devicons'
|
||||
-- use 'SirVer/ultisnips'
|
||||
use 'honza/vim-snippets'
|
||||
use 'scrooloose/nerdtree'
|
||||
use 'preservim/nerdcommenter'
|
||||
use 'mhinz/vim-startify'
|
||||
use {'neoclide/coc.nvim', branch = 'release'}
|
||||
use 'nvim-lua/plenary.nvim'
|
||||
use 'ThePrimeagen/harpoon'
|
||||
use 'ibhagwan/fzf-lua'
|
||||
use 'neovim/nvim-lspconfig'
|
||||
use 'jose-elias-alvarez/null-ls.nvim'
|
||||
use 'MunifTanjim/prettier.nvim'
|
||||
use 'OmniSharp/omnisharp-vim'
|
||||
|
||||
-- Install and compile Plugins
|
||||
if packer_bootstrap then
|
||||
require("packer").sync()
|
||||
end
|
||||
end
|
||||
}
|
||||
|
0
.config/nvim/lua/plugins/.gitkeep
Normal file
0
.config/nvim/lua/plugins/.gitkeep
Normal file
0
.config/nvim/lua/utils.lua
Normal file
0
.config/nvim/lua/utils.lua
Normal file
Loading…
Add table
Add a link
Reference in a new issue