Git Product home page Git Product logo

nvim-config-lazy1's Introduction

INTRODUCTION

This is my new Neovim configuration for Windows (See: Neovim Github repo).
Here I used the lazy.nvim, plugin manager for Neovim.
Info: neovim/projects ==> @bfredl, @tjdevries, @mfussenegger, @folke, ...

init.lua is the config entry point for terminal Nvim, and ginit.vim is the additional config file for GUI client of Nvim.
My GUI client of Nvim is neovim-qt. You can find Neovim plugins on these sites: plugins

This config is only maintained for the latest nvim stable release. A starting point for my configuration is nvim-lua/kickstart.nvim.


FOLDERS AND FILES

nvim-lua-config
│
├── after
│   └── plugin
│       ├── autocmd.lua
│       ├── commands.lua
│       ├── keymaps.lua
│       └── options.lua
│
├── doc\INSTALL.md
│
├── lua
│   ├── custom
│   │  ├── config\bufferline.lua, todocomments.lua, ...
│   │  └── plugins.lua
│   │
│   └── 
│
├── templates\HowToTemplate.txt, py.tpl, ...
│
├── ginit.vim
├── init.lua
├── README.md

init.lua: Main configuration file that call lua modules

lua\ Folder of lua modules, here reside all the Lua modules that needed.
See: where-to-put-lua-files


INSTALL AND SETUP

See doc here on how to install Neovim and Neovim dependencies.

Check where the config folder is:

:echo stdpath("config")
==>  C:\Users\userName\AppData\Local\nvim

:echo stdpath("data")
==>  C:\Users\userName\AppData\Local\nvim-data

Windows command shell:
echo %userprofile%
==>  C:\Users\userName

echo %localappdata%
==>  C:\Users\userName\AppData\Local

Neovim config and plugins installation

Windows command shell: help XCOPY
/S Copy folders and subfolders
/H Copy hidden and system files and folders (default=N)

  1. Backup your previous configuration (show hidden files and folders)
    XCOPY %LOCALAPPDATA%\nvim\* nvim\ /S /H
    and (if you want) archive "nvim-data" folder with zip archiver
    ( or XCOPY %LOCALAPPDATA%\nvim-data\* nvim-data\ /S /H )

  2. Delete folders "nvim" and "nvim-data"
    ( Delete file "lazy-lock.json": DEL %LOCALAPPDATA%\nvim\lazy-lock.json )
    Delete folder "nvim": RD %LOCALAPPDATA%\nvim\
    Delete folder "nvim-data": RD %LOCALAPPDATA%\nvim-data\

  3. Download this repo with git
    git clone https://github.com/mlabrkic/dotfiles.git

  4. Copy the "nvim" folder of this repo into %LOCALAPPDATA%
    XCOPY nvim\* %LOCALAPPDATA%\ /S /H

  5. Start (1.) Neovim (nvim)
    Ignore any error message about missing plugins!
    ==> Wait for: "lazy.nvim - finished in" 463s (7,7 min)
    Quit Neovim - :q(uit) (press Enter)

  6. Start (2.) Neovim (nvim)
    " ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'typescript', 'help', 'vim' },"
    ==> Wait for nvim-treesitter parsers to compile ( 1/9, 2/9, ... , 9/9).
    ...
    [4/9] Treesitter parser fo lua has been installed.
    ...
    Quit Neovim - :q(uit) (press Enter)

If you want, install manually
:TSInstall java
:TSInstallInfo
Windows-support#troubleshooting


CHECK IT OUT

Various checks

LSP check

Open a source file of one of the supported languages with Neovim, and run command "LspInfo" for testing the LSP support.
:LspInfo

Keymaps check

:echo mapcheck('<F4>', 'n')
:echo hasmapto('set relativenumber!<CR>', 'n')

Configuration check

