Giter VIP home page Giter VIP logo

nvim-configuration's Introduction

nvim-configuration

Neovim configuration

Preparation

Packer --- package manager

  1. On Path ~, exec command git clone --depth 1 https://github.com/wbthomason/packer.nvim\ ~/.local/share/nvim/site/pack/packer/start/packer.nvim to install packer.nvim
  2. Go to vim to exec
:w
:PackerSync
:luafile %

nvim-tree plugin --- file manager

ensure that you use nerd-font in terminal

  1. install brew tap homebrew/cask-fonts brew install --cask font-hack-nerd-font
  2. iterm font switch to 'Hack Nerd Font Mono'

barbar plugin --- toast hint

If you use mac, <A-.> means <ESC-.>. And you shoud hold key for a while.

telescope --- global search

ensure fd(replace find command) & ripgrep(replace grep command) has installed.

  1. brew install fd
  2. brew install ripgrep

LSP-config

nvim-lspconfig --- use mason-lspconfig instead

use nvim-lsp-installer instead. after install nvim-lspconfig plugin, ensure use right node version. 1. check current node version. nvm version nvm default [version>15] nvm use [version>15] 2. install language server e.g. pyright npm i -g pyright 3. load configuration see github -> https://github.com/neovim/nvim-lspconfig 4. open a py file to check Lsp is installed successfully input :LspInfo

nvim-lsp-installer --- use mason instead

null-ls

You can usc nvim-lsp-installer to install certain language server, which has already support formatting.

To run built-in sources, the command specified below must be available on your $PATH and visible to Neovim. For example, to check if stylua is available, run the following (Vim, not Lua) command:

" should echo 1 if available (and 0 if not)
:echo executable("stylua")

if not, you can use homebrew to install.

e.g. brew install stylua

mason-lspconfig --- lsp configuration

There's two details you should notice.

  1. set certain language server
require("mason-lspconfig").setup({
    ensure_installed = {
        "lua_ls",
        "bashls",
        "emmet_ls",
        "pyright",
        "clangd",
        "kotlin_language_server",
        "jdtls",
    },
})
  1. read mason-lspconfig help documentation to bind key in certain server
require("mason-lspconfig").setup_handlers({
    function(server_name)
        require("lspconfig")[server_name].setup({
            on_attach = common_on_attach,
        })
    end,
})

Markdown

markdow-preview

Pay attention to keymap filetype code.

vim.api.nvim_create_autocmd("FileType", {
	pattern = "markdown",
	group = vim.api.nvim_create_augroup("MarkdownSnippet", { clear = true }),
	callback = function()

	end,
})

Git

gitsingns --- show different label in vim

Do not remap '[c' & ']c', beacause it's default git navigation key in nvim

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.