Skip to content

Commit

Permalink
neovim: fix dracula theme
Browse files Browse the repository at this point in the history
Related to dracula/vim#263
  • Loading branch information
helderberto committed Sep 24, 2021
1 parent 09875a6 commit 6a6da7b
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 68 deletions.
102 changes: 36 additions & 66 deletions nvim/.config/nvim/init.vim
Original file line number Diff line number Diff line change
@@ -1,95 +1,51 @@
" Plugins
call plug#begin('~/.config/nvim/plugged')

Plug 'dracula/vim', { 'as': 'dracula' }
Plug 'nvim-treesitter/nvim-treesitter', { 'do': ':TSUpdate' } " We recommend updating the parsers on update
Plug 'hoob3rt/lualine.nvim'
Plug 'editorconfig/editorconfig-vim'
Plug 'mattn/emmet-vim'
Plug 'tpope/vim-commentary'
Plug 'tpope/vim-fugitive'
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'SirVer/ultisnips'
Plug 'helderburato/aragorn-vim-snippets'
Plug 'jiangmiao/auto-pairs'
Plug 'JamshedVesuna/vim-markdown-preview'

" Initialize plugin system
call plug#end()
" Initialization
set encoding=utf-8
filetype plugin indent on

lua require("hbb")
augroup hbb
autocmd!
augroup

" set leader key to spacebar
let mapleader = "\<space>"
runtime plugins.vim

lua require("hbb")

" General
set encoding=utf-8 " The encoding displayed
set fileencoding=utf-8 " The encoding written to file
syntax on " Enable syntax highlight
set clipboard=unnamedplus " Use system clipboard
set ttyfast " Faster redrawing
set lazyredraw " Only redraw when necessary
set cursorline " Find the current line quickly.
set number " Show line numbers
set hlsearch " Highlight when searching
set is " Highlight on search
set title " Show title at top of the terminal
filetype plugin indent on " Enable loading the plugin files for specific file types
set clipboard+=unnamedplus " Access system clipboard
set timeoutlen=500 " VIM hold up 500ms after key press
set hidden " TextEdit might fail if hidden is not set
set scrolloff=8 " Scroll screen after 8 lines
set scrolloff=6 " Scroll screen after 8 lines
set signcolumn=yes " Add signcolumn
set termguicolors " Force GUI colors in terminals
set foldmethod=syntax " Syntax highlighting items specify folds
set foldlevelstart=99 " Start file with all folds opened
set updatetime=100 " Update delay to 100ms

" Some servers have issues with backup files, see #649.
set nowritebackup
set noswapfile
set nobackup

" Having longer updatetime (default is 4000 ms = 4 s) leads to noticeable
" delays and poor user experience.
set updatetime=100

" Indentation
set tabstop=2
set shiftwidth=2
set shiftround
set expandtab
set autoindent
set smartindent
set autoindent " open lines at same indentation
set expandtab " turn tabs into tabstop spaces
set tabstop=2 " 1 tab = 2 spaces
set shiftwidth=2 " shift 2 spaces

" Display extra whitespace
set list listchars=tab:»·,trail:·,nbsp:·

set textwidth=80

" Folding
set foldmethod=syntax " syntax highlighting items specify folds
set foldlevelstart=99 " start file with all folds opened

" When enter a JavaScript or TypeScript buffer, and disable when leave
autocmd BufEnter *.{js,jsx,ts,tsx} :syntax sync fromstart
autocmd BufLeave *.{js,jsx,ts,tsx} :syntax sync clear

" Jenkins
autocmd BufNewFile,BufRead Jenkinsfile setf groovy

" JSON
autocmd BufNewFile,BufRead .*rc setf json

" Enable Highlight JSDocs
let g:javascript_plugin_jsdoc = 1

" Automatically removing all trailing whitespace
autocmd BufWritePre * :%s/\s\+$//e

" Apply textwidth to *.md files
autocmd BufRead,BufNewFile *.md setlocal textwidth=80

"""""""""""""""""""""""""
" => Mappings
"""""""""""""""""""""""""
" Mappings
" set leader key to spacebar
let mapleader = "\<space>"

" misc
inoremap <C-c> <esc>
Expand Down Expand Up @@ -188,3 +144,17 @@ nnoremap <silent> - :e %:h<cr>
nmap <leader>gg :G<CR>
nmap <leader>gl :diffget //3<CR>
nmap <leader>gh :diffget //2<CR>
augroup hbb
" Enable Groovy syntax into Jenkinsfile
autocmd BufNewFile,BufRead Jenkinsfile setf groovy

" Enable JSON syntax into rc files
autocmd BufNewFile,BufRead .*rc setf json

" Automatically removing all trailing whitespace
autocmd BufWritePre * :%s/\s\+$//e

" Apply textwidth to *.md files
autocmd BufRead,BufNewFile *.md setlocal textwidth=80
augroup END
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
vim.cmd 'colorscheme dracula'
vim.opt.termguicolors = true
vim.g.dracula_italic = 0
2 changes: 1 addition & 1 deletion nvim/.config/nvim/lua/hbb/init.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require("hbb.theme")
require("hbb.colors")
require("hbb.netrw")
require("hbb.treesiter")
require("hbb.lualine")
20 changes: 20 additions & 0 deletions nvim/.config/nvim/plugins.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
" Plugins
call plug#begin('~/.config/nvim/plugged')

Plug 'dracula/vim', { 'as': 'dracula' }
Plug 'nvim-treesitter/nvim-treesitter', { 'do': ':TSUpdate' } " We recommend updating the parsers on update
Plug 'hoob3rt/lualine.nvim'
Plug 'editorconfig/editorconfig-vim'
Plug 'mattn/emmet-vim'
Plug 'tpope/vim-commentary'
Plug 'tpope/vim-fugitive'
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'SirVer/ultisnips'
Plug 'helderburato/aragorn-vim-snippets'
Plug 'jiangmiao/auto-pairs'
Plug 'JamshedVesuna/vim-markdown-preview'

" Initialize plugin system
call plug#end()

0 comments on commit 6a6da7b

Please sign in to comment.