Open nvim and run command "checkhealth", you should not see any error in the output (except for the one related to the Python 2 interpreter if don't have it):
:checkhealth


FINALLY, install these plugins ONE BY ONE

  -- Uncomment No_ 01:
  -- use { 'nvim-telescope/telescope-fzf-native.nvim', run = 'make', }

  -- Uncomment No_ 02:
  -- use { "folke/todo-comments.nvim",
  --   requires = "nvim-lua/plenary.nvim",
  --   config = [[require('plugins.todocomments')]], }

  -- Uncomment No_ 03:
  -- use {
  --   "iamcco/markdown-preview.nvim", ft = { "markdown" },
  --   run = "cd app && npm install",
  --   config = [[require('plugins.v_markdown-preview')]],
  -- }

Plugins can have post-install/update hooks
It is best to install them one by one!

init.lua :

  -- INFO: First install other plugins. After that uncomment this:
  use { 'nvim-telescope/telescope-fzf-native.nvim', run = 'make', }

To get fzf-native working, you need to build it with either cmake or make:

  • CMake, and the Microsoft C++ Build Tools, or
  • Make, and MinGW (gcc)(my choice)
    ( See doc here on how to install C compiler. )

Check this after installation:

Windows Command shell:
cd %LOCALAPPDATA%\nvim-data\lazy\telescope-fzf-native.nvim\
cd build
dir
==> libfzf.dll exist?
If libfzf.dll does not exist ...

A) Check for "make" (in Neovim):
:echo executable("make")
or
:lua print(vim.fn.executable('make'))

Windows Command shell:
make -v
make -h

B) If you have "make":

Windows Command shell:
cd %LOCALAPPDATA%\nvim-data\lazy\telescope-fzf-native.nvim\
dir

make

C) If you don't have a "make":

Windows Command shell:
cd %LOCALAPPDATA%\nvim-data\lazy\telescope-fzf-native.nvim\

mkdir build
gcc -O3 -Wall -Werror -fpic -std=gnu99 -shared src/fzf.c -o build/libfzf.dll

-->
telescope-fzf-native.nvim\build\libfzf.dll

NOTE: If you want to uninstall this plugin later ...

  • First delete the "build" folder:
    cd %LOCALAPPDATA%\nvim-data\lazy\telescope-fzf-native.nvim\
    RD build\

  • Uninstall this plugin (Comment plugin in "init.lua", ...)

--------------

nvim\lua\plugins.lua :

  -- Please make sure that you have installed node.js .
  -- INFO: First install other plugins. After that uncomment this:

  use {
    "iamcco/markdown-preview.nvim", ft = { "markdown" },
    run = "cd app && npm install",
    -- requires = { "zhaozg/vim-diagram", "aklt/plantuml-syntax" },
    config = [[require('plugins.v_markdown-preview')]],
  }
  • Open some markdown file.
  • :MarkdownPreview ( nnoremap <A-m> :<C-U>MarkdownPreview<CR> )
  • Wait cca 15 s.
If nothing happened after "MarkdownPreview" command ...

Nothing happened after "MarkdownPreview" command. No page opened in browser.
Check for errors :messages

Please make sure that you have installed node.js ( node --version ).
If there are errors, then uninstall the plugin, and repeat everything.

--------------


FEATURES

I use these plugins

REFERENCES

https://github.com/jdhao/nvim-config
https://github.com/brainfucksec/neovim-lua

:help lua-guide (large part taken from https://github.com/nanotee/nvim-lua-guide)

Lua in Y minutes - https://learnxinyminutes.com/docs/lua/
Lua Quick Guide - https://github.com/medwatt/Notes/blob/main/Lua/Lua_Quick_Guide.ipynb
( Lua 5.1 Reference Manual )

Windows Command shell info

https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/windows-commands
https://ss64.com/nt/

nvim-config-lazy1's People

Contributors

mlabrkic avatar tjdevries avatar ttibsi avatar nwvi avatar vzaa avatar amtoine avatar craigmac avatar c4rlo avatar feoh avatar debashisbiswas avatar elijahmanor avatar fgrehm avatar folke avatar sitedyno avatar jpearnshaw avatar drakx avatar kudolayton avatar lucianbc avatar matthiasdebernardini avatar mmngreco avatar ngryman avatar peterpme avatar szechp avatar seantwie03 avatar monooso avatar tsankotsanev avatar tudorjnu avatar amalgame21 avatar kazenix avatar skovati avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.