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
4
.config/nvim/after/plugin/colors.lua
Normal file
4
.config/nvim/after/plugin/colors.lua
Normal file
|
@ -0,0 +1,4 @@
|
|||
vim.cmd([[
|
||||
set termguicolors
|
||||
colorscheme dracula
|
||||
]])
|
4
.config/nvim/init.lua
Normal file
4
.config/nvim/init.lua
Normal file
|
@ -0,0 +1,4 @@
|
|||
require("configs")
|
||||
require("plugins")
|
||||
require("keybindings")
|
||||
require("functions")
|
|
@ -1,102 +0,0 @@
|
|||
let mapleader = " "
|
||||
let g:copilot_enabled = v:false
|
||||
|
||||
set nocompatible
|
||||
set showmatch
|
||||
set ignorecase
|
||||
set mouse=v
|
||||
set hlsearch
|
||||
set incsearch
|
||||
set tabstop=4
|
||||
set softtabstop=4
|
||||
set expandtab
|
||||
set shiftwidth=4
|
||||
set autoindent
|
||||
set number
|
||||
set relativenumber
|
||||
set wildmode=longest,list
|
||||
set cc=80
|
||||
filetype plugin indent on
|
||||
syntax on
|
||||
set mouse=a
|
||||
set clipboard=unnamedplus
|
||||
filetype plugin on
|
||||
set cursorline
|
||||
set ttyfast
|
||||
set nofixeol
|
||||
|
||||
let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim'
|
||||
if empty(glob(data_dir . '/autoload/plug.vim'))
|
||||
silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
|
||||
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
|
||||
endif
|
||||
|
||||
call plug#begin("~/.vim/plugged")
|
||||
Plug 'dracula/vim'
|
||||
Plug 'ryanoasis/vim-devicons'
|
||||
" Plug 'SirVer/ultisnips'
|
||||
Plug 'honza/vim-snippets'
|
||||
Plug 'scrooloose/nerdtree'
|
||||
Plug 'preservim/nerdcommenter'
|
||||
Plug 'mhinz/vim-startify'
|
||||
Plug 'neoclide/coc.nvim', {'branch': 'release'}
|
||||
Plug 'nvim-lua/plenary.nvim'
|
||||
Plug 'ThePrimeagen/harpoon'
|
||||
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
|
||||
Plug 'junegunn/fzf.vim'
|
||||
Plug 'neovim/nvim-lspconfig'
|
||||
Plug 'jose-elias-alvarez/null-ls.nvim'
|
||||
Plug 'MunifTanjim/prettier.nvim'
|
||||
Plug 'OmniSharp/omnisharp-vim'
|
||||
call plug#end()
|
||||
|
||||
if (has("termguicolors"))
|
||||
set termguicolors
|
||||
endif
|
||||
syntax enable
|
||||
colorscheme dracula
|
||||
|
||||
set splitright
|
||||
set splitbelow
|
||||
|
||||
inoremap <A-j> <Esc>:m .+1<CR>==gi
|
||||
inoremap <A-k> <Esc>:m .-2<CR>==gi
|
||||
vnoremap <A-j> :m '>+1<CR>gv=gv
|
||||
vnoremap <A-k> :m '<-2<CR>gv=gv
|
||||
|
||||
nnoremap <A-h> <C-W>H
|
||||
nnoremap <A-j> <C-W>J
|
||||
nnoremap <A-k> <C-W>K
|
||||
nnoremap <A-l> <C-W>L
|
||||
|
||||
nnoremap <C-h> <C-w>h
|
||||
nnoremap <C-j> <C-w>j
|
||||
nnoremap <C-k> <C-w>k
|
||||
nnoremap <C-l> <C-w>l
|
||||
|
||||
nnoremap gf :vert winc f<cr>
|
||||
|
||||
inoremap <silent><expr> <cr> coc#pum#visible() ? coc#_select_confirm() : "\<C-g>u\<CR>"
|
||||
inoremap <expr> <Tab> coc#pum#visible() ? coc#pum#next(1) : "\<Tab>"
|
||||
inoremap <expr> <S-Tab> coc#pum#visible() ? coc#pum#prev(1) : "\<S-Tab>"
|
||||
|
||||
nnoremap <leader>n :NERDTreeFocus<CR>
|
||||
nnoremap <C-n> :NERDTree<CR>
|
||||
nnoremap <C-t> :NERDTreeToggle<CR>
|
||||
nnoremap <C-f> :NERDTreeFind<CR>
|
||||
nnoremap <leader>ee :Ex<CR>
|
||||
|
||||
nnoremap <leader>ha <cmd>lua require("harpoon.mark").add_file()<CR>
|
||||
nnoremap <leader>hh <cmd>lua require("harpoon.ui").toggle_quick_menu()<CR>
|
||||
nnoremap <leader>1 <cmd>lua require("harpoon.ui").nav_file(1)<CR>
|
||||
nnoremap <leader>2 <cmd>lua require("harpoon.ui").nav_file(2)<CR>
|
||||
nnoremap <leader>3 <cmd>lua require("harpoon.ui").nav_file(3)<CR>
|
||||
nnoremap <leader>4 <cmd>lua require("harpoon.ui").nav_file(4)<CR>
|
||||
nnoremap <A-[> <cmd>lua require("harpoon.ui").nav_prev()<CR>
|
||||
nnoremap <A-]> <cmd>lua require("harpoon.ui").nav_next()<CR>
|
||||
|
||||
nnoremap <leader>ff :FZF<CR>
|
||||
|
||||
nnoremap mm :nohl<CR>
|
||||
nnoremap ml :%s/\r//g<CR>
|
||||
|
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
174
.config/nvim/plugin/packer_compiled.lua
Normal file
174
.config/nvim/plugin/packer_compiled.lua
Normal file
|
@ -0,0 +1,174 @@
|
|||
-- Automatically generated packer.nvim plugin loader code
|
||||
|
||||
if vim.api.nvim_call_function('has', {'nvim-0.5'}) ~= 1 then
|
||||
vim.api.nvim_command('echohl WarningMsg | echom "Invalid Neovim version for packer.nvim! | echohl None"')
|
||||
return
|
||||
end
|
||||
|
||||
vim.api.nvim_command('packadd packer.nvim')
|
||||
|
||||
local no_errors, error_msg = pcall(function()
|
||||
|
||||
_G._packer = _G._packer or {}
|
||||
_G._packer.inside_compile = true
|
||||
|
||||
local time
|
||||
local profile_info
|
||||
local should_profile = false
|
||||
if should_profile then
|
||||
local hrtime = vim.loop.hrtime
|
||||
profile_info = {}
|
||||
time = function(chunk, start)
|
||||
if start then
|
||||
profile_info[chunk] = hrtime()
|
||||
else
|
||||
profile_info[chunk] = (hrtime() - profile_info[chunk]) / 1e6
|
||||
end
|
||||
end
|
||||
else
|
||||
time = function(chunk, start) end
|
||||
end
|
||||
|
||||
local function save_profiles(threshold)
|
||||
local sorted_times = {}
|
||||
for chunk_name, time_taken in pairs(profile_info) do
|
||||
sorted_times[#sorted_times + 1] = {chunk_name, time_taken}
|
||||
end
|
||||
table.sort(sorted_times, function(a, b) return a[2] > b[2] end)
|
||||
local results = {}
|
||||
for i, elem in ipairs(sorted_times) do
|
||||
if not threshold or threshold and elem[2] > threshold then
|
||||
results[i] = elem[1] .. ' took ' .. elem[2] .. 'ms'
|
||||
end
|
||||
end
|
||||
if threshold then
|
||||
table.insert(results, '(Only showing plugins that took longer than ' .. threshold .. ' ms ' .. 'to load)')
|
||||
end
|
||||
|
||||
_G._packer.profile_output = results
|
||||
end
|
||||
|
||||
time([[Luarocks path setup]], true)
|
||||
local package_path_str = "/home/vylpes/.cache/nvim/packer_hererocks/2.1.1741730670/share/lua/5.1/?.lua;/home/vylpes/.cache/nvim/packer_hererocks/2.1.1741730670/share/lua/5.1/?/init.lua;/home/vylpes/.cache/nvim/packer_hererocks/2.1.1741730670/lib/luarocks/rocks-5.1/?.lua;/home/vylpes/.cache/nvim/packer_hererocks/2.1.1741730670/lib/luarocks/rocks-5.1/?/init.lua"
|
||||
local install_cpath_pattern = "/home/vylpes/.cache/nvim/packer_hererocks/2.1.1741730670/lib/lua/5.1/?.so"
|
||||
if not string.find(package.path, package_path_str, 1, true) then
|
||||
package.path = package.path .. ';' .. package_path_str
|
||||
end
|
||||
|
||||
if not string.find(package.cpath, install_cpath_pattern, 1, true) then
|
||||
package.cpath = package.cpath .. ';' .. install_cpath_pattern
|
||||
end
|
||||
|
||||
time([[Luarocks path setup]], false)
|
||||
time([[try_loadstring definition]], true)
|
||||
local function try_loadstring(s, component, name)
|
||||
local success, result = pcall(loadstring(s), name, _G.packer_plugins[name])
|
||||
if not success then
|
||||
vim.schedule(function()
|
||||
vim.api.nvim_notify('packer.nvim: Error running ' .. component .. ' for ' .. name .. ': ' .. result, vim.log.levels.ERROR, {})
|
||||
end)
|
||||
end
|
||||
return result
|
||||
end
|
||||
|
||||
time([[try_loadstring definition]], false)
|
||||
time([[Defining packer_plugins]], true)
|
||||
_G.packer_plugins = {
|
||||
["coc.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/home/vylpes/.local/share/nvim/site/pack/packer/start/coc.nvim",
|
||||
url = "https://github.com/neoclide/coc.nvim"
|
||||
},
|
||||
fzf = {
|
||||
loaded = true,
|
||||
path = "/home/vylpes/.local/share/nvim/site/pack/packer/start/fzf",
|
||||
url = "https://github.com/junegunn/fzf"
|
||||
},
|
||||
["fzf.vim"] = {
|
||||
loaded = true,
|
||||
path = "/home/vylpes/.local/share/nvim/site/pack/packer/start/fzf.vim",
|
||||
url = "https://github.com/junegunn/fzf.vim"
|
||||
},
|
||||
harpoon = {
|
||||
loaded = true,
|
||||
path = "/home/vylpes/.local/share/nvim/site/pack/packer/start/harpoon",
|
||||
url = "https://github.com/ThePrimeagen/harpoon"
|
||||
},
|
||||
nerdcommenter = {
|
||||
loaded = true,
|
||||
path = "/home/vylpes/.local/share/nvim/site/pack/packer/start/nerdcommenter",
|
||||
url = "https://github.com/preservim/nerdcommenter"
|
||||
},
|
||||
nerdtree = {
|
||||
loaded = true,
|
||||
path = "/home/vylpes/.local/share/nvim/site/pack/packer/start/nerdtree",
|
||||
url = "https://github.com/scrooloose/nerdtree"
|
||||
},
|
||||
["null-ls.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/home/vylpes/.local/share/nvim/site/pack/packer/start/null-ls.nvim",
|
||||
url = "https://github.com/jose-elias-alvarez/null-ls.nvim"
|
||||
},
|
||||
["nvim-lspconfig"] = {
|
||||
loaded = true,
|
||||
path = "/home/vylpes/.local/share/nvim/site/pack/packer/start/nvim-lspconfig",
|
||||
url = "https://github.com/neovim/nvim-lspconfig"
|
||||
},
|
||||
["omnisharp-vim"] = {
|
||||
loaded = true,
|
||||
path = "/home/vylpes/.local/share/nvim/site/pack/packer/start/omnisharp-vim",
|
||||
url = "https://github.com/OmniSharp/omnisharp-vim"
|
||||
},
|
||||
["packer.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/home/vylpes/.local/share/nvim/site/pack/packer/start/packer.nvim",
|
||||
url = "https://github.com/wbthomason/packer.nvim"
|
||||
},
|
||||
["plenary.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/home/vylpes/.local/share/nvim/site/pack/packer/start/plenary.nvim",
|
||||
url = "https://github.com/nvim-lua/plenary.nvim"
|
||||
},
|
||||
["prettier.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/home/vylpes/.local/share/nvim/site/pack/packer/start/prettier.nvim",
|
||||
url = "https://github.com/MunifTanjim/prettier.nvim"
|
||||
},
|
||||
vim = {
|
||||
loaded = true,
|
||||
path = "/home/vylpes/.local/share/nvim/site/pack/packer/start/vim",
|
||||
url = "https://github.com/dracula/vim"
|
||||
},
|
||||
["vim-devicons"] = {
|
||||
loaded = true,
|
||||
path = "/home/vylpes/.local/share/nvim/site/pack/packer/start/vim-devicons",
|
||||
url = "https://github.com/ryanoasis/vim-devicons"
|
||||
},
|
||||
["vim-snippets"] = {
|
||||
loaded = true,
|
||||
path = "/home/vylpes/.local/share/nvim/site/pack/packer/start/vim-snippets",
|
||||
url = "https://github.com/honza/vim-snippets"
|
||||
},
|
||||
["vim-startify"] = {
|
||||
loaded = true,
|
||||
path = "/home/vylpes/.local/share/nvim/site/pack/packer/start/vim-startify",
|
||||
url = "https://github.com/mhinz/vim-startify"
|
||||
}
|
||||
}
|
||||
|
||||
time([[Defining packer_plugins]], false)
|
||||
|
||||
_G._packer.inside_compile = false
|
||||
if _G._packer.needs_bufread == true then
|
||||
vim.cmd("doautocmd BufRead")
|
||||
end
|
||||
_G._packer.needs_bufread = false
|
||||
|
||||
if should_profile then save_profiles() end
|
||||
|
||||
end)
|
||||
|
||||
if not no_errors then
|
||||
error_msg = error_msg:gsub('"', '\\"')
|
||||
vim.api.nvim_command('echohl ErrorMsg | echom "Error in packer_compiled: '..error_msg..'" | echom "Please check your config for correctness" | echohl None')
|
||||
end
|
|
@ -7,6 +7,7 @@ dunst
|
|||
fastfetch
|
||||
firefox
|
||||
flameshot
|
||||
fzf
|
||||
gnome-keyring
|
||||
htop
|
||||
hyfetch
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue