From faea512d46da67393036431931fe562dd314e197 Mon Sep 17 00:00:00 2001 From: Taylor Bockman Date: Mon, 17 Oct 2022 22:16:39 -0700 Subject: [PATCH] Update python and plugins. --- README.md | 35 ++++++++++++++++++++++++++++------- conf/langs/python.vim | 10 ++++++++-- conf/plugins.vim | 12 ++++++++++++ 3 files changed, 48 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 2a083ba..a291cbb 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# Vim Configuration +# Neovim Configuration -This is V2 of my vim configuration, designed for Neovim, broken out into +This is V2 of my Vim configuration, designed for Neovim, broken out into it's own repository for easier cloning without pulling down the entire `essentials` repository. @@ -19,6 +19,12 @@ through the use of `vimux`. 4. `node` - Certain plugins require node to work. Install it with your package manager. 5. `tmux` +For Python editing: + +1. [Neovim](https://github.com/neovim/neovim) compiled with Python support. +2. Python +3. `pip install neovim && pip3 install neovim` in your global environment. + ## Structure * `conf`: Contains all configuration related files. @@ -28,10 +34,7 @@ through the use of `vimux`. * `ui.vim`: General UI configurations. * `search.vim`: Search configurations (for example ctrl-p). * `git.vim`: Fugitive configurations. - * `langs`: Language specific configurations and keybinds. These files diverge - from the standard structure slightly. Plugins for each language can be defined - in these files, as well as keybinds and configurations. This was done to keep editing for - a single language to one place. + * `langs`: Language specific configurations and keybinds. ## Installation @@ -45,7 +48,7 @@ is no autodetect on a changed `plugin.vim`. ## Language Support -Support for `C`, `C++`, `Python`, `Haskell`, and `OCaml` is installed. To add your own configurations you can +Languages supported can be found in the `conf/langs` directory. To add more languages you can create a file in the same form as those found in `conf/langs/` and place it in the `conf/langs/` folder. It will be autoloaded. @@ -54,8 +57,26 @@ any order based on directory structure). However, if you followed the structure in the correct files, those will be loaded *BEFORE* the languages and so you shouldn't run into (too many) order issues. This may be patched in the future. +### Python + +Pyenv support is added via [vim-pyenv](http://github.com/lambdalisue/vim-pyenv). `:PyenvActivate` can be used to +activate a given environment. + +The file `conf/langs/python.vim` contains formatting code typical of a Python project (4 space indents, etc). If you +wish to adjust this you can do that here, or make modifications on a per-project basis. + ## Other Notes +### Help + +You can type `:help ` (for example `:help vim-pyenv`) to read the documentation. + +### Autocompletion + +Autocompletion is provided by [coc](https://github.com/neoclide/coc.nvim). You will need to install `nodejs` >= 14.14: + +`curl -sL install-node.vercel.app/lts | bash` and then restart Neovim. + ### Default Leader The default leader is the space key. diff --git a/conf/langs/python.vim b/conf/langs/python.vim index b9a109e..b6d5b12 100644 --- a/conf/langs/python.vim +++ b/conf/langs/python.vim @@ -1,3 +1,9 @@ -" Python configurations, plugins, etc. - +" Python configurations +"" Set Python standard formatting. +au BufNewFile,BufRead *.py + \ set expandtab |" replace tabs with spaces + \ set autoindent |" copy indent when starting a new line + \ set tabstop=4 + \ set softtabstop=4 + \ set shiftwidth=4 diff --git a/conf/plugins.vim b/conf/plugins.vim index 620e91d..377a8c0 100644 --- a/conf/plugins.vim +++ b/conf/plugins.vim @@ -49,4 +49,16 @@ Plug 'jceb/vim-orgmode' "" Commands Plug 'skywind3000/asyncrun.vim' +"" Syntax highlighting +Plug 'sheerun/vim-polyglot' + +"" Languages + +""""""""""""""""""""""""" +" Python +""""""""""""""""""""""""" + +"" Pyenv Support +Plug 'lambdalisue/vim-pyenv' + call plug#end()