Created
April 12, 2022 18:39
-
-
Save JeffreyVdb/9081baa28c3ea332de1145651fafd9e9 to your computer and use it in GitHub Desktop.
Neovim New Config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Use vim settings, rather then vi settings (much better!) | |
" This must be first, because it changes other options as a side effect. | |
set nocompatible | |
set nu | |
set syntax | |
""" | |
""" Keyshort shortcuts | |
""" | |
imap jj <Esc> | |
" Move to panes easier | |
nmap <C-h> <C-w>h | |
nmap <C-j> <C-w>j | |
nmap <C-k> <C-w>k | |
nmap <C-l> <C-w>l | |
call plug#begin() | |
Plug 'folke/tokyonight.nvim', { 'branch': 'main' } | |
Plug 'itchyny/lightline.vim' | |
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} | |
Plug 'ziglang/zig.vim' | |
Plug 'neoclide/coc.nvim', {'branch': 'release'} | |
call plug#end() | |
" Theming | |
colorscheme tokyonight | |
let g:lightline = {'colorscheme': 'tokyonight'} | |
" Tab settings | |
set tabstop=4 " a tab is four spaces | |
set softtabstop=4 " when hitting <BS>, pretend like a tab is removed, even if spaces | |
set expandtab " don't expand tabs to spaces by default | |
set shiftwidth=4 " number of spaces to use for autoindenting | |
set smarttab | |
set autoindent " always set autoindenting on | |
set copyindent " copy the previous indentation on autoindenting | |
filetype plugin on " use the file type plugins | |
set ruler | |
set hlsearch " highlight search terms | |
set incsearch " show search matches as you type | |
set splitbelow | |
set splitright | |
""" | |
""" Tree Sitter configuration | |
""" | |
lua <<EOF | |
require'nvim-treesitter.configs'.setup { | |
-- One of "all", "maintained" (parsers with maintainers), or a list of languages | |
ensure_installed = "maintained", | |
-- Install languages synchronously (only applied to `ensure_installed`) | |
sync_install = false, | |
-- List of parsers to ignore installing | |
ignore_install = { "javascript" }, | |
highlight = { | |
-- `false` will disable the whole extension | |
enable = true, | |
-- list of language that will be disabled | |
disable = {}, | |
-- Setting this to true will run `:h syntax` and tree-sitter at the same time. | |
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). | |
-- Using this option may slow down your editor, and you may see some duplicate highlights. | |
-- Instead of true it can also be a list of languages | |
additional_vim_regex_highlighting = false, | |
}, | |
indent = { | |
enable = true | |
} | |
} | |
EOF | |
set foldlevel=2 | |
set foldmethod=expr | |
set foldexpr=nvim_treesitter#foldexpr() | |
~/.c/nvim ❱ cat init.vim | |
" Use vim settings, rather then vi settings (much better!) | |
" This must be first, because it changes other options as a side effect. | |
set nocompatible | |
set nu | |
set syntax | |
""" | |
""" Keyshort shortcuts | |
""" | |
imap jj <Esc> | |
" Move to panes easier | |
nmap <C-h> <C-w>h | |
nmap <C-j> <C-w>j | |
nmap <C-k> <C-w>k | |
nmap <C-l> <C-w>l | |
call plug#begin() | |
Plug 'folke/tokyonight.nvim', { 'branch': 'main' } | |
Plug 'itchyny/lightline.vim' | |
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} | |
Plug 'ziglang/zig.vim' | |
Plug 'neoclide/coc.nvim', {'branch': 'release'} | |
call plug#end() | |
" Theming | |
colorscheme tokyonight | |
let g:lightline = {'colorscheme': 'tokyonight'} | |
" Tab settings | |
set tabstop=4 " a tab is four spaces | |
set softtabstop=4 " when hitting <BS>, pretend like a tab is removed, even if spaces | |
set expandtab " don't expand tabs to spaces by default | |
set shiftwidth=4 " number of spaces to use for autoindenting | |
set smarttab | |
set autoindent " always set autoindenting on | |
set copyindent " copy the previous indentation on autoindenting | |
filetype plugin on " use the file type plugins | |
set ruler | |
set hlsearch " highlight search terms | |
set incsearch " show search matches as you type | |
set splitbelow | |
set splitright | |
""" | |
""" Tree Sitter configuration | |
""" | |
lua <<EOF | |
require'nvim-treesitter.configs'.setup { | |
-- One of "all", "maintained" (parsers with maintainers), or a list of languages | |
ensure_installed = "maintained", | |
-- Install languages synchronously (only applied to `ensure_installed`) | |
sync_install = false, | |
-- List of parsers to ignore installing | |
ignore_install = { "javascript" }, | |
highlight = { | |
-- `false` will disable the whole extension | |
enable = true, | |
-- list of language that will be disabled | |
disable = {}, | |
-- Setting this to true will run `:h syntax` and tree-sitter at the same time. | |
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). | |
-- Using this option may slow down your editor, and you may see some duplicate highlights. | |
-- Instead of true it can also be a list of languages | |
additional_vim_regex_highlighting = false, | |
}, | |
indent = { | |
enable = true | |
} | |
} | |
EOF | |
set foldlevel=2 | |
set foldmethod=expr | |
set foldexpr=nvim_treesitter#foldexpr() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment