Skip to content

Lingshinx/nvim-config

Repository files navigation

Neovim Configuration

Image

Introduction zh_CN

I used to use LazyVim. It's awesome. But I found it kind of hard to keep tweaking Neovim on top of LazyVim. It's more convenient to manage if I have a LazyVim in stdpath('config') instead of stdpath('data'). And most importantly — It's really cool to have my own Neovim configuration, isn't it?

Installation

Honestly, I wouldn't recommend using my configuration directly. It's quite personal. Some CLI tools integrated might be useless to you. Also, I'm not using DAP or NeoTest currently.

Still, I think it will serve as a good reference or starting point for you to build your own configuration alongside LazyVim (which is also my reference). I'll even brag a bit that I have injected some ingenuity inside my configuration — Let me show you below:

Tip

If you already have a Neovim setup in your environment, You don't need to move the current one away as a backup. You can clone this repo to $XDG_CONFIG_COME/{NVIM_APPNAME}. Any appname as NVIM_APPNAME is okay as long as it won't conflict with your existing directories. For example, you can choose nvim_lingshin as NVIM_APPNAME for my configuration.

git clone https://github.com/Lingshinx/nvim-config.git ~/.config/nvim_lingshin

then, try mine by running:

NVIM_APPNAME=nvim_lingshin nvim

Plugins manager

You have to install lazy.nvim manually because I didn't include the process to install

git clone --filter=blob:none --branch=stable https://github.com/folke/lazy.nvim.git ~/.local/share/nvim/lazy/lazy.nvim

I know it'd be more convenient if this command ran automatically when lazy.nvim is not installed,

but I just feel a little bit uncomfortable checking a condition every time for a task only executed for once, although I know it won't take any noticeable time

Features

Language

It's convenient to treat Language configurations as packages and manage them together instead of scattering them around.

You can put language configurations at stdpath('config')/lua/langs or just ~/.config/nvim/lua/langs.

Each file should returns a table of type Config.LangConfig.

Property Type Description
[integer] string or Config.LangConfig you can nest multiple languages inside a language. Parent configurations are inherited, I will show you the usage below
treesitter string[] or boolean default to true, treesitter-{language name} will be installed
lsp string, string[] or table<string,lspconfig> name of Language Server Protocol, when table, vim.lsp.config(key, value) will be called
formatter string or string[] name of formatters
pkgs string[] if the package name in mason is different with name of LSP and formatter, you can set pkgs to tell to mason to install it
plugins LazySpec plugin configurations related to this language
enabled boolean no need to explain

Example about how to configure languages.

Also, my own language configurations are placed in stdpath('config')/languages, You can copy some of them to stdpath('config')/lua/langs to enable.

Feel free to PR your own language configuration to me if you like this functionality. Since those configuration aren't applied automatically, so I'd really appreciate your contribution whatever the language is

FileType Picker

Use <leader>sf to search filetypes.

record.mp4

Thanks to the feature above that I can display informations of formatter, Tree-sitter, and LSP for each language.

Use <Shift-Enter> to edit language configuration.

Root and Cwd

I prefer not to make difference between cwd and root. When you enter to a buffer attached to a file, My Neovim will change current directory to the root of that file. When root directory cannot be detected, default to parent directory.

Oil, Tabline and Harpoon

图片

I agree with the opinion that you should not turn your Neovim into a traditional IDE.

  • Use tabline instead of bufferline

    Stack your buffers to overflowing and navigate with H / L? A true Vim ninja wouldn't do that.

  • Don't rely on File Tree Explorer, Instead, use File Fuzzy Picker and Harpoon to jump around files.

    Actually, I still use snacks.explorer. It's not bad to have a file tree for a quick overview of the project's structure.

  • Oil.nvim is awesome, powerful and vim-like. You should try.

    Oil.nvim is even more effective at filesystem editing than yazi in my practice

Kitty Scrollback

I use Neovim as kitty scrollback pager

record.mp4

Inspired by kitty-scrollback.nvim

It just colorize the buffer and set some keymaps and options, more lightweight

To enable, please add this options in kitty configuration

scrollback_pager nvim -c 'set filetype=scrollback'

Dashboard Header

I manually painted a few Logo with unicode for me and friends of mine

图片

You can also be friend of mine. And feel free to open an issue if interested in my nvim-config. I'll draw a custom Logo for you when I have time.

I'm unable to make so many friends. So, hurry up?

Okay, take it easy, I think there is no chance that I will be followed by 100+ friends.

Planned Features

  • Workspace Configuration

    Inspired by @aurora/nvim-config.

    Add user commands, keymaps, and autocmds, and apply project-specific options when .nvim/ was detected in root of project

About

nvim config. Quite like LazyVim. but easier to config, and well organized, maybe? I considered

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •