init.lua wasn't added
This commit is contained in:
parent
07f34ab377
commit
a09f8b04c8
50
.config/nvim/init.lua
Normal file
50
.config/nvim/init.lua
Normal file
@ -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 {}
|
||||
|
@ -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 <silent> <C-=> :set guifont=+<CR>
|
||||
nnoremap <silent> <C--> :set guifont=-<CR>
|
||||
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<CR>
|
||||
map , <Plug>(easymotion-prefix)
|
||||
|
||||
nnoremap <silent> <Leader>/ :nohlsearch<CR>
|
||||
nnoremap <Leader>w :w<CR>
|
||||
nnoremap <silent> <Leader>rl :so $MYVIMRC<CR>:echo 'init.vim Reloaded!'<CR>
|
||||
nnoremap <silent> <Leader>ei :e $MYVIMRC<CR>
|
||||
nnoremap <silent> <Leader>bk :bd<CR>
|
||||
nnoremap <silent> <Leader>bb :b#<CR>
|
||||
" nnoremap <silent> <Leader>q :call DeleteBuffer()<CR>
|
||||
nnoremap <silent> <Leader>q :q<CR>
|
||||
nnoremap <C-W>o :call MaximizeToggle()<CR>
|
||||
|
||||
nnoremap <silent> <C-CR> :e term://fish<CR>
|
||||
nnoremap <silent> <C-s>v :vsplit term://fish<CR>
|
||||
nnoremap <silent> <C-s>s :split term://fish<CR>
|
||||
nnoremap <silent> <C-s>t :tabnew term://fish<CR>
|
||||
tnoremap <A-e> <C-\><C-n>
|
||||
tnoremap <A-h> <C-\><C-N><C-w>h
|
||||
tnoremap <A-j> <C-\><C-N><C-w>j
|
||||
tnoremap <A-k> <C-\><C-N><C-w>k
|
||||
tnoremap <A-l> <C-\><C-N><C-w>l
|
||||
inoremap <A-h> <C-\><C-N><C-w>h
|
||||
inoremap <A-j> <C-\><C-N><C-w>j
|
||||
inoremap <A-k> <C-\><C-N><C-w>k
|
||||
inoremap <A-l> <C-\><C-N><C-w>l
|
||||
nnoremap <A-h> <C-w>h
|
||||
nnoremap <A-j> <C-w>j
|
||||
nnoremap <A-k> <C-w>k
|
||||
nnoremap <A-l> <C-w>l
|
||||
|
||||
noremap <A-H> <C-\><C-n>:tabprev<CR>
|
||||
noremap <A-L> <C-\><C-n>:tabnext<CR>
|
||||
tnoremap <A-H> <C-\><C-n>:tabprev<CR>
|
||||
tnoremap <A-L> <C-\><C-n>:tabnext<CR>
|
||||
inoremap <A-H> <C-\><C-n>:tabprev<CR>
|
||||
inoremap <A-L> <C-\><C-n>:tabnext<CR>
|
||||
noremap <A-Left> <C-\><C-n>:tabm -1<CR>
|
||||
noremap <A-Right> <C-\><C-n>:tabm +1<CR>
|
||||
noremap <A-S-Left> :vert resize -3<CR>
|
||||
noremap <A-S-Right> :vert resize +3<CR>
|
||||
noremap <A-S-Down> :resize +3<CR>
|
||||
noremap <A-S-Up> :resize -3<CR>
|
||||
|
||||
nnoremap <C-t>n :tabnew<CR>
|
||||
nnoremap <C-t>k :tabclose<CR>
|
||||
|
||||
nnoremap <Leader>pi :w<CR>:so $MYVIMRC<CR>:PlugInstall<CR>
|
||||
nnoremap <Leader>pc :w<CR>:so $MYVIMRC<CR>:PlugClean<CR>
|
||||
|
||||
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('<afile>') !~ "fzf") && (expand('<afile>') !~ "ranger") && (expand('<afile>') !~ "coc") |
|
||||
\ call nvim_input('<CR>') |
|
||||
\ 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<CR>
|
||||
noremap ;b :Leaderf buffer<CR>
|
||||
noremap ;m :Leaderf mru<CR>
|
||||
noremap ;c :Leaderf command<CR>
|
||||
noremap ;h :Leaderf help<CR>
|
||||
noremap ;l :Leaderf line<CR>
|
||||
noremap ;w :Leaderf window<CR>
|
||||
noremap ;a :Leaderf self<CR>
|
||||
|
||||
" Easy Align
|
||||
xmap ga <Plug>(EasyAlign)
|
||||
nmap ga <Plug>(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
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user