Taylor Bockman
1 year ago
21 changed files with 275 additions and 246 deletions
@ -0,0 +1,18 @@ |
|||||||
|
-- General Configurations (Any language/Tool) |
||||||
|
|
||||||
|
-- Stripping trailing whitespace on save |
||||||
|
vim.api.nvim_create_autocmd("BufWritePre", { |
||||||
|
pattern = { "*" }, |
||||||
|
command = [[:%s/\s\+$//e]] |
||||||
|
}) |
||||||
|
|
||||||
|
-- Standard variables |
||||||
|
vim.opt.expandtab = true -- tabs to spaces |
||||||
|
vim.opt.tabstop = 2 -- spaces entered when tab key is pressed |
||||||
|
vim.opt.shiftwidth = 2 -- spaces entered for indentation |
||||||
|
vim.opt.number = true -- Line numbering |
||||||
|
vim.opt.clipboard = "unnamedplus" -- Share system clipboard |
||||||
|
vim.opt.eol = true -- End of line at bottom of file |
||||||
|
vim.opt.shiftround = true |
||||||
|
vim.opt.list = true |
||||||
|
vim.opt.listchars={tab = »·, trail=·} |
@ -1,15 +0,0 @@ |
|||||||
" General Configurations (Any language/Tool) |
|
||||||
|
|
||||||
" Stripping trailing whitespace on save |
|
||||||
autocmd BufWritePre * :%s/\s\+$//e |
|
||||||
|
|
||||||
" Standard variables |
|
||||||
set expandtab " tabs to spaces |
|
||||||
set tabstop=2 " spaces entered when tab key is pressed |
|
||||||
set shiftwidth=2 " spaces entered for indentation |
|
||||||
set number " Line numbering |
|
||||||
set clipboard+=unnamedplus " Share system clipboard |
|
||||||
set eol " End of line at bottom of file |
|
||||||
set shiftround |
|
||||||
set list |
|
||||||
set list listchars=tab:»·,trail:· |
|
@ -0,0 +1,8 @@ |
|||||||
|
-- Fugitive Configuration |
||||||
|
-- |
||||||
|
-- Fugitive bindings |
||||||
|
vim.api.nvim_set_keymap('n', '<Leader>gs', ':Git<CR>', {noremap = true}) |
||||||
|
vim.api.nvim_set_keymap('n', '<Leader>gd', ':Git diff<CR>', {noremap = true}) |
||||||
|
vim.api.nvim_set_keymap('n', '<Leader>gb', ':Git blame<CR>', {noremap = true}) |
||||||
|
vim.api.nvim_set_keymap('n', '<Leader>gc', ':Git commit<CR>', {noremap = true}) |
||||||
|
vim.api.nvim_set_keymap('n', '<Leader>gp', ':Git push<CR>', {noremap = true}) |
@ -1,9 +0,0 @@ |
|||||||
" Fugitive Configuration |
|
||||||
|
|
||||||
" Fugitive bindings |
|
||||||
nnoremap <Leader>gs :Git<CR> " This binding is a weird one. |
|
||||||
" :Git<CR> is now the full status page. |
|
||||||
nnoremap <Leader>gd :Git diff<CR> |
|
||||||
nnoremap <Leader>gb :Git blame<CR> |
|
||||||
nnoremap <Leader>gc :Git commit<CR> |
|
||||||
nnoremap <Leader>gp :Git push<CR> |
|
@ -0,0 +1,32 @@ |
|||||||
|
-- General-Purpose keybinds |
||||||
|
local keymap_opts = { silent = true, noremap = true } |
||||||
|
|
||||||
|
function NumberToggle() |
||||||
|
if vim.o.relativenumber then |
||||||
|
vim.opt.relativenumber = false |
||||||
|
vim.opt.number = true |
||||||
|
else |
||||||
|
vim.opt.relativenumber = true |
||||||
|
end |
||||||
|
end |
||||||
|
|
||||||
|
-- Space is the leader key when outside of insert mode. |
||||||
|
vim.g.mapleader = " " |
||||||
|
|
||||||
|
vim.api.nvim_set_keymap('', '<Leader>t', ':NERDTreeToggle<CR>', {silent = true}) |
||||||
|
|
||||||
|
-- <SPC>-r controls relative line numbering. |
||||||
|
vim.api.nvim_set_keymap('n', '<Leader>r', '<cmd>lua NumberToggle()<CR>', keymap_opts) |
||||||
|
|
||||||
|
-- Pressing enter in command mode clears the current search highlighting until |
||||||
|
-- the next search. |
||||||
|
vim.api.nvim_set_keymap('n', '<CR>', ':noh<CR><CR>', keymap_opts) |
||||||
|
|
||||||
|
-- This one maps F5 to delete all trailing whitespace |
||||||
|
vim.api.nvim_set_keymap( |
||||||
|
'n', |
||||||
|
'<F5>', |
||||||
|
[[:let _s=@/<Bar>:%s/\s\+$//e<Bar>:let @/=_s<Bar>:nohl<CR>]], |
||||||
|
keymap_opts) |
||||||
|
|
||||||
|
|
@ -1,28 +0,0 @@ |
|||||||
" General-Purpose keybinds |
|
||||||
|
|
||||||
" Space is the leader key when outside of insert mode. |
|
||||||
let mapleader=" " |
|
||||||
|
|
||||||
map <silent> <Leader>t :NERDTreeToggle<CR> |
|
||||||
nnoremap <silent> <Leader>r :call NumberToggle()<CR> |
|
||||||
|
|
||||||
" Pressing enter in command mode clears the current search highlighting until |
|
||||||
" the next search. |
|
||||||
nnoremap <silent> <CR> :noh<CR><CR> |
|
||||||
|
|
||||||
" This one maps F5 to delete all trailing whitespace |
|
||||||
nnoremap <silent> <F5> :let _s=@/<Bar>:%s/\s\+$//e<Bar>:let @/=_s<Bar>:nohl<CR> |
|
||||||
|
|
||||||
" Togglable relative line numbering |
|
||||||
function! NumberToggle() |
|
||||||
if(&relativenumber == 1) |
|
||||||
set norelativenumber |
|
||||||
set number |
|
||||||
else |
|
||||||
set relativenumber |
|
||||||
endif |
|
||||||
endfunc |
|
||||||
|
|
||||||
" <SPC>r will toggle relative line numbers. |
|
||||||
nnoremap <silent> <Leader>r :call NumberToggle()<CR> |
|
||||||
|
|
@ -0,0 +1,19 @@ |
|||||||
|
-- Python configurations |
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd( |
||||||
|
{ |
||||||
|
"BufNewFile", |
||||||
|
"BufRead", |
||||||
|
}, |
||||||
|
{ |
||||||
|
pattern = "*.py", |
||||||
|
callback = function() |
||||||
|
local buf = vim.api.nvim_get_current_buf() |
||||||
|
vim.api.nvim_buf_set_option(buf, "expandtab") |
||||||
|
vim.api.nvim_buf_set_option(buf, "autoindent") |
||||||
|
vim.api.nvim_buf_set_option(buf, "tabstop", 4) |
||||||
|
vim.api.nvim_buf_set_option(buf, "softtabstop", 4) |
||||||
|
vim.api.nvim_buf_set_option(buf, "shiftwidth", 4) |
||||||
|
end |
||||||
|
} |
||||||
|
) |
@ -1,9 +0,0 @@ |
|||||||
" Python configurations |
|
||||||
|
|
||||||
"" Set Python standard formatting. |
|
||||||
au BufNewFile,BufRead *.py |
|
||||||
\ set expandtab |" replace tabs with spaces |
|
||||||
\ set autoindent |" copy indent when starting a new line |
|
||||||
\ set tabstop=4 |
|
||||||
\ set softtabstop=4 |
|
||||||
\ set shiftwidth=4 |
|
@ -0,0 +1,74 @@ |
|||||||
|
-- Plugin definitions. |
||||||
|
|
||||||
|
local vim = vim |
||||||
|
local Plug = vim.fn['plug#'] |
||||||
|
|
||||||
|
-- I have no idea how to auto-install vim-plug on Windows |
||||||
|
-- so you will have to install it manually. |
||||||
|
vim.cmd [[ |
||||||
|
if !(has('win16') || has('win32') || has('win64')) |
||||||
|
if empty(glob('~/.config/nvim/autoload/plug.vim')) |
||||||
|
silent !curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs |
||||||
|
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim |
||||||
|
autocmd VimEnter * PlugInstall | source % |
||||||
|
endif |
||||||
|
endif |
||||||
|
]] |
||||||
|
|
||||||
|
vim.call('plug#begin', '~/.config/nvim/plugged') |
||||||
|
|
||||||
|
-- UI |
||||||
|
Plug 'arcticicestudio/nord-vim' |
||||||
|
Plug 'vim-airline/vim-airline' |
||||||
|
Plug 'vim-airline/vim-airline-themes' |
||||||
|
Plug 'ryanoasis/vim-devicons' |
||||||
|
Plug 'preservim/nerdtree' |
||||||
|
-- This plugin has been archived so if there are problems |
||||||
|
-- They may emerge here |
||||||
|
Plug 'Xuyuanp/nerdtree-git-plugin' |
||||||
|
Plug('nvim-treesitter/nvim-treesitter', {['do'] = vim.fn[':TSUpdate']}) |
||||||
|
|
||||||
|
-- General Editing |
||||||
|
Plug 'tpope/vim-surround' |
||||||
|
Plug 'tpope/vim-commentary' |
||||||
|
|
||||||
|
-- Search |
||||||
|
Plug 'kien/ctrlp.vim' |
||||||
|
|
||||||
|
-- Git |
||||||
|
Plug 'tpope/vim-fugitive' |
||||||
|
|
||||||
|
-- LSP |
||||||
|
Plug 'prabirshrestha/vim-lsp' |
||||||
|
Plug 'mattn/vim-lsp-settings' |
||||||
|
|
||||||
|
-- Autocomplete |
||||||
|
Plug 'prabirshrestha/asyncomplete.vim' |
||||||
|
Plug 'prabirshrestha/asyncomplete-lsp.vim' |
||||||
|
|
||||||
|
-- Tmux Helper |
||||||
|
Plug 'preservim/vimux' |
||||||
|
Plug 'christoomey/vim-tmux-navigator' |
||||||
|
|
||||||
|
-- Linting |
||||||
|
Plug 'w0rp/ale' |
||||||
|
|
||||||
|
-- Planning |
||||||
|
Plug 'jceb/vim-orgmode' |
||||||
|
|
||||||
|
-- Commands |
||||||
|
Plug 'skywind3000/asyncrun.vim' |
||||||
|
|
||||||
|
-- Syntax highlighting |
||||||
|
Plug 'sheerun/vim-polyglot' |
||||||
|
|
||||||
|
-- Languages |
||||||
|
|
||||||
|
------------------------- |
||||||
|
-- Python |
||||||
|
------------------------- |
||||||
|
|
||||||
|
-- Pyenv Support |
||||||
|
Plug 'lambdalisue/vim-pyenv' |
||||||
|
|
||||||
|
vim.call('plug#end') |
@ -1,69 +0,0 @@ |
|||||||
" Plugin definitions. |
|
||||||
|
|
||||||
" I have no idea how to auto-install vim-plug on Windows |
|
||||||
" so you will have to install it manually. |
|
||||||
if !(has('win16') || has('win32') || has('win64')) |
|
||||||
if empty(glob('~/.config/nvim/autoload/plug.vim')) |
|
||||||
silent !curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs |
|
||||||
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim |
|
||||||
autocmd VimEnter * PlugInstall | source % |
|
||||||
endif |
|
||||||
endif |
|
||||||
|
|
||||||
call plug#begin('~/.config/nvim/plugged') |
|
||||||
|
|
||||||
" UI |
|
||||||
Plug 'arcticicestudio/nord-vim' |
|
||||||
Plug 'vim-airline/vim-airline' |
|
||||||
Plug 'vim-airline/vim-airline-themes' |
|
||||||
Plug 'ryanoasis/vim-devicons' |
|
||||||
Plug 'preservim/nerdtree' |
|
||||||
"" This plugin has been archived so if there are problems |
|
||||||
"" They may emerge here |
|
||||||
Plug 'Xuyuanp/nerdtree-git-plugin' |
|
||||||
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} |
|
||||||
|
|
||||||
" General Editing |
|
||||||
Plug 'tpope/vim-surround' |
|
||||||
Plug 'tpope/vim-commentary' |
|
||||||
|
|
||||||
"" Search |
|
||||||
Plug 'kien/ctrlp.vim' |
|
||||||
|
|
||||||
"" Git |
|
||||||
Plug 'tpope/vim-fugitive' |
|
||||||
|
|
||||||
"" LSP |
|
||||||
Plug 'prabirshrestha/vim-lsp' |
|
||||||
Plug 'mattn/vim-lsp-settings' |
|
||||||
|
|
||||||
"" Autocomplete |
|
||||||
Plug 'prabirshrestha/asyncomplete.vim' |
|
||||||
Plug 'prabirshrestha/asyncomplete-lsp.vim' |
|
||||||
|
|
||||||
"" Tmux Helper |
|
||||||
Plug 'preservim/vimux' |
|
||||||
Plug 'christoomey/vim-tmux-navigator' |
|
||||||
|
|
||||||
"" Linting |
|
||||||
Plug 'w0rp/ale' |
|
||||||
|
|
||||||
"" Planning |
|
||||||
Plug 'jceb/vim-orgmode' |
|
||||||
|
|
||||||
"" Commands |
|
||||||
Plug 'skywind3000/asyncrun.vim' |
|
||||||
|
|
||||||
"" Syntax highlighting |
|
||||||
Plug 'sheerun/vim-polyglot' |
|
||||||
|
|
||||||
"" Languages |
|
||||||
|
|
||||||
""""""""""""""""""""""""" |
|
||||||
" Python |
|
||||||
""""""""""""""""""""""""" |
|
||||||
|
|
||||||
"" Pyenv Support |
|
||||||
Plug 'lambdalisue/vim-pyenv' |
|
||||||
|
|
||||||
call plug#end() |
|
@ -0,0 +1,22 @@ |
|||||||
|
-- Specific search configurations |
||||||
|
|
||||||
|
-- ctrlp hotkeys |
||||||
|
vim.g.ctrlp_map = '<c-p>' |
||||||
|
vim.g.ctrlp_cmd = 'CtrlP' |
||||||
|
|
||||||
|
-- Rebind Ctrl-P to match the window opening keys of nerd tree |
||||||
|
vim.g.ctrl_p_prompt_mappings = { |
||||||
|
['AcceptSelection("h")'] = {'<c-i>','<c-cr>','<c-s>'}, |
||||||
|
['AcceptSelection("v")'] = {'<c-s>','<RightMouse>' }, |
||||||
|
} |
||||||
|
|
||||||
|
-- ctrlp configuration |
||||||
|
vim.opt.wildignore = { |
||||||
|
"*/tmp/*", |
||||||
|
"*.so", |
||||||
|
"*.swp", |
||||||
|
"*.zip", |
||||||
|
"*\\tmp\\*", |
||||||
|
"*.exe", |
||||||
|
"*.out" |
||||||
|
} |
@ -1,15 +0,0 @@ |
|||||||
" Specific search configurations |
|
||||||
|
|
||||||
" ctrlp hotkeys |
|
||||||
let g:ctrlp_map='<c-p>' |
|
||||||
let g:ctrlp_cmd='CtrlP' |
|
||||||
|
|
||||||
" Rebind Ctrl-P to match the window opening keys of nerd tree |
|
||||||
let g:ctrl_p_prompt_mappings = { |
|
||||||
\ 'AcceptSelection("h")': ['<c-i>', '<c-cr>', '<c-s>'], |
|
||||||
\ 'AcceptSelection("v")': ['<c-s>', '<RightMouse>'], |
|
||||||
\ } |
|
||||||
|
|
||||||
" ctrlp configuration |
|
||||||
set wildignore+=*/tmp/*,*.so,*.swp,*.zip " MacOSX/Linux |
|
||||||
set wildignore+=*\\tmp\\*,*.swp,*.zip,*.exe " Windows |
|
@ -0,0 +1,12 @@ |
|||||||
|
-- UI Definitions |
||||||
|
|
||||||
|
vim.cmd [[colorscheme nord]] |
||||||
|
|
||||||
|
-- Helps some themes. |
||||||
|
vim.opt.termguicolors = true |
||||||
|
|
||||||
|
-- Always show hidden files in nerdtree |
||||||
|
vim.g.NERDTreeShowHidden = 1 |
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,18 +0,0 @@ |
|||||||
" UI Definitions |
|
||||||
|
|
||||||
colorscheme nord |
|
||||||
|
|
||||||
" Helps some themes. |
|
||||||
if (has('nvim')) |
|
||||||
let $NVIM_TUI_ENABLE_TRUE_COLOR = 1 |
|
||||||
endif |
|
||||||
|
|
||||||
if (has('termguicolors')) |
|
||||||
set termguicolors |
|
||||||
endif |
|
||||||
|
|
||||||
" Always show hidden files in nerdtree |
|
||||||
let NERDTreeShowHidden=1 |
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,16 @@ |
|||||||
|
-- Initialization |
||||||
|
|
||||||
|
require('/conf/plugins') |
||||||
|
require('/conf/keybinds') |
||||||
|
require('/conf/config') |
||||||
|
require('/conf/ui') |
||||||
|
require('/conf/search') |
||||||
|
require('/conf/git') |
||||||
|
require('ui') |
||||||
|
|
||||||
|
local paths = vim.fn.glob(vim.fn.stdpath 'config' .. 'config/langs/*.lua', true, true, true) |
||||||
|
|
||||||
|
for _, file in ipairs(paths) do |
||||||
|
require(file) |
||||||
|
end |
||||||
|
|
@ -1,17 +0,0 @@ |
|||||||
" Initialization |
|
||||||
|
|
||||||
let g:nvim_config_root = stdpath('config') |
|
||||||
|
|
||||||
exe 'source' g:nvim_config_root . '/conf/plugins.vim' |
|
||||||
exe 'source' g:nvim_config_root . '/conf/keybinds.vim' |
|
||||||
exe 'source' g:nvim_config_root . '/conf/config.vim' |
|
||||||
exe 'source' g:nvim_config_root . '/conf/ui.vim' |
|
||||||
exe 'source' g:nvim_config_root . '/conf/search.vim' |
|
||||||
exe 'source' g:nvim_config_root . '/conf/git.vim' |
|
||||||
|
|
||||||
let lang_configs = glob(g:nvim_config_root . '/conf/langs/*.vim', 1, 1) |
|
||||||
|
|
||||||
for lang_config in lang_configs |
|
||||||
exe 'source' lang_config |
|
||||||
endfor |
|
||||||
|
|
Loading…
Reference in new issue