new file: init.lua

new file:   lua/ale.lua
	new file:   lua/config.lua
	new file:   lua/keybinds.lua
	new file:   lua/nvim_lsp.lua
	new file:   lua/packer_check.lua
	new file:   lua/plugins.lua
	new file:   lua/save_buffer_position.lua
	new file:   plugin/packer_compiled.lua
This commit is contained in:
2021-11-01 12:13:04 -05:00
commit 254e9c04ac
9 changed files with 979 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
vim.cmd [[
" https://vim.fandom.com/wiki/Avoid_scrolling_when_switch_buffers
" Save current view settings on a per-window, per-buffer basis.
function! AutoSaveWinView()
if !exists("w:SavedBufView")
let w:SavedBufView = {}
endif
let w:SavedBufView[bufnr("%")] = winsaveview()
endfunction
" Restore current view settings.
function! AutoRestoreWinView()
let buf = bufnr("%")
if exists("w:SavedBufView") && has_key(w:SavedBufView, buf)
let v = winsaveview()
let atStartOfFile = v.lnum == 1 && v.col == 0
if atStartOfFile && !&diff
call winrestview(w:SavedBufView[buf])
endif
unlet w:SavedBufView[buf]
endif
endfunction
autocmd BufLeave * call AutoSaveWinView()
autocmd BufEnter * call AutoRestoreWinView()
]]