Skip to content

Nguyen-Hoang-Nam/nvim-dotfiles-kitty

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nvim Dotfiles Kitty

Neovim + Kitty = ❤️

Main Kitty with Fira, Cascadia, and Mini-File-Icons

Documentation

What I have done so far

Why I choose Kitty Terminal

  • Support combine multiple fonts
  • Support display image protocol

Which framework I use this with

  • React
  • Svelte
  • Tailwind
  • Express
  • Gin
  • FastAPI
  • Laravel
  • Spring Boot
  • Phoenix

Supported languages feature

Language LSP Treesitter Formatter Lint Debug Test
Bash 👍 👍 👍 👍
C 👍 👍
CMake 👍 👍 👍
CPP 👍 👍 👍
CSS 👍👍👍 👍 👍 👍
Dart 👍 👍 👍 👍👍
Dockerfile 👍 👍 👍
Elixir 👍 👍 👍 👍
Go 👍 👍 👍👍 👍 👍 👍
Haskell 👍 👍 👍
HTML 👍👍👍 👍 👍
HTTP 👍
Java 👍 👍 👍 👍 👍
Javascript 👍 👍👍 👍 👍
JSON 👍 👍 👍
Lua 👍 👍 👍
Markdown 👍 👍 👍
PHP 👍 👍 👍 👍
Python 👍 👍 👍 👍
React 👍👍 👍 👍
Rust 👍 👍 👍 👍
Scala 👍
Solidity 👍 👍 👍
Svelte 👍👍 👍 👍
Tex 👍 👍 👍
TOML 👍
Typescript 👍 👍 👍 👍
XML 👍 👍 👍
YAML 👍 👍 👍
Zig 👍 👍

Startup

Last updated Jan 2 2021

=====================================
Top 10 plugins slowing nvim's startup
=====================================
1   3.097   vim-test
2   1.636   nvim-scrollview
3   1.290   nvim-treesitter
4   0.467   nvim-cmp
5   0.400   vim-ultest
6   0.398   nvim-ts-autotag
7   0.326   indent-blankline.nvim
8   0.163   cmp_luasnip
9   0.162   LuaSnip
10  0.156   cmp-path
=====================================

Screenshot

Dashboard

Dashboard

Telescope

Telescope

Terminal

Terminal

Help

Help

JavaScript

JavaScript

Go

Go

Find more in wiki

Configuration

All settings are store in lua/settings.lua

return {
    efm = {
        filetypes = {
            'sh',
            'css',
            'cpp',
            'dart',
            'dockerfile',
            'elixir',
            'go',
            'haskell',
            'html',
            'java',
            'javascript',
            'javascriptreact',
            'json',
            'lua',
            'markdown',
            'php',
            'python',
            'rust',
            'solidity',
            'svelte',
            'tex',
            'typescript',
            'typescriptreact',
            'xml',
            'yaml',
        },
    },

    lspconfigs = {
        filetypes = {
            'sh',
            'cmake',
            'css',
            'cpp',
            'dart',
            'dockerfile',
            'elixir',
            'go',
            'haskell',
            'html',
            'javascript',
            'json',
            'lua',
            'php',
            'python',
            'rust',
            'solidity',
            'svelte',
            'tex',
            'xml',
            -- 'yaml',
            'zig',
        },

        features = {
            'efm',
            'emmet',
            'tailwindcss',
        },
    },

    autoformat = {
        filetypes = {
            'sh',
            'cmake',
            'css',
            'cpp',
            'dart',
            'dockerfile',
            'elixir',
            'go',
            'haskell',
            'html',
            'java',
            'javascript',
            'javascriptreact',
            'json',
            'lua',
            'markdown',
            'php',
            'python',
            'rust',
            'solidity',
            'svelte',
            'tex',
            'typescript',
            'typescriptreact',
            'xml',
            'yaml',
        },
    },

    codeaction = {
        filetypes = {
            'css',
            'cpp',
            'dart',
            'dockerfile',
            'go',
            'html',
            -- 'java',
            'javascript',
            'javascriptreact',
            'json',
            -- 'lua',
            'markdown',
            'php',
            'python',
            'rust',
            'svelte',
            'tex',
            'typescript',
            'typescriptreact',
            'xml',
            'yaml',
        },
    },

    colors = {
        red = '#F9867B',
        orange = '#CD9731',
        yellow = '#FDCE68',
        green = '#A3EEA0',
        cyan = '#6796E6',
        blue = '#7BE2F9',
        purple = '#E19EF5',
        tomato = '#F44747',
        white = '#FFFFFF',

        background = '#212835',
        dark_background = '#1B212C',

        border = '#3E4451',
        comment = '#5C6370',
        lineNumber = '#495162',
        scrollbar = '#4E5666',
        cursorLine = '#2C313A',
        indent = '#383C44',
    },

    signs = {
        DiagnosticSignError = '',
        DiagnosticSignWarning = '',
        DiagnosticSignHint = '',
        DiagnosticSignInfo = '',
        CodeActionSign = '',
    },

    kinds = {
        Class = ' (class)',
        Color = ' (color)',
        Constant = ' (constant)',
        Constructor = ' (constructor)',
        Enum = ' (enum)',
        EnumMember = ' (enum member)',
        Event = ' (event)',
        Field = ' (field)',
        File = ' (file)',
        Folder = ' (folder)',
        Function = ' (function)',
        Interface = ' (interface)',
        Keyword = ' (keyword)',
        Method = ' (method)',
        Module = '{} (module)',
        Operator = ' (operator)',
        Property = ' (property)',
        Reference = ' (reference)',
        Snippet = ' (snippet)',
        Struct = ' (enum)',
        Text = ' (text)',
        TypeParameter = ' (type parameter)',
        Unit = ' (unit)',
        Value = ' (value)',
        Variable = ' (variable)',
    },

    statusline = {
        git_branch_enabled = true,
        diagnostic_enabled = true,
        git_diff_enabled = true,
        test_enabled = true,
        line_column_enabled = true,
        tab_enabled = true,
        line_break_enabled = true,
        file_format_enabled = true,
        efm_enabled = true,
        emoji_enabled = true,
        emoji_icon = '',
    },
}

