set nocompatible " be iMproved, required filetype off " required " set the runtime path to include Vundle and initialize set rtp+=~/.vim/bundle/Vundle.vim call vundle#begin() " let Vundle manage Vundle, required Plugin 'VundleVim/Vundle.vim' " utils Plugin 'nvim-lua/plenary.nvim' " LSP, syntax etc. Plugin 'davidhalter/jedi-vim' Plugin 'neoclide/coc.nvim' Plugin 'yaegassy/coc-ansible' Plugin 'pprovost/vim-ps1' Plugin 'pearofducks/ansible-vim' " csv magic Plugin 'mechatroner/rainbow_csv' " ChatGPT plugin Plugin 'CamdenClark/flyboy' " file browser Plugin 'nvim-tree/nvim-tree.lua' " All of your Plugins must be added before the following line call vundle#end() " required filetype plugin indent on " required " see :h vundle for more details or wiki for FAQ " general stuff colorscheme slate let g:mapleader = "," syntax on set ignorecase set smartcase " Include only uppercase words with uppercase search term set hlsearch set tabstop=2 set shiftwidth=2 set softtabstop=4 set expandtab set scrolloff=5 " Scroll 5 lines from top/bottom set list " show tabs and EOL set listchars=tab:>>,trail:-,nbsp:+,eol:$ set number " Show line numbers set rnu " relative line numbers set cursorline " status line set laststatus=2 set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [POS=%l,%v][%p%%]\ [BUFFER=%n]\ %{FugitiveStatusline()} " add underscore to word delimiters " set iskeyword-=_ " WSL Yank support " Copy to clipboard " set clipboard=unnamedplus if system('uname -r') =~ "Microsoft" augroup Yank autocmd! autocmd TextYankPost * :call system('/mnt/c/windows/system32/clip.exe ',@") augroup END endif "map "=p :r !powershell.exe -Command Get-Clipboard "map! = :r !powershell.exe -Command Get-Clipboard "noremap "+p :exe 'norm a'.system('/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe -Command Get-Clipboard') " Jedi Stuff let g:jedi#force_py_version = 3 " Remember file position :au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") && &ft !~# 'commit' | exe "normal! g`\"" | endif " autocmd FileType python set makeprg=python3\ % au FileType python set makeprg=pylint\ --reports=n\ --output-format=parseable\ %:p au FileType python set efm=%A%f:%l:\ [%t%.%#]\ %m,%Z%p^^,%-C%.%# nnoremap :Files au BufNewFile,BufRead *.ps1 set fileencoding=cp1252 " try fixing italics? set t_ZH=^[[3m set t_ZR=^[[23m " persistent undo if has('persistent_undo') set undofile endif " generate pw? " r! cmd.exe /c 'python C:\Tools\pw.py 10' " =system("cmd.exe /c 'python C:\\Tools\\pw.py 10' | tr -d '\n' | tr -d '\r'") let pwcmd = 'cmd.exe /c "python C:\\Tools\\pw.py 10" |tr -d "\\n"|tr -d "\\r"' :nmap "=system(pwcmd)p :imap =system(pwcmd) " vim-ansible au BufRead,BufNewFile */playbooks/*.yml set filetype=yaml.ansible au BufRead,BufNewFile */playbooks/*.yml set keywordprg=ansible-doc let g:ansible_name_highlight = 'b' let g:ansible_extra_keywords_highlight = 1 " coc-ansible set signcolumn=yes let g:coc_filetype_map = { \ 'yaml.ansible': 'ansible', \ } " Use tab for trigger completion with characters ahead and navigate " NOTE: There's always complete item selected by default, you may want to enable " no select by `"suggest.noselect": true` in your configuration file " NOTE: Use command ':verbose imap ' to make sure tab is not mapped by " other plugin before putting this into your config inoremap \ coc#pum#visible() ? coc#pum#next(1) : \ CheckBackspace() ? "\" : \ coc#refresh() inoremap coc#pum#visible() ? coc#pum#prev(1) : "\" function! CheckBackspace() abort let col = col('.') - 1 return !col || getline('.')[col - 1] =~# '\s' endfunction " Make to accept selected completion item or notify coc.nvim to format " u breaks current undo, please make your own choice inoremap coc#pum#visible() ? coc#pum#confirm() \: "\u\\=coc#on_enter()\" " bind code folding to space (in normal mode) nnoremap @=(foldlevel('.')?'za':"\") vnoremap zf set foldmethod=indent set foldnestmax=2 set foldlevel=1