diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua new file mode 100644 index 0000000..fa5b34e --- /dev/null +++ b/.config/nvim/init.lua @@ -0,0 +1,50 @@ +-- This file can be loaded by calling `lua require('plugins')` from your init.vim + +-- Only required if you have packer configured as `opt` +local ensure_packer = function() + local fn = vim.fn + local install_path = fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim' + if fn.empty(fn.glob(install_path)) > 0 then + fn.system({ 'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path }) + vim.cmd [[packadd packer.nvim]] + return true + end return false +end + +local packer_bootstrap = ensure_packer() +local packer = require('packer') + +packer.startup(function(use) + -- Packer can manage itself + use 'wbthomason/packer.nvim' + use { + 'marko-cerovac/material.nvim', + config = function() + vim.g.material_style = "palenight" + vim.cmd [[colorscheme material]] + end + } + use { 'TimUntersberger/neogit', requires = 'nvim-lua/plenary.nvim' } +end) + +if packer_bootstrap then + require('packer').sync() +end + +local autocmd = vim.api.nvim_create_autocmd +local augroup = vim.api.nvim_create_augroup + +autocmd('BufWritePost', { + group = augroup('packer_user_config', { clear = true }), + pattern = "init.lua", + once = true, + callback = function() + vim.cmd('source $MYVIMRC') + packer.compile() + end +}) + +local neogit = require('neogit') + +neogit.setup {} + diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim deleted file mode 100644 index 2bbd554..0000000 --- a/.config/nvim/init.vim +++ /dev/null @@ -1,204 +0,0 @@ -call plug#begin(stdpath('data') . '/plugged') - -"Timmy Popester -Plug 'tpope/vim-surround' -Plug 'tpope/vim-repeat' -Plug 'tpope/vim-commentary' -Plug 'tpope/vim-fugitive' -Plug 'jiangmiao/auto-pairs' - -" Nav -Plug 'rhysd/clever-f.vim' -Plug 'easymotion/vim-easymotion' - -" Utilities -" Plug 'Yggdroot/LeaderF', { 'do': ':LeaderfInstallCExtension' } -Plug 'mhinz/vim-startify' -Plug 'mbbill/undotree' -Plug 'junegunn/vim-easy-align' -Plug 'famiu/nvim-reload' -Plug 'kyazdani42/nvim-web-devicons' -Plug 'nvim-lua/plenary.nvim' -Plug 'nvim-lua/popup.nvim' -Plug 'nvim-telescope/telescope.nvim' - -" Languages -Plug 'dag/vim-fish', { 'for' : 'fish' } - -" Stuff to maybe install later - -Plug 'airblade/vim-gitgutter' " This one is going to depend on whether vim still remains snappy - -" Plug 'ionide/Ionide-vim', { " Are we really going to try and develop on vim? -" \ 'do': 'make fsautocomplete', -" \} -" Plug 'autozimu/LanguageClient-neovim', { 'branch': 'next', 'do': 'bash install.sh' } - - -call plug#end() - -set number -set relativenumber -set autochdir -set splitbelow -set splitright -set tabstop=4 -set tw=80 -set ft+=t -set shiftwidth=4 -set expandtab -set softtabstop=4 -set nowrap -set ignorecase -set smartcase -set noswapfile -set nobackup -set hidden -set wildmenu -set clipboard=unnamedplus -set shell=/bin/bash - -if exists('g:fvim_loaded') - nnoremap :set guifont=+ - nnoremap :set guifont=- - FVimCursorSmoothMove v:false - FVimCursorSmoothBlink v:true - FVimFontAutoSnap v:true -endif - - -let mapleader = " " - -nnoremap Y y$ -nnoremap vv ^vg_ -noremap \ q -noremap $ g_ -nnoremap ' ` -nnoremap ` ' -nnoremap - :Ex -map , (easymotion-prefix) - -nnoremap / :nohlsearch -nnoremap w :w -nnoremap rl :so $MYVIMRC:echo 'init.vim Reloaded!' -nnoremap ei :e $MYVIMRC -nnoremap bk :bd -nnoremap bb :b# -" nnoremap q :call DeleteBuffer() -nnoremap q :q -nnoremap o :call MaximizeToggle() - -nnoremap :e term://fish -nnoremap v :vsplit term://fish -nnoremap s :split term://fish -nnoremap t :tabnew term://fish -tnoremap -tnoremap h -tnoremap j -tnoremap k -tnoremap l -inoremap h -inoremap j -inoremap k -inoremap l -nnoremap h -nnoremap j -nnoremap k -nnoremap l - -noremap :tabprev -noremap :tabnext -tnoremap :tabprev -tnoremap :tabnext -inoremap :tabprev -inoremap :tabnext -noremap :tabm -1 -noremap :tabm +1 -noremap :vert resize -3 -noremap :vert resize +3 -noremap :resize +3 -noremap :resize -3 - -nnoremap n :tabnew -nnoremap k :tabclose - -nnoremap pi :w:so $MYVIMRC:PlugInstall -nnoremap pc :w:so $MYVIMRC:PlugClean - -augroup terminal_settings -autocmd! - -autocmd BufWinEnter,WinEnter term://* startinsert | setlocal norelativenumber nonumber nocursorcolumn nocursorline -autocmd BufLeave term://* stopinsert - -" Ignore various filetypes as those will close terminal automatically -" Ignore fzf, ranger, coc -autocmd TermClose term://* - \ if (expand('') !~ "fzf") && (expand('') !~ "ranger") && (expand('') !~ "coc") | - \ call nvim_input('') | - \ endif -augroup END - -" Plugins - -" Clever-F -let g:clever_f_fix_key_direction = 1 - -" EasyMotion -let g:EasyMotion_startofline = 0 -let g:EasyMotion_keys = 'asdfjklhgwueiroxnmvczqp' - -" LeaderF -let g:Lf_ShortcutF = '' -let g:Lf_ShortcutB = '' -let g:Lf_WindowPosition = 'popup' -let g:Lf_PreviewInPopup = 1 - -noremap ;f :Leaderf file -noremap ;b :Leaderf buffer -noremap ;m :Leaderf mru -noremap ;c :Leaderf command -noremap ;h :Leaderf help -noremap ;l :Leaderf line -noremap ;w :Leaderf window -noremap ;a :Leaderf self - -" Easy Align -xmap ga (EasyAlign) -nmap ga (EasyAlign) - -" Custom Functions - -function! MaximizeToggle() - if exists("s:maximize_session") - exec "source " . s:maximize_session - call delete(s:maximize_session) - unlet s:maximize_session - let &hidden=s:maximize_hidden_save - unlet s:maximize_hidden_save - else - let s:maximize_hidden_save = &hidden - let s:maximize_session = tempname() - set hidden - exec "mksession! " . s:maximize_session - only - endif -endfunction - -function! DeleteBuffer() - let l:buflisted = getbufinfo({'buflisted': 1}) - let [l:cur_winnr, l:cur_bufnr] = [winnr(), bufnr()] - " There's a bug where if it's a help window, it'll kill everything, so - " remove this for now -" if len(l:buflisted) < 2 | confirm qall | return | endif - for l:winid in getbufinfo(l:cur_bufnr)[0].windows - execute(win_id2win(l:winid) . 'wincmd w') - if l:cur_bufnr == l:buflisted[-1].bufnr | bp | else | bn | endif - endfor - execute(l:cur_winnr . 'wincmd w') - let l:is_terminal = getbufvar(l:cur_bufnr, '&buftype') == 'terminal' - if l:is_terminal | bd! # | else | silent! confirm bd # | endif -endfunction - - - diff --git a/.gitignore b/.gitignore index efc2674..e1d307d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ .config/emacs/* -!.config/emacs/init.org \ No newline at end of file +!.config/emacs/init.org