diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua new file mode 100644 index 0000000..3106e7d --- /dev/null +++ b/.config/nvim/init.lua @@ -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 + + diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim new file mode 100644 index 0000000..1a1ced3 --- /dev/null +++ b/.config/nvim/init.vim @@ -0,0 +1,4 @@ +set runtimepath^=~/.vim runtimepath+=~/.vim/after +let &packpath = &runtimepath +let g:python3_host_prog="/usr/bin/python3" +source ~/.vimrc diff --git a/.vimrc b/.vimrc index 424f335..83a6b81 100644 --- a/.vimrc +++ b/.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 -colorscheme delek +colorscheme slate let g:mapleader = "," syntax on @@ -9,26 +34,120 @@ set smartcase " Include only uppercase words with uppercase search term set hlsearch set tabstop=2 set shiftwidth=2 -set softtabstop=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]\ %{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 -let s:clip = '/mnt/c/Windows/System32/clip.exe' -if executable(s:clip) - augroup WSLYank - autocmd! - autocmd TextYankPost * if v:event.operator ==# 'y' | call system(s:clip, @0) | endif - augroup END + " 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 -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') +" 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 diff --git a/.zsh/MULPC1624.zsh b/.zsh/MULPC1624.zsh new file mode 100644 index 0000000..15c41a9 --- /dev/null +++ b/.zsh/MULPC1624.zsh @@ -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 + diff --git a/nvimrc b/nvimrc index e6f950b..62258ae 100755 --- a/nvimrc +++ b/nvimrc @@ -47,7 +47,26 @@ 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()} +" 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-=_