diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..f3e93ae --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "Vundle.vim"] + path = Vundle.vim + url = https://github.com/VundleVim/Vundle.vim.git diff --git a/.vimrc b/.vimrc index ce3a242..dbaf145 100644 --- a/.vimrc +++ b/.vimrc @@ -2,56 +2,57 @@ set nocompatible " Plugins -------------------------------------------------------------------{{{ " 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' - - Plugin 'dense-analysis/ale' " asynchronous linting engine - Plugin 'tpope/vim-fugitive' " integration with the git cli - Plugin 'tpope/vim-surround' " edits surrounding quotes and parens and the like - Plugin 'tpope/vim-rails' " rails project management stuff - Plugin 'tpope/vim-repeat' " fixes the . key for ...something - " Plugin 'airblade/vim-gitgutter' " in-file git integration - Plugin 'mhinz/vim-signify' - Plugin 'slim-template/vim-slim' " what in the 2008 is this - Plugin 'kchmck/vim-coffee-script' " lol coffee script - Plugin 'fatih/vim-go' " all-in-one Go tools - Plugin 'fatih/vim-hclfmt' " nicely formats hcl files - Plugin 'nanotech/jellybeans.vim' " the best colorscheme - Plugin 'ervandew/supertab' " makes tab better apparently - Plugin 'scrooloose/nerdcommenter' " no idea if I'm even using this - Plugin 'scrooloose/nerdtree' " better file navigation - Plugin 'Align' " aligns things on demand - Plugin 'tomtom/tlib_vim' " dependency of flashdevelop - Plugin 'endel/flashdevelop.vim' " this is probably old now - Plugin 'ctrlpvim/ctrlp.vim' " don't actually know how to use this honestly - Plugin 'itchyny/lightline.vim' " fancy status line - Plugin 'heavenshell/vim-jsdoc' " js docs? - Plugin 'hashivim/vim-terraform' " hclfmt but for terraform - Plugin 'b4b4r07/vim-hcl' " hcl syntax stuff? - Plugin 'Glench/Vim-Jinja2-Syntax' " jinja2 syntax stuff - Plugin 'rust-lang/rust.vim' " bare minimum rust syntax stuff - Plugin 'elubow/cql-vim' - - " Past plugins - " - " Seems to break NERDTree. I dunno why. Kinda problematic since it's - " intended to improve NERDTree. - " Plugin 'Xuyuanp/nerdtree-git-plugin' - " - " Still figuring this one out. I think I hate it? - " Plugin 'neoclide/coc.nvim' - " - " this repo is gone - " Plugin 'calviken/vim-gdscript3' - " - " I'm trying ALE instead - " Plugin 'ycm-core/YouCompleteMe' - " Plugin 'prabirshrestha/vim-lsp' - " Plugin 'mattn/vim-lsp-settings' -call vundle#end() " required +if !has('nvim') + set rtp+=~/.vim/bundle/Vundle.vim + call vundle#begin() + " let Vundle manage Vundle, required + Plugin 'VundleVim/Vundle.vim' + + Plugin 'dense-analysis/ale' " asynchronous linting engine + Plugin 'tpope/vim-fugitive' " integration with the git cli + Plugin 'tpope/vim-surround' " edits surrounding quotes and parens and the like + Plugin 'tpope/vim-rails' " rails project management stuff + Plugin 'tpope/vim-repeat' " fixes the . key for ...something + " Plugin 'airblade/vim-gitgutter' " in-file git integration + Plugin 'mhinz/vim-signify' + Plugin 'slim-template/vim-slim' " what in the 2008 is this + Plugin 'kchmck/vim-coffee-script' " lol coffee script + Plugin 'fatih/vim-go' " all-in-one Go tools + Plugin 'fatih/vim-hclfmt' " nicely formats hcl files + Plugin 'nanotech/jellybeans.vim' " the best colorscheme + Plugin 'ervandew/supertab' " makes tab better apparently + Plugin 'scrooloose/nerdcommenter' " no idea if I'm even using this + Plugin 'scrooloose/nerdtree' " better file navigation + Plugin 'Align' " aligns things on demand + Plugin 'tomtom/tlib_vim' " dependency of flashdevelop + Plugin 'endel/flashdevelop.vim' " this is probably old now + Plugin 'ctrlpvim/ctrlp.vim' " don't actually know how to use this honestly + Plugin 'itchyny/lightline.vim' " fancy status line + Plugin 'heavenshell/vim-jsdoc' " js docs? + Plugin 'hashivim/vim-terraform' " hclfmt but for terraform + Plugin 'b4b4r07/vim-hcl' " hcl syntax stuff? + Plugin 'Glench/Vim-Jinja2-Syntax' " jinja2 syntax stuff + Plugin 'rust-lang/rust.vim' " bare minimum rust syntax stuff + Plugin 'elubow/cql-vim' + + " Past plugins + " + " Seems to break NERDTree. I dunno why. Kinda problematic since it's + " intended to improve NERDTree. + " Plugin 'Xuyuanp/nerdtree-git-plugin' + " + " Still figuring this one out. I think I hate it? + " Plugin 'neoclide/coc.nvim' + " + " this repo is gone + " Plugin 'calviken/vim-gdscript3' + " + " I'm trying ALE instead + " Plugin 'ycm-core/YouCompleteMe' + " Plugin 'prabirshrestha/vim-lsp' + " Plugin 'mattn/vim-lsp-settings' + call vundle#end() " required +endif " enable the filetype plugin filetype plugin indent on @@ -230,7 +231,9 @@ if has("autocmd") autocmd FileType php set omnifunc=phpcomplete#CompletePHP autocmd FileType python set omnifunc=pythoncomplete#Complete autocmd FileType css set omnifunc=csscomplete#CompleteCSS - autocmd FileType rust set omnifunc=ale#completion#OmniFunc + if !has('nvim') + autocmd FileType rust set omnifunc=ale#completion#OmniFunc + endif " causes VIM to enter the directory of the file being edited to simplify " finding related files. @@ -400,7 +403,9 @@ let g:terminal_ansi_colors = [ \ '#ffffff' \ ] -autocmd TerminalOpen * set nonu +if !has('nvim') + autocmd TerminalOpen * set nonu +endif highlight Terminal guibg='#0c0c0c' highlight Terminal guifg='#cccccc' @@ -459,13 +464,15 @@ let g:SuperTabClosePreviewOnPopupClose = 1 " ---------------------------------------------------------------------------}}} " ALE -----------------------------------------------------------------------{{{ -let g:ale_linters = {'rust': ['analyzer']} -let g:ale_fixers = {'rust': ['rustfmt', 'trim_whitespace', 'remove_trailing_lines']} -let g:rustfmt_autosave = 1 -let g:ale_rust_analyzer_executable = "/home/jorelli/analyzer-spy" -let g:ale_rust_cargo_use_clippy = executable('cargo-clippy') -let g:ale_completion_enabled = 1 -set completeopt=menu,menuone,preview,noselect,noinsert +if !has('nvim') + let g:ale_linters = {'rust': ['analyzer']} + let g:ale_fixers = {'rust': ['rustfmt', 'trim_whitespace', 'remove_trailing_lines']} + let g:rustfmt_autosave = 1 + let g:ale_rust_analyzer_executable = "/home/jorelli/analyzer-spy" + let g:ale_rust_cargo_use_clippy = executable('cargo-clippy') + let g:ale_completion_enabled = 1 + set completeopt=menu,menuone,preview,noselect,noinsert +endif " ---------------------------------------------------------------------------}}} " CtrlP ---------------------------------------------------------------------{{{ diff --git a/README.md b/README.md new file mode 100644 index 0000000..15c5755 --- /dev/null +++ b/README.md @@ -0,0 +1,24 @@ +# dotfiles + +my preferences files + +## setup + +The way this repo is setup is that the .dotfiles directory is expected to be +the authoritative storage of all of the preferences file on a given machine. +The `install` script creates the necessary symlinks for these preference files +to be seen by the appropriate applications. + +## sharing between WSL and Windows + +If you want to use this repo to manage the preferences file of both a WSL +instance and its Windows host, clone this repo on WSL and then symlink the +directory into the home directory of the Windows host like so: + + C:\Users\Name>mklink /D .dotfiles \\wsl$\instance\home\name\.dotfiles + +You can then navigate into the Linux directory from Windows, either on the +command line or in Explorer.exe. Using an administrator shell, run the install +script from the Windows side. Windows requires admin privileges in order to +make symbolic links, so you need an admin shell to register new links on +Windows. diff --git a/Vundle.vim b/Vundle.vim new file mode 160000 index 0000000..b255382 --- /dev/null +++ b/Vundle.vim @@ -0,0 +1 @@ +Subproject commit b255382d6242d7ea3877bf059d2934125e0c4d95 diff --git a/config.ini b/config.ini index c5a0943..d4ffe37 100644 --- a/config.ini +++ b/config.ini @@ -24,3 +24,4 @@ nvim/init.vim=.config/nvim/init.vim # placed on windows, relative to the user's home directory [map.windows] nvim/init.vim=AppData/Local/nvim/init.vim +Vundle.vim=AppData/Local/nvim/bundle/Vundle.vim diff --git a/include.json b/include.json deleted file mode 100644 index e68c258..0000000 --- a/include.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "home_files": [ - ".bash_profile", - ".bashrc", - ".screenrc", - ".tmux.conf", - ".vimrc", - ".config/htop/htoprc", - ".config/lazydocker/config.yml" - ], - "home_dirs": [ - ".vim/pack", - ".vim/ftplugin" - ] -} diff --git a/installer/__init__.py b/installer/__init__.py index ff4e228..c0a1552 100644 --- a/installer/__init__.py +++ b/installer/__init__.py @@ -66,7 +66,7 @@ class Installer: print(f"source path: {source_path}") print(f"source drive: {source_path.drive}") if not source_path.exists(): - print('skip: no such file') + print("skip: no such file\n") return for target in self.targets: diff --git a/installer/options.py b/installer/options.py index 9b07a94..7c7ebf3 100644 --- a/installer/options.py +++ b/installer/options.py @@ -70,5 +70,7 @@ class Options: with open(path, 'r', encoding='utf-8') as config_file: parser = configparser.ConfigParser() + # make keys case-sensitive + parser.optionxform = str parser.read_file(config_file) self._config = parser diff --git a/installer/targets.py b/installer/targets.py index 0e3bd81..0c2da59 100644 --- a/installer/targets.py +++ b/installer/targets.py @@ -53,7 +53,7 @@ class Target: if target_path.is_symlink(): print("target path is symlink") if target_path.resolve() == source_path: - print("symlink is up to date") + print("symlink is up to date\n") return print("removing out of date symlink") target_path.unlink() @@ -61,7 +61,7 @@ class Target: print("removing existing regular file") target_path.unlink() elif target_path.is_dir(): - print("skip: target path is existing directory") + print("skip: target path is existing directory\n") return else: print("skip: target path already exists") @@ -77,6 +77,7 @@ class Target: target_path.unlink() print("creating symlink") target_path.symlink_to(source_path) + print("") class Linux(Target): """ @@ -146,3 +147,4 @@ class WSLHost(Target): print("target path does not exist") print("copying file to target") clone(source_path, target_path) + print("") diff --git a/nvim/init.vim b/nvim/init.vim index f182e5b..f409f33 100644 --- a/nvim/init.vim +++ b/nvim/init.vim @@ -1,3 +1,34 @@ +set nocompatible + +filetype off + +if has('win32') + set rtp+=~/AppData/Local/nvim/bundle/Vundle.vim +else + " set the runtime path to include Vundle and initialize + set rtp+=~/.vim/bundle/Vundle.vim +endif + +call vundle#begin() + " let Vundle manage Vundle, required + Plugin 'VundleVim/Vundle.vim' + Plugin 'tpope/vim-fugitive' " integration with the git cli + Plugin 'tpope/vim-surround' " edits surrounding quotes and parens and the like + Plugin 'mhinz/vim-signify' + Plugin 'fatih/vim-go' " all-in-one Go tools + Plugin 'fatih/vim-hclfmt' " nicely formats hcl files + Plugin 'nanotech/jellybeans.vim' " the best colorscheme + Plugin 'ervandew/supertab' " makes tab better apparently + Plugin 'scrooloose/nerdcommenter' " no idea if I'm even using this + Plugin 'scrooloose/nerdtree' " better file navigation + Plugin 'Align' " aligns things on demand + Plugin 'itchyny/lightline.vim' " fancy status line + Plugin 'hashivim/vim-terraform' " hclfmt but for terraform + Plugin 'Glench/Vim-Jinja2-Syntax' " jinja2 syntax stuff + Plugin 'rust-lang/rust.vim' " bare minimum rust syntax stuff +call vundle#end() + set runtimepath^=~/.vim runtimepath+=~/.vim/after let &packpath = &runtimepath +filetype plugin indent on source ~/.vimrc