Snippets

Dénes Türei .vimrc

Created by Dénes Türei
set background=dark
set encoding=utf-8
let python_highlight_all=1
filetype indent plugin on
set modeline
set backspace=indent,eol,start
set number
set wildmenu
set wildmode=list:longest
set ssop-=options
set tabstop=4
set softtabstop=4
set shiftwidth=4
set textwidth=79
set expandtab
set signcolumn=yes
set clipboard=unnamed

map <F7> :tabn<CR>
map <F8> :tabp<CR>

set splitbelow
set splitright

set diffopt+=vertical

nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
nnoremap <Leader>b :ls<CR>:b<Space>

let g:powerline_pycmd="py3"
python3 from powerline.vim import setup as powerline_setup
python3 powerline_setup()
python3 del powerline_setup

set laststatus=2

" Plugins (manged by vim-plug)
call plug#begin()

	Plug 'tpope/vim-sensible'
	Plug 'Exafunction/codeium.vim'
	Plug 'tmhedberg/SimpylFold'
	Plug 'Konfekt/FastFold'
	Plug 'vim-scripts/indentpython.vim'
	Plug 'ycm-core/YouCompleteMe'
	Plug 'dense-analysis/ale'
	Plug 'preservim/nerdtree'
    Plug 'Vimjas/vim-python-pep8-indent'
    Plug 'tpope/vim-commentary'
    Plug 'joshdick/onedark.vim'
    Plug 'sheerun/vim-polyglot'
    Plug 'Xuyuanp/nerdtree-git-plugin'
    Plug 'tpope/vim-fugitive'
    Plug 'ctrlpvim/ctrlp.vim'
    Plug 'tpope/vim-surround'
    Plug 'jiangmiao/auto-pairs'
    Plug 'ervandew/supertab'

call plug#end()

" Codeium keybindings
imap <script><silent><nowait><expr> <C-a> codeium#Accept()
imap <C-.>    <Cmd>call codeium#CycleCompletions(1)<CR>
imap <C-,>    <Cmd>call codeium#CycleCompletions(-1)<CR>
imap <C-x>    <Cmd>call codeium#Clear()<CR>

"split navigations
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>

" Enable folding
set foldmethod=indent
set foldlevel=99
" Enable folding with the spacebar
nnoremap <space> za

" Python PEP8 indentation style
au BufNewFile,BufRead *.py:
    \ set tabstop=4
    \ set softtabstop=4
    \ set shiftwidth=4
    \ set textwidth=79
    \ set expandtab
    \ set autoindent
    \ set fileformat=unix



highlight BadWhitespace ctermbg=red guibg=red
au BufRead,BufNewFile * match BadWhitespace /\s\+$/

nnoremap <SPACE> <Nop>
let mapleader=" "
let g:ycm_autoclose_preview_window_after_completion=1
map <leader>g  :YcmCompleter GoToDefinitionElseDeclaration<CR>

"python with virtualenv support
py3 << EOF
import os
import sys
if 'VIRTUAL_ENV' in os.environ:
  project_base_dir = os.environ['VIRTUAL_ENV']
  activate_this = os.path.join(project_base_dir, 'bin/activate_this.py')
  execfile(activate_this, dict(__file__=activate_this))
EOF

" Python: prefer hanging brackets:
let g:python_pep8_indent_hang_closing=0

"Use 24-bit (true-color) mode in Vim/Neovim when outside tmux.
"If you're using tmux version 2.2 or later, you can remove the outermost $TMUX check and use tmux's 24-bit color support
"(see < http://sunaku.github.io/tmux-24bit-color.html#usage > for more information.)
if (empty($TMUX))
  if (has("nvim"))
    "For Neovim 0.1.3 and 0.1.4 < https://github.com/neovim/neovim/pull/2198 >
    let $NVIM_TUI_ENABLE_TRUE_COLOR=1
  endif
  "For Neovim > 0.1.5 and Vim > patch 7.4.1799 < https://github.com/vim/vim/commit/61be73bb0f965a895bfb064ea3e55476ac175162 >
  "Based on Vim patch 7.4.1770 (`guicolors` option) < https://github.com/vim/vim/commit/8a633e3427b47286869aa4b96f2bfc1fe65b25cd >
  " < https://github.com/neovim/neovim/wiki/Following-HEAD#20160511 >
  if (has("termguicolors"))
    set termguicolors
  endif
endif

syntax on
colorscheme onedark

" remove trailing whitespace on save
autocmd BufWritePre * :%s/\s\+$//e

" ALE Python linting configuration
let g:ale_python_pylint_options='--disable bad-whitespace'
let g:ale_python_flake8_options='--ignore=E251,E131,E121,E123,E125,W504'

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.