diff --git a/.rvmrc b/.rvmrc new file mode 100644 index 00000000..72035cc4 --- /dev/null +++ b/.rvmrc @@ -0,0 +1 @@ +rvm_autoupdate_flag=2 diff --git a/.vimrc b/.vimrc new file mode 100755 index 00000000..ac86402f --- /dev/null +++ b/.vimrc @@ -0,0 +1,4 @@ +source ~/dev/dotfiles/.vimrc.settings +source ~/dev/dotfiles/.vimrc.plugins +source ~/dev/dotfiles/.vimrc.plugins-settings +source ~/dev/dotfiles/.vimrc.keymap diff --git a/.vimrc.common.epilogue b/.vimrc.common.epilogue deleted file mode 100644 index 8311bf1a..00000000 --- a/.vimrc.common.epilogue +++ /dev/null @@ -1,106 +0,0 @@ -call plug#end() - -let g:deoplete#enable_at_startup = 1 - -" line ending -set fileformats=unix,dos - -" colours -set t_Co=256 -syntax enable -set background=dark -highlight clear SignColumn -try - colorscheme solarized -catch /^Vim\%((\a\+)\)\=:E185/ - colorscheme desert -endtry - -" plugins: airline -let g:bufferline_echo = 0 -let g:airline_powerline_fonts = 1 -let g:airline#extensions#tabline#enabled = 1 - -" plugins: rust -let g:rustfmt_autosave = 1 - -if executable('ag') - let g:ackprg = 'ag --vimgrep' -endif - -if executable('rg') - let g:ackprg = 'rg --no-heading --vimgrep' - set grepprg=rg\ -i\ --vimgrep - - " Ripgrep on / - command! -nargs=+ -complete=file -bar Rg silent! grep! |cwindow|redraw! - nnoremap / :Rg -endif - -if executable('rls') - au User lsp_setup call lsp#register_server({ - \ 'name': 'rls', - \ 'cmd': {server_info->['rustup', 'run', 'nightly', 'rls']}, - \ 'whitelist': ['rust'], - \ }) - let g:lsp_signs_enabled = 1 " enable signs - let g:lsp_diagnostics_echo_cursor = 1 " enable echo under cursor when in normal mode - nnoremap d :LspDefinition - nnoremap r :LspReferences -endif - -" fzf -if executable('rg') - let $FZF_DEFAULT_COMMAND = 'rg --files --no-messages "" .' - set grepprg=rg\ --vimgrep -endif - -let g:fzf_command_prefix = 'Fzf' -if executable('fzf') - nnoremap v :FzfFiles - nnoremap u :FzfTags - nnoremap j :call fzf#vim#tags("'".expand('')) - - if executable('rg') - " :Find runs `rg ` and passes it to fzf - command! -bang -nargs=* Find call fzf#vim#grep('rg --column --line-number --no-heading --fixed-strings --ignore-case --no-ignore --hidden --follow --glob "!.git/*" --color "always" '.shellescape(), 1, 0) - nnoremap / :Find - nnoremap ' :execute "Find " . expand("") - endif -else - nnoremap v :CtrlP -endif - -" appearance -set number -set relativenumber -set laststatus=2 -set noshowmode -set showtabline=1 "only show tabline when more than 1 tab - -set statusline+=%#warningmsg# -set statusline+=%{SyntasticStatuslineFlag()} -set statusline+=%* - -" syntastic -let g:syntastic_always_populate_loc_list = 1 -let g:syntastic_aggregate_errors = 1 -let g:syntastic_auto_loc_list = 1 -let g:syntastic_check_on_open = 1 -let g:syntastic_check_on_wq = 0 - -let g:syntastic_rust_checkers=['cargo'] - -" language server -let g:LanguageClient_autoStart = 1 -let g:LanguageClient_serverCommands = { 'rust': ['rustup', 'run', 'nightly', 'rls'] } - -" exclude quickfix from the buffers list -augroup qf - autocmd! - autocmd FileType qf set nobuflisted -augroup END - -" vimdiff -set diffopt+=iwhite -set diffexpr="" diff --git a/.vimrc.common.prelude b/.vimrc.common.prelude deleted file mode 100644 index e7ba4d2a..00000000 --- a/.vimrc.common.prelude +++ /dev/null @@ -1,56 +0,0 @@ - -" global settings -set nocompatible -set noswapfile -set undofile -set undodir=$HOME/.vim/undo -set spell spelllang=en_gb - -" buffers can be switched despite having changes -set hidden - -" file settings -set encoding=utf-8 - -" key mappings -let mapleader = "," -nmap p :set paste! -nmap h :set hlsearch! -nmap t :wa :Make test - -" navigate buffers by ctrl-b -nmap :bprevious - -nnoremap ; : - -" no cheating ! -map -map -map -map - -" for damaged keyboards -map -imap - -" special chars -nmap l :set list! -set listchars=tab:▸\ ,eol:¬ -highlight NonText guifg=#4a4a59 -highlight SpecialKey guifg=#4a4a59 - -" tabs and spaces -set tabstop=4 -set softtabstop=4 -set shiftwidth=4 -set expandtab - -" plugins -if empty(glob('~/.vim/autoload/plug.vim')) - silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs - \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim - autocmd VimEnter * PlugInstall --sync | source $MYVIMRC -endif - -call plug#begin('~/.vim/plugged') - diff --git a/.vimrc.keymap b/.vimrc.keymap new file mode 100755 index 00000000..eea3eb3c --- /dev/null +++ b/.vimrc.keymap @@ -0,0 +1,30 @@ +" key mappings +let mapleader = "," +nmap p :set paste! +nmap h :set hlsearch! +nmap t :wa :Make test + +" navigate buffers by ctrl-b +nmap :bprevious + +nnoremap ; : + +" no cheating ! +map +map +map +map + +" for damaged keyboards +map +imap + +" special chars +nmap l :set list! + +" search +nnoremap v :FzfFiles +nnoremap u :FzfTags +nnoremap j :call fzf#vim#tags("'".expand('')) +nnoremap / :Find +nnoremap ' :execute "Find " . expand("") \ No newline at end of file diff --git a/.vimrc.linux b/.vimrc.linux deleted file mode 100755 index 5027e176..00000000 --- a/.vimrc.linux +++ /dev/null @@ -1,6 +0,0 @@ -source ~/dev/dotfiles/.vimrc.common.prelude -source ~/dev/dotfiles/.vimrc.common.plugins -source ~/dev/dotfiles/.vimrc.linux.plugins -source ~/dev/dotfiles/.vimrc.common.epilogue -source ~/dev/dotfiles/.vimrc.linux.settings - diff --git a/.vimrc.linux.plugins b/.vimrc.linux.plugins deleted file mode 100644 index e69de29b..00000000 diff --git a/.vimrc.linux.settings b/.vimrc.linux.settings deleted file mode 100644 index 189ebdcc..00000000 --- a/.vimrc.linux.settings +++ /dev/null @@ -1,3 +0,0 @@ -" YCM -nnoremap g :YcmCompleter GoTo - diff --git a/.vimrc.common.plugins b/.vimrc.plugins similarity index 70% rename from .vimrc.common.plugins rename to .vimrc.plugins index 6484a5fd..69bfcf3b 100644 --- a/.vimrc.common.plugins +++ b/.vimrc.plugins @@ -1,3 +1,12 @@ +" plugins +if empty(glob('~/.vim/autoload/plug.vim')) + silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs + \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim + autocmd VimEnter * PlugInstall --sync | source $MYVIMRC +endif + +call plug#begin('~/.vim/plugged') + Plug 'airblade/vim-gitgutter' Plug 'godlygeek/tabular' Plug 'https://github.com/cyplo/vim-colors-solarized.git' @@ -13,7 +22,6 @@ Plug 'prabirshrestha/vim-lsp' Plug 'roxma/nvim-yarp' Plug 'roxma/vim-hug-neovim-rpc' Plug 'rust-lang/rust.vim' -Plug 'Shougo/deoplete.nvim' Plug 'timonv/vim-cargo' Plug 'tpope/vim-cucumber' Plug 'tpope/vim-dispatch' @@ -22,5 +30,6 @@ Plug 'tpope/vim-sensible' Plug 'tpope/vim-surround' Plug 'vim-airline/vim-airline' Plug 'vim-airline/vim-airline-themes' -Plug 'vim-syntastic/syntastic' Plug 'will133/vim-dirdiff' + +call plug#end() \ No newline at end of file diff --git a/.vimrc.plugins-settings b/.vimrc.plugins-settings new file mode 100644 index 00000000..eb81a28c --- /dev/null +++ b/.vimrc.plugins-settings @@ -0,0 +1,24 @@ +" plugins: airline +let g:bufferline_echo = 0 +let g:airline_powerline_fonts = 1 +let g:airline#extensions#tabline#enabled = 1 + +" plugins: rust +let g:rustfmt_autosave = 1 + +" searching +let $FZF_DEFAULT_COMMAND = 'rg --files --no-messages "" .' +set grepprg=rg\ --vimgrep +let g:fzf_command_prefix = 'Fzf' + +" :Find runs `rg ` and passes it to fzf +command! -bang -nargs=* Find call fzf#vim#grep('rg --column --line-number --no-heading --fixed-strings --ignore-case --no-ignore --hidden --follow --glob "!.git/*" --color "always" '.shellescape(), 1, 0) + +" register rust rls +if executable('rls') + au User lsp_setup call lsp#register_server({ + \ 'name': 'rls', + \ 'cmd': {server_info->['rustup', 'run', 'stable', 'rls']}, + \ 'whitelist': ['rust'], + \ }) +endif diff --git a/.vimrc.settings b/.vimrc.settings new file mode 100755 index 00000000..561904b3 --- /dev/null +++ b/.vimrc.settings @@ -0,0 +1,54 @@ +" global settings +set nocompatible +set noswapfile +set undofile +set undodir=$HOME/.vim/undo +set spell spelllang=en_gb + +" buffers can be switched despite having changes +set hidden + +" file settings +set encoding=utf-8 + +" special chars +set listchars=tab:▸\ ,eol:¬ +highlight NonText guifg=#4a4a59 +highlight SpecialKey guifg=#4a4a59 + +" tabs and spaces +set tabstop=4 +set softtabstop=4 +set shiftwidth=4 +set expandtab + +" line ending +set fileformats=unix,dos + +" colours +set t_Co=256 +syntax enable +set background=dark +highlight clear SignColumn +try + colorscheme solarized +catch /^Vim\%((\a\+)\)\=:E185/ + colorscheme desert +endtry + +" appearance +set number +set relativenumber +set laststatus=2 +set noshowmode +set showtabline=1 "only show tabline when more than 1 tab + +" exclude quickfix from the buffers list +augroup qf + autocmd! + autocmd FileType qf set nobuflisted +augroup END + +" vimdiff +set diffopt+=iwhite +set diffexpr="" \ No newline at end of file diff --git a/common/configure_fresh_system.sh b/common/configure_fresh_system.sh index b4d2d353..c34be627 100755 --- a/common/configure_fresh_system.sh +++ b/common/configure_fresh_system.sh @@ -37,7 +37,8 @@ git submodule update --init --recursive #configs ln -vfs "$DIR/.vim" ~/. ln -vfs "$DIR/.ideavimrc" ~/. -ln -vfs "$DIR/.vimrc.linux" ~/.vimrc +ln -vfs "$DIR/.vimrc" ~/.vimrc +ln -vfs "$DIR/.rvmrc" ~/.rvmrc ln -vfs "$DIR/.tmux.conf" ~/. ln -vfs "$DIR/.tmux.macosx" ~/. rm -f "~/.zshrc" diff --git a/fedora/up.sh b/fedora/up.sh index 3f741a2f..87bc4740 100755 --- a/fedora/up.sh +++ b/fedora/up.sh @@ -6,7 +6,7 @@ if [[ -z $NOUPGRADE ]]; then sudo dnf -y upgrade --best --allowerasing fi -sudo dnf -y --best --allowerasing install tmux atop zsh firefox aria2 gajim lm_sensors freecad python3-pip qt5-qtbase-devel qt5-qtwebkit-devel meld whois curl pv nodejs npm terminator gsmartcontrol python-pip mercurial python3-devel libxslt-devel libjpeg-turbo-devel conky conky-manager cmake gtk2-devel intltool gparted wine solaar glances the_silver_searcher dkms kernel-devel gimp transmission-gtk git xz util-linux-user powertop dnf-automatic kdiff3 yum-utils util-linux-user ncurses-devel zeal qt5-linguist qtkeychain-qt5-devel archivemount keepass splix gutenprint-cups cups-bjnp golang redhat-rpm-config pcsc-lite-devel pcsc-tools pcsc-lite yubico-piv-tool yubikey-personalization-gui xloadimage yp-tools closure-compiler optipng jpegoptim grub2 grub2-efi dracut dracut-tools openssl-devel fail2ban syncthing ansible gnome-tweaks xclip wget +sudo dnf -y --best --allowerasing install tmux atop zsh firefox aria2 gajim lm_sensors freecad python3-pip qt5-qtbase-devel qt5-qtwebkit-devel meld whois curl pv nodejs npm terminator gsmartcontrol python-pip mercurial python3-devel libxslt-devel libjpeg-turbo-devel conky conky-manager cmake gtk2-devel intltool gparted wine solaar glances the_silver_searcher dkms kernel-devel gimp transmission-gtk git xz util-linux-user dnf-automatic kdiff3 yum-utils util-linux-user ncurses-devel zeal qt5-linguist qtkeychain-qt5-devel archivemount keepass splix gutenprint-cups cups-bjnp golang redhat-rpm-config pcsc-lite-devel pcsc-tools pcsc-lite yubico-piv-tool yubikey-personalization-gui xloadimage yp-tools closure-compiler optipng jpegoptim grub2 grub2-efi dracut dracut-tools openssl-devel fail2ban syncthing ansible gnome-tweaks xclip wget sudo dnf -y install docker @@ -62,8 +62,6 @@ if [[ -z $NO_SYSTEMCTL ]]; then sudo systemctl restart dnf-automatic-install.timer sudo systemctl enable fstrim.timer sudo systemctl restart fstrim.timer - sudo systemctl enable powertop - sudo systemctl restart powertop sudo systemctl enable --now syncthing@cyryl.service sudo systemctl list-timers fi