Installation

Requirements

  • Kitty
  • Neovim 0.8.0-dev (Last updated Jul 02 2022)

Fonts

  • mini-file-icons
  • Fira code (Or any ligature font)
  • Cascadia (Or any italic font)

Kitty

font_family FiraCode Nerd Font Mono
bold_font Cascadia Code
italic_font Cascadia Mono
bold_italic_font Cascadia Code
symbol_map U+e900-U+e954 mini-file-icons
font_size 16
cursor #6796E6

Plugin list

I highly suggest managing plugins manually. This is a tedious job, but you has more power to manage your plugins.

Please store below plugins in ~/.local/share/nvim/site/pack/*/start/.

Plugin Last updated
aerial Aug 23 2022
auto-session Aug 10 2022
bufferline.nvim Aug 25 2022
cmp-cmdline Aug 05 2022
cmp-nvim-lsp May 16 2022
cmp-nvim-lsp-signature-help Aug 20 2022
cmp-path Jul 26 2022
cmp_luasnip May 02 2022
diffview.nvim Aug 21 2022
fidget.nvim Jul 25 2022
find-cmdline.nvim Jul 01 2022
friendly-snippets Aug 18 2022
git-conflict Aug 16 2022
git-utils.nvim
gitsigns.nvim Aug 22 2022
goto-preview Jul 19 2022
hologram.nvim Jul 03 2022
indent-blankline.nvim Jul 27 2022
LuaSnip Aug 25 2022
nui Aug 25 2022
nvim-autopair Aug 19 2022
nvim-biscuits Aug 17 2022
nvim-cmp Aug 23 2022
nvim-colorizer.lua Apr 20 2020
nvim-dap Aug 24 2022
nvim-dap-ui Aug 02 2022
nvim-dap-virtual-text Aug 05 2021
nvim-jdtls Aug 18 2022
nvim-lspconfig Aug 26 2022
nvim-mini-file-icons Jul 09 2022
nvim-navic Jul 17 2022
nvim-notify Aug 24 2022
nvim-scrollbar Jul 11 2022
nvim-scrollview Aug 18 2022
nvim-treesitter Aug 01 2022
nvim-ts-autotag Aug 11 2022
nvim-ts-context-commentstring Aug 26 2022
nvim-ts-rainbow Aug 10 2022
nvim-ufo Aug 21 2022
plenary.nvim Aug 26 2022
sqls.nvim Jul 08 2022
rest.nvim Aug 22 2022
tabout.nvim May 07 2022
telescope-fzf-native.nvim Aug 11 2022
telescope.nvim Aug 26 2022
telescope-ui-select.nvim Apr 30 2022
todo-comments.nvim Jan 19 2022
toggleterm.nvim Aug 15 2022
vim-test Aug 25 2022
vim-ultest Jun 18 2022
yanil

Treesitter

Language Treesitter
Bash 👍
C 👍
CMake 👍
CPP 👍
CSS 👍
Dart 👍
Dockerfile 👍
Elixir 👍
Go 👍
Haskell 👍
HTML 👍
HTTP 👍
Java 👍
Javascript 👍👍
JSON 👍
Lua 👍
Markdown 👍
PHP 👍
Python 👍
React 👍
Rust 👍
Scala 👍
Solidity 👍
Svelte 👍
Tex 👍
TOML 👍
Typescript 👍
XML 👍
YAML 👍
Zig 👍

Language Server

Language LSP
Bash bash-language-server
C clangd
CMake cmake-language-server
CPP clangd
CSS vscode-langservers-extracted, emmet-ls, tailwindcss-intellisense
Dart dart-lang/sdk
Dockerfile dockerfile-language-server-nodejs
Elixir elixir-ls
Go gopls
Haskell haskell-language-server
HTML vscode-langservers-extracted, emmet-ls, tailwindcss-intellisense
HTTP
Java jdtls
Javascript typescript-language-server
JSON vscode-langservers-extracted
Lua lua-language-server
Markdown
PHP phpactor
Python pyright
React typescript-language-server, tailwindcss-intellisense
Rust rust-analyzer
Scala
Solidity vscode-solidity
Svelte sveltejs/language-tools, tailwindcss-intellisense
Tex texlab
TOML
Typescript typescript-language-server
XML lemminx
YAML yaml-language-server
Zig zls

Formatter

Check wiki

Linter

Check wiki

Debug

Check wiki

Test

Check wiki

Mappings

Key Description
<Leader>0 Add break point
<Leader>1 Toggle debug
<Leader>2 Step over
<Leader>3 Step into
<Leader>4 Step out
<Leader>9 Scope information
<Leader>a Code action
<Leader>b Toggle biscuit
<Leader>c Range format
<Leader>d Go to definition
<Leader>e Search Gitmojis
<Leader>f Search text
<Leader>g Toggle git hover
<Leader>m Format code
<Leader>n Show floating Cmdline
<Leader>o Search buffers
<Leader>p Search file
<Leader>q Turn off search's highlight
<Leader>r Rename variable
<Leader>s Save file
<Leader>t Toggle test
<Leader>u Search text in project
<Leader>w Delete current buffer
<Leader>z Preview definition
<Leader>/ Toggle comment
<M-b> Toggle Explorer
<M-d> Toggle Debug sidebar
<M-t> Toggle Terminal
<M-r> Toggle Rest Tab
<M-s> Toggle SQL Tab
<M-x> Toggle Symbol sidebar
jk Insert to normal
gh Go to left window
gj Go to above window
gk Go to below window
gl Go to right window
cj Go to above change
ck Go to below change
cb Go to both change
c0 Go to none change
]d Go to next diagnostic
[d Go to previous diagnostic
]b Go to next Buffer
[b Go to previous Buffer
]g Go to next Git conflict
[g Go to previous Git conflict
]q Go to next Tab
[q Go to previous Tab
]t Go to next failed test
[t Go to previous failed test
]x Go to next function
[x Go to previous function

Add unsupported languages

You can add unsupported languages by follow these steps.

Syntax highlight

If Treesitter supports your language, then you can run this command to install syntax highlight.

:TSInstall <language>

Language Server Protocol

You can find server for your language Here.

After you've installed the LSP, you need to create a file in after/ftplugin, lua/languages.

-- lua/langauges/your-language.lua
local lsp = require('languages.lsp')
local M = {}

M.lsp_server = '<name of LSP>'

M.lsp = {
    capabilities = lsp.capabilities,
    on_attach = lsp.on_attach,
    -- Any extra configuration should put there
}

return M
-- after/ftplugin/your-language.lua
vim.opt.indentexpr = 'nvim_treesitter#indent()' -- Optional, If you use indent of treesitter

require('cmp').setup.buffer({
    sources = {
        { name = 'nvim_lsp' },
        { name = 'luasnip' }, -- Optional, If you use snippet
        { name = 'path' }, -- Optional, If your language need path
        { name = 'nvim_lsp_signature_help' }, -- Optional, If your language has signature
    },
})

You also need to add your language to /lua/settings.lua

-- /lua/settings.lua
return {
    lspconfigs = {
        filetypes = {
            ...,
            '<your lanugage>',
            ...,
        },
    },
}

Formatter and Linter

You need to install these tools first then go to /lua/languages/<your language>.lua

-- /lua/languages/<your language>.lua
M.efm = {
    {
        formatCommand = 'formatter1',
        formatStdin = true,
    },
    {
        formatCommand = 'formatter2',
        formatStdin = true,
    },
    {
        lintCommand = 'linter1',
        lintIgnoreExitCode = true,
        lintStdin = true,
        lintFormats = {
            'Your linter format',
        },
    },
}

M.all_format = { efm = 'Formatter1   Formatter2   Linter1' }

M.default_format = 'efm'

Debug

You can check debug server here

Test

You can check test tools here

TODO

  • Show theme in wiki
  • Support Flutter
  • Use nix to manage package.
  • Add test summary to sidebar
  • Change highlight of nvim-dap-ui
  • Change highlight of vim-ultest
  • Handle lsp_extension
  • Support nvim-covarage
  • Support nvim-ufo
  • Support nvim-notify
  • Support Graphql

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT