vimrc refactor and remove most vim opts from neovim

This commit is contained in:
Tyler Starr 2023-12-18 11:26:23 -08:00
parent fd603cb09f
commit 4f6bd457a6
4 changed files with 31 additions and 52 deletions

View File

@ -1,2 +1,5 @@
-- neovim specific sets (everything else in ~/.vimrc)
vim.opt.termguicolors=true
require("tstarr")
vim.cmd('source ~/.vimrc')

View File

@ -1,3 +1,2 @@
require("tstarr.set")
require("tstarr.packer")
require("tstarr.which-key")

View File

@ -1,46 +0,0 @@
vim.opt.guicursor = ""
vim.opt.nu = true
vim.opt.relativenumber = true
vim.opt.errorbells = false
vim.opt.tabstop = 4
vim.opt.softtabstop = 4
vim.opt.shiftwidth = 4
vim.opt.expandtab = true
vim.opt.smartindent = true
vim.opt.wrap = false
vim.opt.swapfile = false
vim.opt.backup = false
vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir"
vim.opt.undofile = true
vim.opt.hlsearch = false
vim.opt.incsearch = true
vim.opt.termguicolors = true
vim.opt.scrolloff = 8
vim.opt.signcolumn = "yes"
vim.opt.isfname:append("@-@")
-- Give more space for displaying messages.
vim.opt.cmdheight = 1
-- Having longer updatetime (default is 4000 ms = 4 s) leads to noticeable
-- delays and poor user experience.
vim.opt.updatetime = 50
-- Don't pass messages to |ins-completion-menu|.
vim.opt.shortmess:append("c")
vim.g.mapleader = " "
vim.opt.colorcolumn = "80"
-- Open web links with default system application
vim.g.netrw_browsex_viewer="gio open"

View File

@ -2,15 +2,35 @@
" https://github.com/starr-dusT/dotfiles
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" general
" general
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set autowrite " automatically write files on close
" tabs and spaces and stuff
set tabstop=4
set softtabstop=4
set shiftwidth=4
set expandtab
" undos
set undodir="~/.vim/undodir"
set undofile
" map leader to Space
let mapleader = " "
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" ui
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
syntax enable
set number
set colorcolumn=79
set autowrite " automatically write files on close
let mapleader = " " " map leader to Space
set updatetime=50
set scrolloff=8
set smartindent
set incsearch " hilight search matches while typing
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" wildmenu
@ -60,6 +80,9 @@ map <leader>md :delmarks A-Z0-9 <cr> " clear marks
" misc keys
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" open help with word under cursor
map <leader>oh :execute "help " . expand("<cword>")<CR>
" move between splits with hjkl
map <C-j> <C-W>j
map <C-k> <C-W>k
@ -93,7 +116,7 @@ nnoremap <down> <C-x>
" display and select from a list of marks and jumps
" https://vi.stackexchange.com/a/42965
"
function ListSelect(command, jump)
function! ListSelect(command, jump)
execute a:command
echohl Question
echo "Enter mark (ESC to cancel): "