diff --git a/init.lua b/init.lua index 140f954..820b476 100644 --- a/init.lua +++ b/init.lua @@ -2,17 +2,18 @@ -- Please remember the lua @ the begining & end of the string are implied. -- In other words "user.abbrs" is the same as "lua.user.abbrs" | "user.abbrs.lua" | "lua.user.abbrs.lua". require "user.options" --- I have auto-commands for cursor-file persistance, --- auto. vertically centering, & auto-saving text-folds. -require "user.keymaps" -- Abbreviations for manual text-replacements. -- Populated mostly with a top 100 list of commonly misspelled words. +-- This is where I will add my color-schemes. require "user.abbrs" +require "user.colorscheme" +-- I have auto-commamodule 'user.cmp' not found:nds for cursor-file persistance, +-- auto. vertically centering, & auto-saving text-folds. +require "user.keymaps" -- My personnel plugins lua configuration file. -- I will be adding to this file often, -- b/c it's where I will be adding plugins to packer. -- I like that Packer is fully in lua. require "user.plugins" --- This is where I will add my color-schemes. -require "user.colorscheme" - +-- Several cool auto-commands, for persistance mostly. +require "user.autocmds" diff --git a/lua/user/autocmds.lua b/lua/user/autocmds.lua new file mode 100644 index 0000000..73ebb1b --- /dev/null +++ b/lua/user/autocmds.lua @@ -0,0 +1,25 @@ +-- Embedded Vim Auto-command, that adds file cursor location persistance. + vim.cmd + [[ + augroup line_return + au! + au BufReadPost * + \ if line("'\"") > 0 && line("'\"") <= line("$") | + \ execute 'normal! g`"zvzz' | + \ endif + augroup END + ]] + +-- Automatically save & re-fold Documents, when exiting & re-entering the file. + vim.cmd + [[ + autocmd BufWinLeave *.* mkview " Auto-save Folds before leaving a buffer. + autocmd BufWinEnter *.* silent loadview " Auto-re-load saved folds. + ]] + +-- Vertically center the buffer, each time I go into insert mode. + vim.cmd + [[ + autocmd InsertEnter * norm zz + ]] + diff --git a/lua/user/options.lua b/lua/user/options.lua index c74e412..2ad2271 100644 --- a/lua/user/options.lua +++ b/lua/user/options.lua @@ -1,5 +1,6 @@ -- :help options -local options = { +local options = +{ -- Display settings: fileencoding = "utf-8", -- The encoding written to a file. showtabline = 2, -- Always show tabs. @@ -54,7 +55,7 @@ local options = { -- Did NOT fit well within the options loop , without throwing errors and disabling the loop. vim.opt.shortmess:append "I" -- Set No Intro-message for Neo-vim. --- vim.cmd Passes strings, that will be interpreted as vim-script. --- vim.cmd "set whichwrap+=<,>,[,],h,l" Want to find out what it does, before blindly enabling it. - vim.cmd [[set iskeyword+=-]] -- Will treat words with a dash as part of a single word. ---vim.cmd [[set formatoptions-=cro]] -- TODO: this doesn't seem to work +-- vim.cmd Passes strings, that will be interpreted as vim-script. + vim.cmd "set whichwrap+=<,>,[,],h,l" -- Want to find out what it does, before blindly enabling it. +--vim.cmd [[set iskeyword+=-]] -- Will treat words with a dash as part of a single word. +-- vim.cmd [[set formatoptions-=cro]] -- TODO: this doesn't seem to work diff --git a/lua/user/plugins.lua b/lua/user/plugins.lua index 1d6199b..6b7c2f7 100644 --- a/lua/user/plugins.lua +++ b/lua/user/plugins.lua @@ -1,22 +1,23 @@ local fn = vim.fn -- Automatically install packer -local install_path = fn.stdpath "data" .. "/site/pack/packer/start/packer.nvim" -if fn.empty(fn.glob(install_path)) > 0 then - PACKER_BOOTSTRAP = fn.system { - "git", - "clone", - "--depth", - "1", - "https://github.com/wbthomason/packer.nvim", - install_path, - } - print "Installing packer close and reopen Neovim..." - vim.cmd [[packadd packer.nvim]] -end +-- local install_path = fn.stdpath "data" .. "/site/pack/packer/start/packer.nvim" +-- if fn.empty(fn.glob(install_path)) > 0 then +-- PACKER_BOOTSTRAP = fn.system { +-- "git", +-- "clone", +-- "--depth", +-- "1", +-- "https://github.com/wbthomason/packer.nvim", +-- install_path, +-- } +-- print "Installing packer close and reopen Neovim..." +-- vim.cmd [[packadd packer.nvim]] +-- end -- Autocommand that reloads neovim whenever you save the plugins.lua file -vim.cmd [[ +vim.cmd +[[ augroup packer_user_config autocmd! autocmd BufWritePost plugins.lua source | PackerSync @@ -46,10 +47,10 @@ return packer.startup(function(use) use "nvim-lua/plenary.nvim" -- Useful lua functions used ny lots of plugins use "vim-airline/vim-airline" -- Plugin to give a much blingier neo-vim status-line, with themes available for GruvBox/CodeDark. use "mhinz/vim-startify" -- Neo-vim customizable Neo-vim start-page, w/ bookmarks/ascii cow programming humor each launch/re-load. - use "yggdroot/indentline" -- A great fct. to visualize layers of column/vertical alignment groups of code. + -- use "yggdroot/indentline" -- A great fct. to visualize layers of column/vertical alignment groups of code. use "rafi/awesome-vim-colorschemes" -- Various vim-colour schemes. use "ryanoasis/vim-devicons" -- Developer icons for Neo-vim plugins like file-managers... - use "tpope/vim-surround" -- great tag/code-encapsulator plugin. + -- use "tpope/vim-surround" -- great tag/code-encapsulator plugin. -- Colorschemes use "lunarvim/colorschemes" -- A bunch of colorschemes you can try out