added gitignore, got shell script working

This commit is contained in:
2023-11-07 16:15:07 +00:00
commit 62a07ad4bb
3 changed files with 30 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
*swp

8
src/vimrc Normal file
View File

@@ -0,0 +1,8 @@
set autoindent expandtab tabstop=4 shiftwidth=4
set hidden
nnoremap <C-S> :w<cr>
inoremap <C-S> <esc>:w<cr>i
let mapleader=" "
nnoremap <leader>w :w<cr>:bw<cr>
nnoremap <leader>v :e ~/.vimrc<cr>
nnoremap <leader>s :source ~/.vimrc<cr>

21
vk Executable file
View File

@@ -0,0 +1,21 @@
#!/bin/bash
STTY_PRESENT=$(grep "stty -ixon" ~/.bashrc)
BIND_PRESENT=$(grep "bind -r '\\\C-s'" ~/.bashrc)
if [ -z "$STTY_PRESENT" ]; then
echo "writing 'stty -ixon' to .bashrc..."
echo "stty -ixon" >> ~/.bashrc
fi
if [ -z "$BIND_PRESENT" ]; then
echo "writing 'bind -r '\C-s'' to .bashrc..."
echo "bind -r '\C-s'" >> ~/.bashrc
fi
VIMRC_FILE=~/.vimrc
if test -f "$VIMRC_FILE"; then
echo
else
cp src/vimrc ~/.vimrc
echo "copied src/vimrc to .vimrc"
fi