Skip to content

Instantly share code, notes, and snippets.

@cfflymolo
Last active June 21, 2021 16:55
Show Gist options
  • Save cfflymolo/95fbfd6bb735610f166bc5aa8de58a85 to your computer and use it in GitHub Desktop.
Save cfflymolo/95fbfd6bb735610f166bc5aa8de58a85 to your computer and use it in GitHub Desktop.
NeoVim Configuration
" Vim Initialization
" ------------------
" This will set the cursor to be a solid shape
let $NVIM_TUI_ENABLE_CURSOR_SHAPE = 0
" Tabs and Indents
" ----------------
set textwidth=80 " Text width maximum chars before wrapping
set expandtab " Expand tabs into spaces
set tabstop=4 " The number of spaces a tab is
set softtabstop=4 " While performing editing operations
set shiftwidth=4 " Number of spaces to use in auto(indent)
set smarttab " Tab insert blanks according to 'shiftwidth'
set autoindent " User same indenting on new lines
set smartindent " Smart autoindenting on new lines
set shiftround " Round intend to multiple of 'shiftwidth'
" Timing
" ------
set timeout ttimeout
set timeoutlen=750 " Time out on mappings
set updatetime=1000 " Idle time to write swap and trigger CursorHold
" Searching
" ---------
set ignorecase " Search ignoring case
set smartcase " Keep case when searching with *
set infercase " Adjust case in insert completion mode
set incsearch " Incremental search
set hlsearch " Highlight search results
set wrapscan " Searches wrap around the end of the file
set showmatch " Jump to matching bracket
set matchpairs+=<:> " Add HTML brackets to pair matching
set matchtime=1 " Tenths of a second to show the matching paren
set cpoptions-=m " showmatch will wait 0.5s until a char is typed
" Behavior
" --------
set nowrap " No wrap by default
set linebreak " Break long lines at 'breakat'
set breakat=\ \ ;:,!? " Long lines break chars
set whichwrap+=h,l,<,>,[,],~ " Move to the following line on certain keys
set backspace=indent,eol,start " Intuitive backspacing in insert mode
" Key Mappings
" ------------
nmap =j :%!python -m json.tool<CR>
" Vim-Plug
" --------
" For Neovim: ~/.local/share/nvim/plugged
call plug#begin('~/.vim/plugged')
" Vim-Airline
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
" JQ
Plug 'vito-c/jq.vim'
" Color Themes
Plug 'ayu-theme/ayu-vim'
Plug 'dracula/vim'
Plug 'hzchirs/vim-material'
Plug 'morhetz/gruvbox'
" Syntastic
Plug 'vim-syntastic/syntastic'
" Swift
Plug 'keith/swift.vim'
call plug#end()
" Ayu Theme Configuration
" -----------------------
let ayucolor="mirage"
" Editor UI Appearance
" --------------------
set scrolloff=3 " Keep at least 3 lines above/below
set sidescrolloff=5 " Keep at least 5 lines left/right
set number " Show line numbers
set termguicolors " Use true colors in the terminal
syntax on " Enable syntax highlighting
colorscheme ayu " Set the color scheme
" Airline-Configuration
" ---------------------
let g:airline_theme = 'material'
let g:airline_powerline_fonts = 1
" Filetype Associations
" ---------------------
au BufRead,BufNew,BufNewFile Podfile,Podfile-* setfiletype ruby
au BufRead,BufNew,BufNewFile *.podspec setfiletype ruby
" Language Settings
" -----------------
autocmd FileType ruby setlocal shiftwidth=2 softtabstop=2 tabstop=2
" Filetypes
" ---------
" Python
let g:python_highlight_all = 1
let g:syntastic_python_python_exec = '/usr/local/bin/python3.6'
" Vim
" let g:vimsyntax_noerror = 1
let g:vim_indent_cont = &shiftwidth
" Bash
let g:is_bash = 1
" Markdown
let g:markdown_fenced_languages = [
\ 'css',
\ 'javascript',
\ 'js=javascript',
\ 'json=javascript',
\ 'python',
\ 'py=python',
\ 'sh',
\ 'sass',
\ 'xml',
\ 'vim'
\]
" Swift
let g:syntastic_swift_checkers = ['swiftpm', 'swiftlint']
" Custom Functions
" ----------------
function BeautifyJSON()
%!python -m json.tool
endfunction
@cfflymolo
Copy link
Author

6/10/2021 - Updated to match the latest in-use version

@cfflymolo
Copy link
Author

6/21/2021 - Updated the filetype associations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment