|
# Налаштування Atom IDE Haskell |
|
З *SublimeHaskell* щось не виходить, вирішив спробувати перемкнутися на *Atom IDE*, вивчаю і переглядаю [залежності](https://atom-haskell.github.io/overview/requirements/): |
|
|
|
- [stylish-haskell](https://github.com/jaspervdj/stylish-haskell), був встановлений, тільки зробив конфігураційний файл в домашньому каталозі< |
|
|
|
```bash |
|
stylish-haskell --defaults > ~/.stylish-haskell.yaml |
|
``` |
|
|
|
- [hindent](https://github.com/commercialhaskell/hindent) вже треба було встановлювати. |
|
Виявилося, що через те, що я налагоджував [`gcc' failed in phase `C Compiler'](https://stackoverflow.com/questions/50386787/cabal-install-gcc-failed-in-phase-c-compiler/50419101#50419101) вручну, то інсталятор визначив це як помилку і проігнорував конфігураційний файл. |
|
- - [ ] потрібно в цьому розібратися і налаштувати потім. |
|
|
|
|
|
```bash |
|
stack install hindent |
|
Warning: /Users/searge/Code/Haskell/Haskell.cabal was modified manually. Ignoring |
|
/Users/searge/Code/Haskell/package.yaml in favor of the cabal file. If you want to use the package.yaml file |
|
instead of the cabal file, then please delete the cabal file. |
|
|
|
... |
|
|
|
hindent --help |
|
hindent --version --help --style STYLE --line-length <...> (--indent-size <...>|--tab-size <...>) --no-force-newline (--sort-imports|--no-sort-imports) [-X<...>]* --validate [<FILENAME>] |
|
Version 5.2.5 |
|
Default --indent-size is 2. Specify --indent-size 4 if you prefer that. |
|
-X to pass extensions e.g. -XMagicHash etc. |
|
The --style option is now ignored, but preserved for backwards-compatibility. |
|
Johan Tibell is the default and only style. |
|
``` |
|
|
|
- [brittany](https://github.com/lspitzner/brittany) _(haskell source code formatter)_ в принципі встановився так само як і попередній пакунок, через `stack`, хоча на GitHubi є варіанти і з `cabal`. Також, у автора є [цікавий Gist](https://gist.github.com/lspitzner/097c33177248a65e7657f0c6d0d12075), наскільки я зрозумів, він пропагує забити на SublimeHaskell |
|
- - [ ] потім спробувати. |
|
|
|
```bash |
|
stack install brittany |
|
|
|
Warning: /Users/searge/Code/Haskell/Haskell.cabal was modified manually. Ignoring |
|
/Users/searge/Code/Haskell/package.yaml in favor of the cabal file. If you want to use the package.yaml file |
|
instead of the cabal file, then please delete the cabal file. |
|
... |
|
❯ brittany --version |
|
brittany version 0.9.0.1 |
|
Copyright (C) 2016-2017 Lennart Spitzner |
|
There is NO WARRANTY, to the extent permitted by law. |
|
|
|
~/Code/Haskell |
|
❯ brittany --help |
|
NAME |
|
|
|
brittany - haskell source pretty printer |
|
... |
|
``` |
|
|
|
- [ghc-mod](https://github.com/DanielG/ghc-mod) -- а от з ним не все так просто, `stack` видає наступне: |
|
|
|
```bash |
|
❯ stack install ghc-mod |
|
|
|
Warning: /Users/searge/Code/Haskell/Haskell.cabal was modified manually. Ignoring |
|
/Users/searge/Code/Haskell/package.yaml in favor of the cabal file. If you want to use the package.yaml file |
|
instead of the cabal file, then please delete the cabal file. |
|
|
|
Error: While constructing the build plan, the following exceptions were encountered: |
|
|
|
In the dependencies for ghc-mod-5.8.0.0: |
|
Cabal-2.0.1.1 from stack configuration does not match >=1.18 && <1.25 (latest matching version is 1.24.2.0) |
|
base-4.10.1.0 from stack configuration does not match >=4.6.0.1 && <4.10 (latest matching version is 4.9.1.0) |
|
cabal-helper must match <0.8 && >=0.7.3.0, but the stack configuration has no specified version (latest matching |
|
version is 0.7.3.0) |
|
extra-1.6.6 from stack configuration does not match <1.6 && >=1.4 (latest matching version is 1.5.3) |
|
ghc-8.2.2 from stack configuration does not match >=7.6 && <8.2 |
|
haskell-src-exts-1.20.2 from stack configuration does not match <1.20 && >=1.18 (latest matching version is 1.19.1) |
|
hlint-2.1.5 from stack configuration does not match <2.1 && >=2.0.8 (latest matching version is 2.0.15) |
|
monad-journal-0.8.1 from stack configuration does not match <0.8 && >=0.4 (latest matching version is 0.7.2) |
|
optparse-applicative-0.14.2.0 from stack configuration does not match >=0.13.0.0 && <0.14 (latest matching version |
|
is 0.13.2.0) |
|
needed since ghc-mod is a build target. |
|
``` |
|
|
|
Практично те саме, що й з попереднім... |
|
|
|
// перекур... |
|
--- |
|
> Надоїло все, пробую з'ясувати, чи можна налаштувати Haskell так, щоб ці залежності не вискакували одна за одною... |
|
|
|
Видалив Haskell, пробую знайти старішу версію, яка працюватиме зі всіма пакетами. |
|
|
|
```bash |
|
❯ sudo uninstall-hs thru 8.4.2 --remove |
|
-- Removing version 8.4.2 and earlier |
|
** /Library/Haskell is not empty, but has no more versions. Consider removing. |
|
``` |
|
|
|
Завантажую [Haskell Platform 8.2.1 Full 64bit](https://www.haskell.org/platform/prior.html). В `ghc-mod` необхідна версія `cabal-install version 1.24.0.2` вихід спробувати щось таке: |
|
```bash |
|
cabal install 'cabal-install >=1.18 && <1.25' |
|
|
|
********************************************************************** |
|
|
|
=== Configuration for cabal has been written to |
|
/Users/searge/.cabal/config |
|
|
|
=== Executables will be installed in: |
|
/Users/searge/Library/Haskell/bin |
|
|
|
You may wish to place this on your PATH by adding the following |
|
line to your ~/.bash_profile: |
|
|
|
export PATH="$HOME/Library/Haskell/bin:$PATH" |
|
|
|
=== When documentation is built, a master index to all documentation |
|
will be placed in: |
|
|
|
/Users/searge/Library/Haskell/doc/index.html |
|
|
|
You may wish to bookmark that file once it gets built (after the |
|
first cabal install). |
|
|
|
********************************************************************** |
|
|
|
Updating documentation index |
|
/Users/searge/Library/Haskell/share/doc/x86_64-osx-ghc-8.2.1/index.html |
|
|
|
~ 20m 51s |
|
|
|
❯ cabal --version |
|
cabal-install version 2.0.0.0 |
|
compiled using version 2.0.0.2 of the Cabal library |
|
``` |
|
|
|
> By default, any dependencies of the package are installed into the global or user package databases (e.g. using cabal install --only-dependencies). If you’re building several different packages that have incompatible dependencies, this can cause the build to fail. One way to avoid this problem is to build each package in an isolated environment (“sandbox”), with a sandbox-local package database. Because sandboxes are per-project, inconsistent dependencies can be simply disallowed. |
|
|
|
> For more on sandboxes, see also [this article](http://coldwa.st/e/blog/2013-08-20-Cabal-sandbox.html). |
|
|
|
|
|
Знайшов кілька цікавих ресурсів: |
|
|
|
- [Використовуйте Stack для початку роботи](https://github.com/bitemyapp/learnhaskell/blob/master/guide-ua.md#Використовуйте-stack-для-початку-роботи-з-haskell) |
|
- [Чому це важливо](https://mail.haskell.org/pipermail/haskell-community/2015-September/000014.html) |
|
- [Прощай, cabal. Здравствуй, stack!](https://ruhaskell.org/posts/utils/2015/07/13/from-cabal-to-stack.html) |
|
|
|
Усі ці данні трохи застарілі, але на всякий випадок знову видалив `Haskell Platform` через: |
|
|
|
```bash |
|
❯ sudo uninstall-hs thru 8.2.1 -s |
|
echo -- Removing version 8.2.1 and earlier |
|
rm -rf /Library/Frameworks/GHC.framework/Versions/8.2.1-x86_64 |
|
rm -rf /Library/Haskell/ghc-8.2.1-x86_64 |
|
rm -rf /Users/searge/.ghc/x86_64-darwin-8.2.1 |
|
rm -rf /Users/searge/Library/Haskell/ghc-8.2.1-x86_64 |
|
rm -f /usr/local/bin/activate-hs |
|
rm -f /usr/local/bin/alex |
|
rm -f /usr/local/bin/cabal |
|
rm -f /usr/local/bin/cabal.real |
|
rm -f /usr/local/bin/cabal.wrap |
|
rm -f /usr/local/bin/ghc |
|
rm -f /usr/local/bin/ghc-8.2.1 |
|
rm -f /usr/local/bin/ghc-clang-wrapper |
|
rm -f /usr/local/bin/ghc-pkg |
|
rm -f /usr/local/bin/ghc-pkg-8.2.1 |
|
rm -f /usr/local/bin/ghci |
|
rm -f /usr/local/bin/ghci-8.2.1 |
|
rm -f /usr/local/bin/haddock |
|
rm -f /usr/local/bin/haddock-ghc-8.2.1 |
|
rm -f /usr/local/bin/happy |
|
rm -f /usr/local/bin/hp2ps |
|
rm -f /usr/local/bin/hpc |
|
rm -f /usr/local/bin/hsc2hs |
|
rm -f /usr/local/bin/HsColour |
|
rm -f /usr/local/bin/runghc |
|
rm -f /usr/local/bin/runghc-8.2.1 |
|
rm -f /usr/local/bin/runhaskell |
|
rm -f /usr/local/bin/stack |
|
rm -f /usr/local/bin/uninstall-hs |
|
rm -rf /Library/Frameworks/GHC.framework |
|
rm -f /Library/Haskell/current |
|
echo ** /Library/Haskell is not empty, but has no more versions. Consider removing. |
|
``` |
|
|
|
Найсмішніше, що хоч тут написано: `rm -f /usr/local/bin/stack`, банальна перевірка показує: |
|
|
|
```bash |
|
❯ stack --version |
|
Version 1.7.1, Git revision 681c800873816c022739ca7ed14755e85a579565 (5807 commits) x86_64 hpack-0.28.2 |
|
|
|
❯ cabal --version |
|
cabal-install version 1.24.0.2 |
|
compiled using version 1.24.2.0 of the Cabal library |
|
``` |
|
|
|
Зробив: `❯ sudo uninstall-hs thru 8.2.1 --remove`, тепер все видалено крім кабалу і стеку. |
|
|
|
Спробував: |
|
|
|
```bash |
|
❯ stack uninstall |
|
|
|
Error: stack does not manage installations in global locations. The only global mutation stack |
|
performs is executable copying. For the default executable destination, please run |
|
stack path --local-bin |
|
|
|
~ |
|
❯ stack path --local-bin |
|
Writing implicit global project config file to: /Users/searge/.stack/global-project/stack.yaml |
|
Note: You can change the snapshot via the resolver field there. |
|
Using latest snapshot resolver: lts-11.10 |
|
Downloaded lts-11.10 build plan. |
|
Preparing to install GHC to an isolated location. |
|
This will not interfere with any system-level installation. |
|
Downloaded ghc-8.2.2. |
|
Installed GHC. |
|
Selected mirror https://s3.amazonaws.com/hackage.fpcomplete.com/ |
|
Downloading root |
|
Selected mirror https://s3.amazonaws.com/hackage.fpcomplete.com/ |
|
Downloading timestamp |
|
Downloading snapshot |
|
Downloading mirrors |
|
Cannot update index (no local copy) |
|
Downloading index |
|
Updated package index downloaded |
|
Update complete |
|
Populated index cache. |
|
/Users/searge/.local/bin |
|
|
|
~ 7m 40s |
|
~/.local/bin |
|
❯ ls -aH |
|
. .. brittany hindent hsdev stack |
|
``` |
|
|
|
|
|
Видалення [кабалу](https://gist.github.com/begriffs/6408415): |
|
```sh |
|
rm -fr ~/.ghc |
|
rm -fr ~/Library/Haskell/*/lib |
|
rm -fr ~/Library/Haskell/bin/* |
|
rm -fr ~/Library/Haskell/repo-cache |
|
rm -fr ~/.cabal/packages |
|
|
|
# Then in your project |
|
# rm -fr .hsenv |
|
``` |
|
|
|
Видалення [стеку](https://www.reddit.com/r/haskell/comments/6z06ih/how_to_uninstall_stack/dmrm08t/): |
|
|
|
```sh |
|
rm -dfr .stack .stylish-haskell.yaml |
|
rm -fr ~/.local/bin/* |
|
``` |
|
|
|
Нарешті перевірка дала результат: |
|
|
|
```zsh |
|
❯ cabal --version |
|
zsh: command not found: cabal |
|
|
|
~ |
|
❯ stack --version |
|
zsh: command not found: stack |
|
``` |
|
|
|
Йдемо дивитися видиво. |
|
|
|
Вирішив використати цю формулу з оф. сайту, замість homebrew: |
|
|
|
```zsh |
|
curl -sSL https://get.haskellstack.org/ | sh |
|
Using generic bindist... |
|
|
|
% Total % Received % Xferd Average Speed Time Time Time Current |
|
Dload Upload Total Spent Left Speed |
|
100 619 0 619 0 0 619 0 --:--:-- --:--:-- --:--:-- 943 |
|
100 7524k 100 7524k 0 0 1254k 0 0:00:06 0:00:06 --:--:-- 1698k |
|
Installing Stack to: /usr/local/bin/stack... |
|
|
|
------------------------------------------------------------------------------- |
|
|
|
Stack has been installed to: /usr/local/bin/stack |
|
|
|
NOTE: You may need to run 'xcode-select --install' to set |
|
up the Xcode command-line tools, which Stack uses. |
|
|
|
~ 12s |
|
❯ stack setup |
|
Writing implicit global project config file to: /Users/searge/.stack/global-project/stack.yaml |
|
Note: You can change the snapshot via the resolver field there. |
|
Using latest snapshot resolver: lts-11.10 |
|
Downloaded lts-11.10 build plan. |
|
Preparing to install GHC to an isolated location. |
|
This will not interfere with any system-level installation. |
|
Downloaded ghc-8.2.2. |
|
Installed GHC. |
|
stack will use a sandboxed GHC it installed |
|
For more information on paths, see 'stack path' and 'stack exec env' |
|
To use this GHC and packages outside of a project, consider using: |
|
stack ghc, stack ghci, stack runghc, or stack exec |
|
|
|
~ 5m 50s |
|
``` |
|
|
|
Недолік такого способу, що `ghci` треба по дурному запускати: |
|
|
|
```zsh |
|
~ |
|
❯ stack ghci |
|
Selected mirror https://s3.amazonaws.com/hackage.fpcomplete.com/ |
|
Downloading root |
|
Selected mirror https://s3.amazonaws.com/hackage.fpcomplete.com/ |
|
Downloading timestamp |
|
Downloading snapshot |
|
Downloading mirrors |
|
Cannot update index (no local copy) |
|
Downloading index |
|
Updated package index downloaded |
|
Update complete |
|
Populated index cache. |
|
|
|
Note: No local targets specified, so a plain ghci will be started with no package hiding or package |
|
options. |
|
|
|
If you want to use package hiding and options, then you can try one of the following: |
|
|
|
* If you want to start a different project configuration |
|
than /Users/searge/.stack/global-project/stack.yaml, then you can use stack init to create a |
|
new stack.yaml for the packages in the current directory. |
|
|
|
* If you want to use the project configuration |
|
at /Users/searge/.stack/global-project/stack.yaml, then you can add to its 'packages' field. |
|
|
|
Configuring GHCi with the following packages: |
|
GHCi, version 8.2.2: http://www.haskell.org/ghc/ :? for help |
|
Loaded GHCi configuration from /private/var/folders/k3/412l536j6493cqc0060sv2hm0000gn/T/haskell-stack-ghci/2a3bbd58/ghci-script |
|
Prelude> |
|
Leaving GHCi. |
|
|
|
~ 1m 32s |
|
``` |
|
|
|
**Про Docker**, [в тому відео](https://www.youtube.com/watch?v=sRonIB8ZStw) використовують його для розвертання стека: |
|
|
|
> **macOS**: Docker for Mac is the supported way to use Docker integration on macOS (the older Docker Machine (boot2docker) approach to using Docker on macOS is not supported due to issues with host volume mounting that make Stack [nearly unusable](https://docs.haskellstack.org/en/stable/docker_integration/) for anything but the most trivial projects). |
|
|
|
```zsh |
|
❯ ls .stack/programs/x86_64-osx/ghc-8.2.2/bin |
|
ghc ghc-pkg-8.2.2 haddock hpc runghc-8.2.2 |
|
ghc-8.2.2 ghci haddock-ghc-8.2.2 hsc2hs runhaskell |
|
ghc-pkg ghci-8.2.2 hp2ps runghc |
|
|
|
~ |
|
❯ .stack/programs/x86_64-osx/ghc-8.2.2/bin/ghc --version |
|
The Glorious Glasgow Haskell Compilation System, version 8.2.2 |
|
|
|
~ |
|
❯ stack path |
|
stack-root: /Users/searge/.stack |
|
project-root: /Users/searge/.stack/global-project |
|
config-location: /Users/searge/.stack/global-project/stack.yaml |
|
bin-path: /Users/searge/.stack/snapshots/x86_64-osx/lts-11.10/8.2.2/bin:/Users/searge/.stack/compiler-tools/x86_64-osx/ghc-8.2.2/bin:/Users/searge/.stack/programs/x86_64-osx/ghc-8.2.2/bin:/Users/searge/.rvm/gems/ruby-2.4.2/bin:/Users/searge/.rvm/gems/ruby-2.4.2@global/bin:/Users/searge/.rvm/rubies/ruby-2.4.2/bin:/Users/searge/.local/bin:/Users/searge/Library/Haskell/bin:/Applications/Racket v6.12/bin:/Users/searge/anaconda3/bin:/Users/searge/.nvm/versions/node/v9.6.1/bin:/usr/local/share/python:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:.:/Users/searge/.rvm/bin |
|
programs: /Users/searge/.stack/programs/x86_64-osx |
|
compiler-exe: /Users/searge/.stack/programs/x86_64-osx/ghc-8.2.2/bin/ghc |
|
compiler-bin: /Users/searge/.stack/programs/x86_64-osx/ghc-8.2.2/bin |
|
compiler-tools-bin: /Users/searge/.stack/compiler-tools/x86_64-osx/ghc-8.2.2/bin |
|
local-bin: /Users/searge/.local/bin |
|
extra-include-dirs: |
|
extra-library-dirs: |
|
snapshot-pkg-db: /Users/searge/.stack/snapshots/x86_64-osx/lts-11.10/8.2.2/pkgdb |
|
local-pkg-db: /Users/searge/.stack/global-project/.stack-work/install/x86_64-osx/lts-11.10/8.2.2/pkgdb |
|
global-pkg-db: /Users/searge/.stack/programs/x86_64-osx/ghc-8.2.2/lib/ghc-8.2.2/package.conf.d |
|
ghc-package-path: /Users/searge/.stack/global-project/.stack-work/install/x86_64-osx/lts-11.10/8.2.2/pkgdb:/Users/searge/.stack/snapshots/x86_64-osx/lts-11.10/8.2.2/pkgdb:/Users/searge/.stack/programs/x86_64-osx/ghc-8.2.2/lib/ghc-8.2.2/package.conf.d |
|
snapshot-install-root: /Users/searge/.stack/snapshots/x86_64-osx/lts-11.10/8.2.2 |
|
local-install-root: /Users/searge/.stack/global-project/.stack-work/install/x86_64-osx/lts-11.10/8.2.2 |
|
snapshot-doc-root: /Users/searge/.stack/snapshots/x86_64-osx/lts-11.10/8.2.2/doc |
|
local-doc-root: /Users/searge/.stack/global-project/.stack-work/install/x86_64-osx/lts-11.10/8.2.2/doc |
|
dist-dir: .stack-work/dist/x86_64-osx/Cabal-2.0.1.0 |
|
local-hpc-root: /Users/searge/.stack/global-project/.stack-work/install/x86_64-osx/lts-11.10/8.2.2/hpc |
|
local-bin-path: /Users/searge/.local/bin |
|
ghc-paths: /Users/searge/.stack/programs/x86_64-osx |
|
``` |
|
|
|
Встановив hlint stylish-haskell |
|
|
|
```bash |
|
stack install hlint stylish-haskell |
|
... |
|
|
|
Copying from /Users/searge/.stack/snapshots/x86_64-osx/lts-11.10/8.2.2/bin/hlint to /Users/searge/.local/bin/hlint |
|
Copying from /Users/searge/.stack/global-project/.stack-work/install/x86_64-osx/lts-11.10/8.2.2/bin/stylish-haskell to /Users/searge/.local/bin/stylish-haskell |
|
|
|
Copied executables to /Users/searge/.local/bin: |
|
- hlint |
|
- stylish-haskell |
|
|
|
Warning: The hlint executable found on the PATH environment variable is |
|
/Users/searge/.stack/snapshots/x86_64-osx/lts-11.10/8.2.2/bin/hlint and not the version that was just |
|
installed. This means that hlint calls on the command line will not use this version. |
|
|
|
~ 4m 13s |
|
❯ hlint --version |
|
HLint v2.1.5, (C) Neil Mitchell 2006-2018 |
|
~ |
|
❯ which hlint |
|
/Users/searge/.stack/snapshots/x86_64-osx/lts-11.10/8.2.2/bin/hlint |
|
|
|
``` |
|
|
|
Дуже дивно ¯\_(ツ)_/¯ |
|
|
|
#### Встановив `spacemac` |
|
|
|
``` |
|
╭─ Quick Help ─────────────────────────────────────────────────────────────────╮ |
|
│ │ |
|
│ Press [TAB] or [J] to move to next button. │ |
|
│ │ |
|
│ Press [Shift-TAB] or [K] to move to previous button. │ |
|
│ │ |
|
│ Press [w] to jump to warning list. │ |
|
│ │ |
|
│ Press [r] to jump to recent file list if it is enabled. │ |
|
│ │ |
|
│ Press [p] to jump to project list if it is enabled. │ |
|
│ │ |
|
│ Press [b] to jump to bookmark list if it is enabled. │ |
|
│ │ |
|
│ Press [c] to jump to org-agenda list if it is enabled. │ |
|
│ │ |
|
│ Press [d] to jump to org-todo list if it is enabled. │ |
|
│ │ |
|
│ Press [o] to jump to any link or button. │ |
|
│ │ |
|
│ Press [m] to jump to the top menu. │ |
|
│ │ |
|
│ Press [SPC] (in Vim editing style) or [Alt-m] (in Emacs editing style) to │ |
|
│ access Spacemacs commands (will list only the Vim style ones for the rest │ |
|
│ of this help). │ |
|
│ │ |
|
│ Press [SPC f e d] (or [Alt-m f e d] in Emacs style) to access .spacemacs │ |
|
│ file. │ |
|
│ │ |
|
│ Press [SPC h SPC] to access a list of documentation and supported layers. │ |
|
│ You can type anything to narrow to a specific feature i.e. "python" for │ |
|
│ Python layer. There are multiple lists and you can press [Ctrl-o] to │ |
|
│ switch between them. │ |
|
│ │ |
|
│ When reading a document, you can use [SPC s j] to jump to a heading. │ |
|
│ │ |
|
│ Please consult Spacemacs documentation from [SPC h SPC] for more details. │ |
|
│ │ |
|
╰──────────────────────────────────────────────────────────────────────────────╯ |
|
|
|
``` |
|
|
|
|
|
|
|
#### Налаштування `NeoVIM` |
|
``` |
|
|
|
- INFO: Executable: Not found |
|
|
|
## Ruby provider (optional) |
|
- INFO: Ruby: ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-darwin15] |
|
- WARNING: Missing "neovim" gem. |
|
- ADVICE: |
|
- Run in shell: gem install neovim |
|
- Is the gem bin directory in $PATH? Check `gem environment`. |
|
- If you are using rvm/rbenv/chruby, try "rehashing". |
|
|
|
## Node provider (optional) |
|
- INFO: Node: v9.6.1 |
|
- WARNING: Missing "neovim" npm package. |
|
- ADVICE: |
|
- Run in shell: npm install -g neovim |
|
- Is the npm bin directory in $PATH? |
|
|
|
Python integration provider-python |
|
|
|
Nvim supports the Vim legacy python-vim and python3 interfaces via |
|
external Python interpreters connected via RPC. |
|
Note: Only the Vim 7.3 API is supported; bindeval (Vim 7.4) is not. |
|
|
|
PYTHON QUICKSTART |
|
|
|
If you used a package manager to install Nvim, you might already have the |
|
required neovim Python package. Run :checkhealth to see if your system is |
|
up-to-date. |
|
|
|
Following are steps to install the package with Python's pip tool. |
|
|
|
Note: Depending on your system, pip might refer to Python 2 or Python 3, |
|
which is why the following instructions mention pip2 or pip3 |
|
explicitly. If one of these is not available, try pip. |
|
|
|
To use Vim Python 2/3 plugins with Nvim: |
|
|
|
- For Python 2 plugins, make sure an interpreter for Python 2.6 or 2.7 is |
|
available in your $PATH, then install the neovim Python package systemwide: |
|
$ sudo pip2 install --upgrade neovim |
|
|
|
or for the current user: |
|
$ pip2 install --user --upgrade neovim |
|
|
|
- For Python 3 plugins, make sure an interpreter for Python 3.3 or above is |
|
available in your $PATH, then install the neovim Python package systemwide: |
|
$ sudo pip3 install --upgrade neovim |
|
|
|
or for the current user: |
|
$ pip3 install --user --upgrade neovim |
|
|
|
Note: The --upgrade flag ensures you have the latest version even if |
|
a previous version was already installed. |
|
|
|
PYTHON PROVIDER CONFIGURATION |
|
g:python_host_prog |
|
g:python3_host_prog |
|
Program to use for evaluating Python code. Setting this makes startup faster. |
|
Also useful for working with virtualenvs. |
|
let g:python_host_prog = '/path/to/python' |
|
let g:python3_host_prog = '/path/to/python3' |
|
|
|
g:loaded_python_provider |
|
To disable Python 2 support: |
|
let g:loaded_python_provider = 1 |
|
|
|
g:loaded_python3_provider |
|
To disable Python 3 support: |
|
let g:loaded_python3_provider = 1 |
|
|
|
PYTHON VIRTUALENVS |
|
|
|
If you plan to use per-project virtualenvs often, you should assign |
|
a virtualenv for Neovim and hard-code the interpreter path via |
|
g:python_host_prog (or g:python3_host_prog) so that the "neovim" python |
|
package is not required for each Environment. Example using pyenv: |
|
pyenv install 3.4.4 |
|
pyenv virtualenv 3.4.4 py3neovim |
|
pyenv activate py3neovim |
|
pip install neovim |
|
pyenv which python # Note the path |
|
|
|
The last command reports the interpreter path. Add it to your init.vim: |
|
let g:python3_host_prog = '/full/path/to/py3neovim/bin/python' |
|
|
|
More information: |
|
https://github.com/zchee/deoplete-jedi/wiki/Setting-up-Python-for-Neovim |
|
|
|
============================================================================== |
|
Ruby integration provider-ruby |
|
|
|
Nvim supports the Vim legacy ruby-vim interface via external Ruby |
|
interpreters connected via RPC. |
|
|
|
Run :checkhealth to see if your system is up-to-date |
|
|
|
UBY QUICKSTART |
|
|
|
To use Vim Ruby plugins with Nvim, just install the latest neovim RubyGem: |
|
$ gem install neovim |
|
|
|
RUBY PROVIDER CONFIGURATION |
|
g:loaded_ruby_provider |
|
To disable Ruby support: |
|
let g:loaded_ruby_provider = 1 |
|
|
|
g:ruby_host_prog |
|
Command to start the Ruby host. By default this is neovim-ruby-host. For users |
|
who use per-project Ruby versions with tools like RVM or rbenv, setting this can |
|
prevent the need to install the neovim gem in every project. |
|
|
|
To use an absolute path (e.g. to an rbenv installation): |
|
let g:ruby_host_prog = '~/.rbenv/versions/2.4.1/bin/neovim-ruby-host' |
|
|
|
|
|
To use the RVM "system" Ruby installation: |
|
let g:ruby_host_prog = 'rvm system do neovim-ruby-host' |
|
|
|
|
|
============================================================================== |
|
Clipboard integration provider-clipboard clipboard |
|
|
|
vim has no direct connection to the system clipboard. Instead it depends on |
|
a provider which transparently uses shell commands to communicate with the |
|
system clipboard or any other clipboard "backend". |
|
|
|
To ALWAYS use the clipboard for ALL operations (instead of interacting with |
|
the '+' and/or '*' registers explicitly): |
|
|
|
set clipboard+=unnamedplus |
|
|
|
See 'clipboard' for details and options. |
|
|
|
clipboard-tool |
|
The presence of a working clipboard tool implicitly enables the '+' and '*' |
|
registers. Nvim looks for these clipboard tools, in order of priority: |
|
|
|
- g:clipboard |
|
- pbcopy/pbpaste (macOS) |
|
- xsel (if $DISPLAY is set) |
|
- xclip (if $DISPLAY is set) |
|
- lemonade (for SSH) https://github.com/pocke/lemonade |
|
- doitclient (for SSH) http://www.chiark.greenend.org.uk/~sgtatham/doit/ |
|
- win32yank (Windows) |
|
- tmux (if $TMUX is set) |
|
|
|
g:clipboard |
|
To configure a custom clipboard tool, set g:clipboard to a dictionary: |
|
let g:clipboard = { |
|
\ 'name': 'myClipboard', |
|
\ 'copy': { |
|
\ '+': 'tmux load-buffer -', |
|
\ '*': 'tmux load-buffer -', |
|
\ }, |
|
\ 'paste': { |
|
\ '+': 'tmux save-buffer -', |
|
\ '*': 'tmux save-buffer -', |
|
\ }, |
|
\ 'cache_enabled': 1, |
|
\ } |
|
|
|
If cache_enabled is TRUE then when a selection is copied, Nvim will cache |
|
the selection until the copy command process dies. When pasting, if the copy |
|
process has not died, the cached selection is applied. |
|
|
|
============================================================================== |
|
X11 selection mechanism clipboard-x11 x11-selection |
|
|
|
X11 clipboard providers store text in "selections". Selections are owned by an |
|
application, so when the application gets closed, the selection text is lost. |
|
The contents of selections are held by the originating application (e.g., upon |
|
a copy), and only passed to another application when that other application |
|
requests them (e.g., upon a paste). |
|
|
|
quoteplus quote+ |
|
|
|
There are three documented X11 selections: PRIMARY, SECONDARY, and CLIPBOARD. |
|
CLIPBOARD is typically used in X11 applications for copy/paste operations |
|
(Ctrl-c/v), while PRIMARY is used for the last selected text, which is |
|
generally inserted with the middle mouse button. |
|
|
|
Nvim's X11 clipboard providers only utilize the PRIMARY and CLIPBOARD |
|
selections, used for the '*' and '+' registers, respectively. |
|
|
|
============================================================================== |
|
vim:tw=78:ts=8:noet:ft=help:norl: |
|
|
|
``` |