Skip to content

TunkShif/nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Neovim Config

A simple, fast and modular neovim configuration powered by Fennel for Elixir/React/Rust programmers.

20220731-12-52-08 20220731-12-52-54 20220731-12-55-40

Featured Plugins

plugin list
Plugin Description
wbthomason/packer.nvim plugin manager
Olical/aniseed fennel support for neovim
lewis6991/impatient.nvim speed up loading modules
navarasu/onedark.nvim one dark colorscheme
lukas-reineke/indent-blankline.nvim indent line
kyazdani42/nvim-tree.lua file tree
nvim-lualine/lualine.nvim status line
akinsho/bufferline.nvim buffer tab line
goolord/alpha-nvim startup dashboard
folke/which-key.nvim key mapping cheatsheet
norcalli/nvim-colorizer.lua color hex values
stevearc/dressing.nvim better ui
SmiteshP/nvim-gps context info for lualine
nvim-telescope/telescope.nvim the ultimate fuzzy finder
ahmedkhalf/project.nvim shortcut to your recently opened project
numToStr/FTerm.nvim floating terminal
ggandor/lightspeed.nvim easymotion/vim-sneak alternative
windwp/nvim-autopairs brackets/parenthesis/braces auto pair
windwp/nvim-ts-autotag html tags auto pair
numToStr/Comment.nvim comment operator
nvim-treesitter/nvim-treesitter-textobjects custom text objects
tpope/vim-surround surround operator
tpope/vim-repeat dot repeat
neovim/nvim-lspconfig lsp configuration
jose-elias-alvarez/null-ls.nvim general usage lang server
ray-x/lsp_signature.nvim show function signature popup
hrsh7th/nvim-cmp completion framework
hrsh7th/cmp-nvim-lsp lsp completion source
hrsh7th/cmp-buffer buffer completion source
hrsh7th/cmp-path path completion source
hrsh7th/cmp-cmdline cmdline completions ource
hrsh7th/cmp-vsnip vsnip completion source
hrsh7th/vim-vsnip vscode format snippet support
rafamadriz/friendly-snippets a collection of snippets
nvim-treesitter/nvim-treesitter treesitter for syntax highlighting and more
jose-elias-alvarez/nvim-lsp-ts-utils typescript plugin
simrat39/rust-tools.nvim rust pluging
elixir-editors/vim-elixir elixir plugin

Installation

# if you already have a configured neovim, please make a backup first
cp -r ~/.config/nvim ~/.config/nvim.bak
git clone https://github.com/TunkShif/neovim ~/.config/nvim

You'll have to mannually install missing language servers.

Keymapping Preset

Almost all user-defined key mappings are set in fnl/mapping.fnl using which-key. The default leader key is SPC i.e. the space key, and the default local leader key is ,. Most mappings are grouped, following <prefix> <group> <function> format.

mappings
Mapping Description
SPC f f find files
SPC f b find buffers
SPC f h find history
SPC f g find by grep
SPC f p find projects
SPC F w save file
SPC w h/j/k/l goto window
SPC w H/J/K/L move window
SPC w s split window horizontally
SPC w v split window vertically
SPC w x swap window
SPC w q quit window
SPC w w switch window
SPC b n next buffer
SPC b p previous buffer
SPC b b pick buffer
SPC b x pick to close buffer
SPC b h close left buffers
SPC b l close right buffers
SPC p i install plugins
SPC p u update plugins
SPC p c compile plugin file
SPC p C clean plugins
SPC c r lsp symbol rename
SPC c a lsp code action
SPC c f lsp code format
SPC c k lsp signature help
SPC c d lsp diagnostics list
SPC e toggle file tree
SPC <Esc> clear search highlight
,, using system clipboard register
<A-t> toggle floating terminal
gd lsp goto definition
gD lsp goto declaration
gi lsp goto implementation
gr lsp goto references
go lsp open floating diafnostic
K lsp hover documentation
[d previous diagnostic
]d next diagnostic
[b previous buffer
]b next buffer

And there're some customized text objects

Mapping Descriptiont
af function body outer
if function body inner
ac class outer
ic class inner
ab block outer
ib block inner

Customization

Add a new plugin

Open fnl/packs.fnl, and add new plugins following the format :<repo>/<name> {} in the last (use) form.

You can pass addtional settings from available for packer's use callback, like requires, branch, etc.

Besides you can optionally pass a :mod <module> option for plugin configuration setup.

Add a new module

It's recommended to put your new module under fnl/mods/<category>/<module>.fnl, then use the module/autoload system from aniseed to define the new module.

Example

If we want to add a new plugin from foobar/baz.nvim, and corresponding module for plugin configuration.

;; fnl/packs.fnl
(use
  ;; other plugins
  :foobar/baz.nvim {:mod :util.baz})

;; fnl/mods/util/baz.fnl
(module mods.util.baz)

(let [baz (require :baz)]
  (baz.setup {}))

Add a new language server

Use use function provided by mods.lsp.lsp module to add a new langauge server support.

(module mods.lsp.elixir-ls
  {autoload {lsp mods.lsp.lsp}})

(lsp.use :tailwindcss {})

;; you can also pass additional settings

;; example from `mods.lsp.elixir-ls`
(lsp.use :elixirls
         {:opts {:cmd ["elixir-ls"] }})
;; example from `mods.lsp.lua-language-server`
(let [runtime_path (vim.split package.path ";")]
  (table.insert runtime_path "lua/?.lua")
  (table.insert runtime_path "lua/?/init.lua")
  (lsp.use :sumneko_lua
           {:opts {:settings {:Lua {:runtime {:version "LuaJIT"
                                              :path runtime_path}
                                    :diagnostics {:globals ["vim"]}
                                    :workspace {:library (vim.api.nvim_get_runtime_file "" true)}
                                    :telemetry {:enable false}} }}}))

;; if you want to add some additional logic in `on_attach` callback
;; you can pass an optional `:hook` option

;; example from `mods.lsp.tsserver`
(lsp.use :tsserver
         {:hook (fn [client buffer]
                  ;; disable tsserver formatting, using formatting via null-ls instead
                  (set client.resolved_capabilities.document_formatting false)
                  (set client.resolved_capabilities.document_range_formatting false)
                  (ts-utils.setup {:enable_formatting true})
                  (ts-utils.setup_client client))
          :opts {:init_options ts-utils.init_options}})

About

Fennel powered neovim configuration.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published