master
Felix Pankratz 4 months ago
parent 7284fc865e
commit d5217f2d0a

@ -0,0 +1,13 @@
-- set runtimepath^=~/.vim runtimepath+=~/.vim/after
vim.opt.runtimepath:prepend('~/.vim')
vim.opt.runtimepath:append('~/.vim')
-- let &packpath = &runtimepath
vim.o.packpath = vim.o.runtimepath
vim.g.python3_host_prog = '/usr/bin/python3'
-- let g:python3_host_prog="/usr/bin/python3"
vim.cmd("source ~/.vimrc")
-- optionally enable 24-bit colour
-- vim.opt.termguicolors = true

@ -0,0 +1,4 @@
set runtimepath^=~/.vim runtimepath+=~/.vim/after
let &packpath = &runtimepath
let g:python3_host_prog="/usr/bin/python3"
source ~/.vimrc

143
.vimrc

@ -1,6 +1,31 @@
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'
" 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 " general stuff
colorscheme delek colorscheme slate
let g:mapleader = "," let g:mapleader = ","
syntax on syntax on
@ -9,26 +34,120 @@ set smartcase " Include only uppercase words with uppercase search term
set hlsearch set hlsearch
set tabstop=2 set tabstop=2
set shiftwidth=2 set shiftwidth=2
set softtabstop=2 set softtabstop=4
set expandtab set expandtab
set scrolloff=5 " Scroll 5 lines from top/bottom set scrolloff=5 " Scroll 5 lines from top/bottom
set list " show tabs and EOL set list " show tabs and EOL
set listchars=tab:>>,trail:-,nbsp:+,eol:$
set number " Show line numbers set number " Show line numbers
set rnu " relative line numbers
set cursorline
" status line " status line
set laststatus=2 set laststatus=2
set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [POS=%l,%v][%p%%]\ [BUFFER=%n]\ %{strftime('%c')} " set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [POS=%l,%v][%p%%]\ [BUFFER=%n]
hi User1 ctermfg=cyan ctermbg=8
hi User2 ctermfg=green ctermbg=8
hi User3 ctermfg=yellow ctermbg=8
hi User4 ctermfg=white ctermbg=8
hi User5 ctermfg=green ctermbg=8
hi User6 ctermfg=red ctermbg=8
set statusline=
set statusline +=%1*\ %n\ %* "buffer number
set statusline +=%5*%{&ff}%* "file format
set statusline +=%3*%y%* "file type
set statusline +=%4*\ %<%F%* "full path
set statusline +=%6*%m%* "modified flag
set statusline +=%1*%=%5l%* "current line
set statusline +=%2*/%L%* "total lines
set statusline +=%3*\ %p%%%* "percentage of file
set statusline +=%1*%4v\ %* "virtual column number
set statusline +=%2*0x%04B\ %* "character under cursor
" add underscore to word delimiters
" set iskeyword-=_
" WSL Yank support " WSL Yank support
let s:clip = '/mnt/c/Windows/System32/clip.exe' " Copy to clipboard
if executable(s:clip) " set clipboard=unnamedplus
augroup WSLYank
autocmd! if system('uname -r') =~ "Microsoft"
autocmd TextYankPost * if v:event.operator ==# 'y' | call system(s:clip, @0) | endif augroup Yank
augroup END autocmd!
autocmd TextYankPost * :call system('/mnt/c/windows/system32/clip.exe ',@")
augroup END
endif
"map <silent> "=p :r !powershell.exe -Command Get-Clipboard<CR>
"map! <silent> <C-r>= :r !powershell.exe -Command Get-Clipboard<CR>
"noremap "+p :exe 'norm a'.system('/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe -Command Get-Clipboard')<CR>
" 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 <C-p> :Files<Cr>
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 endif
map <silent> "=p :r !powershell.exe -Command Get-Clipboard<CR> " generate pw?
map! <silent> <C-r>= :r !powershell.exe -Command Get-Clipboard<CR> " r! cmd.exe /c 'python C:\Tools\pw.py 10'
noremap "+p :exe 'norm a'.system('/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe -Command Get-Clipboard')<CR> " =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 <F8> "=system(pwcmd)<C-M>p
:imap <F8> <C-R>=system(pwcmd)<C-M>
" 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 <tab>' to make sure tab is not mapped by
" other plugin before putting this into your config
inoremap <silent><expr> <TAB>
\ coc#pum#visible() ? coc#pum#next(1) :
\ CheckBackspace() ? "\<Tab>" :
\ coc#refresh()
inoremap <expr><S-TAB> coc#pum#visible() ? coc#pum#prev(1) : "\<C-h>"
function! CheckBackspace() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~# '\s'
endfunction
" Make <CR> to accept selected completion item or notify coc.nvim to format
" <C-g>u breaks current undo, please make your own choice
inoremap <silent><expr> <CR> coc#pum#visible() ? coc#pum#confirm()
\: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
" bind code folding to space (in normal mode)
nnoremap <silent> <Space> @=(foldlevel('.')?'za':"\<Space>")<CR>
vnoremap <Space> zf
set foldmethod=indent
set foldnestmax=2
set foldlevel=1

@ -0,0 +1,22 @@
# machine specific configuration
export BROWSER='/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe'
alias devel='cd /mnt/c/devel'
alias desk='cd /mnt/c/Users/PankratzF/Desktop'
# mount network shares
mnt () {
sudo mount -t drvfs '\\wmnetapp01.auma.com\daten\users\PankratzF' /mnt/h
sudo mount -t drvfs '\\wmnetapp01.auma.com\daten' /mnt/l
sudo mount -t drvfs '\\wmnetapp01.auma.com\temp' /mnt/t
sudo mount -t drvfs '\\wmnetapp01.auma.com\software' /mnt/u
}
if [[ $UID -ne 0 ]]; then
# hello world
fortune -a | cowsay -f tux | head -n -1
## auma logo
figlet -k auma | tail -5 | head -4 | lolcat -t
fi

@ -47,7 +47,26 @@ set cursorline
" status line " status line
set laststatus=2 set laststatus=2
set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [POS=%l,%v][%p%%]\ [BUFFER=%n]\ %{FugitiveStatusline()} " set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [POS=%l,%v][%p%%]\ [BUFFER=%n]
hi User1 ctermfg=cyan ctermbg=8
hi User2 ctermfg=green ctermbg=8
hi User3 ctermfg=yellow ctermbg=8
hi User4 ctermfg=white ctermbg=8
hi User5 ctermfg=green ctermbg=8
hi User6 ctermfg=red ctermbg=8
set statusline=
set statusline +=%1*\ %n\ %* "buffer number
set statusline +=%5*%{&ff}%* "file format
set statusline +=%3*%y%* "file type
set statusline +=%4*\ %<%F%* "full path
set statusline +=%6*%m%* "modified flag
set statusline +=%1*%=%5l%* "current line
set statusline +=%2*/%L%* "total lines
set statusline +=%3*\ %p%%%* "percentage of file
set statusline +=%1*%4v\ %* "virtual column number
set statusline +=%2*0x%04B\ %* "character under cursor
" add underscore to word delimiters " add underscore to word delimiters
" set iskeyword-=_ " set iskeyword-=_

Loading…
Cancel
Save