diff options
author | Cody Hiar <cody@hiar.ca> | 2021-09-04 12:48:03 -0600 |
---|---|---|
committer | Cody Hiar <cody@hiar.ca> | 2021-09-04 12:48:03 -0600 |
commit | 84eab813d56e35d3626ff14da85af502b835e975 (patch) | |
tree | 3c067290c76409c61b2d24685c707b0f87575180 /lua/settings.lua | |
parent | 6c1793d98f244f0b6fc1b9eb163647dc9032f358 (diff) |
move everything into 1 file
Diffstat (limited to 'lua/settings.lua')
-rw-r--r-- | lua/settings.lua | 115 |
1 files changed, 0 insertions, 115 deletions
diff --git a/lua/settings.lua b/lua/settings.lua deleted file mode 100644 index 4e0b209..0000000 --- a/lua/settings.lua +++ /dev/null @@ -1,115 +0,0 @@ ---[[ -Todo - -https://dev.to/voyeg3r/writing-useful-lua-functions-to-my-neovim-14ki -function to remove whitespace and preserve spot on save - - - - - -]]-- -local o = vim.o -local g = vim.g -local cmd = vim.cmd -local map = vim.api.nvim_set_keymap - --- https://old.reddit.com/r/neovim/comments/lrz18i/how_to_change_colorscheme_in_lua_without_any/ -g.colors_name = "nord" - --- Set up spacebar as leader -map('n', '<Space>', '', {}) -vim.g.mapleader = ' ' - --- Set spaces > tabs, 4 as default -o.expandtab = true -o.tabstop = 4 -o.shiftwidth = 0 - -o.wrap = false -o.history = 1000 --- Wildmode show list, complete to first result -o.wildignore = "*/app/cache,*/vendor,*/env,*.pyc,*/venv,*/__pycache__,*/venv" -o.splitright = true -o.splitbelow = true -o.spelllang = "en_ca" - - -local highlights = { - "Search ctermfg=166", - "DiffAdd cterm=BOLD ctermfg=NONE ctermbg=22", - "DiffDelete cterm=BOLD ctermfg=NONE ctermbg=52", - "DiffChange cterm=BOLD ctermfg=NONE ctermbg=23", - "DiffText cterm=BOLD ctermfg=NONE ctermbg=23", - "Normal guibg=NONE ctermbg=NONE", - "Search ctermbg=None ctermfg=166", - "PrimaryBlock ctermfg=06 ctermbg=NONE", - "SecondaryBlock ctermfg=06 ctermbg=NONE", - "Blanks ctermfg=07 ctermbg=NONE", - "ColorColumn ctermbg=cyan", -} -for i, highlight in ipairs(highlights) do - cmd('au VimEnter * hi ' .. highlight) -end - --- Along with the highlight definition for ColorColumn above, these options --- will set colored marks at certain line lengths -cmd([[au BufEnter *.py let w:m1=matchadd('ColorColumn', '\%81v', 100)]]) -cmd([[au BufEnter *.py let w:m2=matchadd('Error', '\%121v', 100)]]) -cmd([[au BufLeave *.py call clearmatches()"]]) - - - -options = { noremap = true } - -map('n', '<leader>y', ':let @+=@0<cr>', options) -map('n', '<leader><leader>', ':noh<cr>', options) -map('i', 'jj', '<esc>', options) -map('n', 'gp', "`[v`]", options) - - - --- Status Line -local mode_map = { - ['n'] = 'normal', - ['no'] = 'n·operator pending', - ['v'] = 'visual', - ['V'] = 'v·line', - [''] = 'v·block', - ['s'] = 'select', - ['S'] = 's·line', - [''] = 's·block', - ['i'] = 'insert', - ['R'] = 'replace', - ['Rv'] = 'v·replace', - ['c'] = 'command', - ['cv'] = 'vim ex', - ['ce'] = 'ex', - ['r'] = 'prompt', - ['rm'] = 'more', - ['r?'] = 'confirm', - ['!'] = 'shell', - ['t'] = 'terminal' -} - -local function mode() - local m = vim.api.nvim_get_mode().mode - if mode_map[m] == nil then return m end - return '[' .. mode_map[m] .. '] ' -end - -local stl = { - '%#PrimaryBlock#', - mode(), - '%#SecondaryBlock#', - '%#Blanks#', - '%f', - '%m', - '%=', - '%#SecondaryBlock#', - '%l,%c ', - '%#PrimaryBlock#', - '%{&filetype}', -} - -o.statusline = table.concat(stl) |