LunarVim/modules/general.vim

79 lines
3.2 KiB
VimL
Raw Normal View History

2019-02-10 21:17:03 +01:00
" Be IMproved
if &compatible
set nocompatible
endif
2019-02-14 03:22:58 +01:00
" set leader key
let g:mapleader="\\"
" alias for leader key
nmap <space> \
xmap <space> \
syntax enable " Enables syntax highlighing
2019-02-16 17:44:35 +01:00
set hidden " Required for specific actions that require multiple buffers
2019-02-14 03:22:58 +01:00
set nowrap " display long lines as just one line
set encoding=utf-8 " The encoding displayed
2019-02-20 18:24:54 +01:00
set pumheight=10 " Makes popup menu smaller
2019-02-14 03:22:58 +01:00
set fileencoding=utf-8 " The encoding written to file
2019-02-17 18:03:58 +01:00
set ruler " show the cursor position all the time
2019-02-14 03:22:58 +01:00
set iskeyword+=- " treat dash separated words as a word text object"
set mouse=a " Enable your mouse
set splitbelow " Horizontal splits will automatically be below
set splitright " Vertical splits will automatically be to the right
set t_Co=256 " Support 256 colors
set autochdir " Your working directory will always be the same as your working directory
:set conceallevel=0 " So that I can see `` in markdown files
2019-02-17 18:03:58 +01:00
set tabstop=2 " Insert 2 spaces for a tab
set shiftwidth=2 " Change the number of space characters inserted for indentation
2019-02-14 03:22:58 +01:00
set smarttab " Makes tabbing smarter will realize you have 2 vs 4
set expandtab " Converts tabs to spaces
set smartindent " Makes indenting smart
set autoindent " Good auto indent
set laststatus=2 " Always display the status line
set number " Line numbers
set cursorline " Enable highlighting of the current line
set background=dark " tell vim what the background color looks like
let g:python_highlight_all = 0 " Get rid of annoying red highlights"
let g:elite_mode=1 " Disable arrows"
2019-02-20 18:24:54 +01:00
filetype plugin indent on " Gives vim abilty to recognize filetypes
" Disable arrow movement, resize splits instead.
if get(g:, 'elite_mode')
nnoremap <Up> :resize -2<CR>
nnoremap <Down> :resize +2<CR>
nnoremap <Left> :vertical resize -2<CR>
nnoremap <Right> :vertical resize +2<CR>
endif
2019-02-14 03:22:58 +01:00
" Alternate way to save
nnoremap <C-s> :w<CR>
" Alternate way to quit
nnoremap <C-Q> :wq!<CR>
" Use control-c instead of escape
nnoremap <C-c> <Esc>
" <TAB>: completion.
inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
" Open terminal with F1
nnoremap <silent> <F1> :10split term://bash<CR>
2019-02-16 23:12:38 +01:00
nnoremap <silent> <F2> :bdelete! term://*<return>
2019-02-14 03:22:58 +01:00
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
" Remap terminal switch
tnoremap <C-[> <C-\><C-n>
tnoremap <C-c><Esc> <Esc>
tnoremap <C-h> <C-\><C-n><C-w>h
tnoremap <C-j> <C-\><C-n><C-w>j
tnoremap <C-k> <C-\><C-n><C-w>k
tnoremap <C-l> <C-\><C-n><C-w>l
2019-02-14 03:22:58 +01:00
" TAB in general mode will move to text buffer
nnoremap <TAB> :bnext<CR>
" SHIFT-TAB will go back
nnoremap <S-TAB> :bprevious<CR>
2019-02-16 23:12:38 +01:00