dotfiles

Cross platform dotfiles for linux, mac and windows
git clone git@getsh.org:dotfiles.git
Log | Files | Refs

commit 1fbd085e0b17155193b5071989e8f2b2afd5cf5c
parent 0215da2a5ccb17ae24f41a2b8e3dd3b46c8dcd2f
Author: Bharatvaj <bharatvaj@yahoo.com>
Date:   Mon,  7 Mar 2022 11:08:14 +0530

Don't source vim config for neovim

VIMINIT is getting used for both vim and neovim. We are just allowing
the config to load when 'nvim' is found.

Remove vim hard mode as I'm accustomed to hjkl. Removing it increases
startup time.

Note
init.lua is not loaded by neovim.

Diffstat:
M.config/nvim/init.lua | 9++++++++-
D.config/nvim/utils.lua | 11-----------
M.config/vim/keybindings/keybindings.vim | 3+++
M.config/vim/vimrc | 13+++++++++++--
M.profile | 6++++--
5 files changed, 26 insertions(+), 16 deletions(-)

diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua @@ -1,6 +1,8 @@ vim.g.mapleader = ' ' local set = vim.opt +set.packpath="$XDG_DATA_HOME/nvim" + local map = require("utils").map map("n", "<Leader>ww", ":w<CR>", { silent = true }) @@ -8,5 +10,10 @@ map("n", "<Leader>wq", ":wq<CR>", { silent = true }) map("n", "<Leader>qq", ":q<CR>", { silent = true }) map("n", "<CR>", ":noh<CR>", { silent = true }) - set.tabstop=4 +set.exrc=false + + +require'lspconfig'.pyright.setup{} + +set.shortmess="Iat" diff --git a/.config/nvim/utils.lua b/.config/nvim/utils.lua @@ -1,11 +0,0 @@ -local M = {} - -function M.map(mode, lhs, rhs, opts) - local options = { noremap = true } - if opts then - options = vim.tbl_extend("force", options, opts) - end - vim.api.nvim_set_keymap(mode, lhs, rhs, options) -end - -return M diff --git a/.config/vim/keybindings/keybindings.vim b/.config/vim/keybindings/keybindings.vim @@ -17,6 +17,9 @@ nnoremap <leader>qq :q<cr> " Run Make nnoremap <leader>bb :make<CR> +" Generate ctags +map <leader>c :!ctags -R -f ./.git/tags .<CR> + nnoremap <CR> :noh<CR><CR>:<backspace> " Plugin keybindings diff --git a/.config/vim/vimrc b/.config/vim/vimrc @@ -25,10 +25,10 @@ augroup numbertoggle augroup END " General -set mouse=a +set mouse= set nocursorline syntax on -set exrc +set noexrc set scrolloff=8 " Turn backup off set nobackup @@ -61,6 +61,15 @@ set shiftwidth=4 " Netrw customization let g:netrw_banner = 0 +" Visual Tweaks +hi VertSplit term=NONE cterm=NONE gui=NONE + +"TODO use inverse colors from fg and bg instead of hardcoding black and white values +hi LineNr ctermbg=Black ctermfg=White + +" Prominent Cursor Line +hi CursorLineNr ctermbg=White ctermfg=Black + " Disable status set laststatus=1 diff --git a/.profile b/.profile @@ -7,7 +7,9 @@ export XDG_DATA_HOME="$HOME/.local/share" export XDG_CACHE_HOME="$HOME/.cache" # Global programs -export VIMINIT="source $XDG_CONFIG_HOME/vim/vimrc" +export VIMINIT="if !has('nvim') +source $XDG_CONFIG_HOME/vim/vimrc +endif" export LESSHISTFILE=- export LYNX_CFG="$XDG_CONFIG_HOME/lynx/lynx.cfg" export LYNX_LSS="$XDG_CONFIG_HOME/lynx/lynx.lss" @@ -57,7 +59,7 @@ export GEM_SPEC_CACHE="$XDG_CACHE_HOME"/gem HISTTIMEFORMAT="%F %T " # Local executables -export PATH=${PATH}:~/.local/bin +export PATH=${PATH}:${HOME}./local/bin:${XDG_DATA_HOME}/npm/bin chance() { # Hit or miss