Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sivinnguyen/f9a2b76bb6dfb41259232eb6a75df2b8 to your computer and use it in GitHub Desktop.
Save sivinnguyen/f9a2b76bb6dfb41259232eb6a75df2b8 to your computer and use it in GitHub Desktop.
Neovim's configuration for android termux
""""""""""""""""""""""""""""""""""
" Sivin's Neovim Configuration
" this version is for android termux
" ~/.config/nvim/init.vim
"
""""""""""""""""""""""""""""""""""
" Specify a directory for plugins
" - Avoid using standard Vim directory names like 'plugin'
call plug#begin('~/.config/nvim/plugged')
" Utilities
Plug 'preservim/nerdtree'
Plug 'Xuyuanp/nerdtree-git-plugin'
" Generic Programming Support
Plug 'Townk/vim-autoclose'
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
Plug 'deoplete-plugins/deoplete-jedi'
" Themes / Interface
Plug 'morhetz/gruvbox'
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'Yggdroot/indentLine'
" Put vim-devicons at the end of the list will make icons appear on the statusline
" https://github.com/ryanoasis/vim-devicons/issues/298
Plug 'ryanoasis/vim-devicons'
" Initialize plugin system
call plug#end()
""""""""""""""""""""""""""""""""""
" Configuration Section
"
""""""""""""""""""""""""""""""""""
if !exists("g:syntax_on")
syntax enable
endif
" Set leader
let g:mapleader="`"
" Enable mouse
if has('mouse')
set mouse=a
endif
" Neovim always uses UTF-8 as the default encoding
" Accessing system clipboard (copy/paste)
set clipboard=unnamedplus
" Show linenumbers
set nu
set ruler
" Auto-reloading a file in Vim as soon as it changed on disk
set autoread
set autowrite
" Set indent
set autoindent
set smartindent
set tabstop=4
set shiftwidth=4
set expandtab
" indentLine Plugin
"let g:indentLine_setColors=0
let g:indentLine_char ='¦'
" Disable files backup, swap
set nobackup
set nowb
set noswapfile
""""""""""""""""""""""""""""""""""
" Theme and styling
"
""""""""""""""""""""""""""""""""""
colorscheme gruvbox
set background=dark
let g:airline_theme = 'gruvbox'
""""""""""""""""""""""""""""""""""
" NERDTree Configuration
"
""""""""""""""""""""""""""""""""""
" Open/close NERDTree
nnoremap <C-n> :NERDTreeToggle<cr>
nnoremap <C-f> :NERDTreeFind<cr>
" Change default arrows
let g:NERDTreeDirArrowExpandable = '+'
let g:NERDTreeDirArrowCollapsible = '-'
" Auto-open NERDTree when vim starts up if no files were specified
" vim not vim .
autocmd StdinReadPre * let s:std_in = 1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
" Open automatically when vim starts up on opening a directory
autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | exe 'NERDTree' argv()[0] | wincmd p | ene | endif
" If another buffer tries to replace NERDTree, put it in the other window, and bring back NERDTree.
autocmd BufEnter * if bufname('#') =~ 'NERD_tree_\d\+' && bufname('%') !~ 'NERD_tree_\d\+' && winnr('$') > 1 | let buf=bufnr() | buffer# | execute "normal! \<C-W>w" | execute 'buffer'.buf | endif
" Highlight fullname
let g:NERDTreeFileExtensionHighlightFullName = 1
let g:NERDTreeExactMatchHighlightFullName = 1
let g:NERDTreePatternMatchHighlightFullName = 1
" Disable uncommon file extensions highlighting (this is a good idea if you are experiencing lag when scrolling)
" This configuration will limit the extensions used to these:
" .bmp, .c, .coffee, .cpp, .cs, .css, .erb, .go, .hs, .html, .java, .jpg, .js, .json, .jsx, .less, .lua, .markdown, .md, .php, .png, .pl, .py, .rb, .rs, .scala, .scss, .sh, .sql, .vim
let g:NERDTreeLimitedSyntax = 1
""""""""""""""""""""""""""""""""""
" Devicons Configuration
"
""""""""""""""""""""""""""""""""""
let g:webdevicons_enable = 1
let g:webdevicons_conceal_nerdtree_brackets = 1 " remove brackets
let g:airline_powerline_fonts = 1
if exists("g:loaded_webdevicons")
call webdevicons#refresh()
endif
""""""""""""""""""""""""""""""""""
" Airline Configuration
"
""""""""""""""""""""""""""""""""""
" Automatically displays all buffers when there's only one tab open.
let g:airline#extensions#tabline#enabled = 1
""""""""""""""""""""""""""""""""""
" Python Auto-completion
"
""""""""""""""""""""""""""""""""""
" Use deoplete
let g:deoplete#enable_at_startup = 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment