I'm using nord theme, it works normally with other kind of files but not flex file
I have syntax on
and filetype on
I tried switching colorthing from gruvbox to nord but it still behaving the same.
this is my vimrc file
set guifont=Fira\ Code\ 18
nnoremap <A-j> :m .+1<CR>==
nnoremap <A-k> :m .-2<CR>==
inoremap <A-j> <Esc>:m .+1<CR>==gi
inoremap <A-k> <Esc>:m .-2<CR>==gi
vnoremap <A-j> :m '>+1<CR>gv=gv
vnoremap <A-k> :m '<-2<CR>gv=gv
" line number
set number
syntax on
filetype on " required
set nocompatible " be iMproved, required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
syntax oncall vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
Plugin 'Valloric/YouCompleteMe'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
call plug#begin(has('nvim') ? stdpath('data') . '/plugged' : '~/.vim/plugged')
" Any valid git URL is allowed
Plug 'https://github.com/junegunn/vim-github-dashboard.git'
" Using a non-default branch
Plug 'rdnetto/YCM-Generator', { 'branch': 'stable' }
" Using a tagged release; wildcard allowed (requires git 1.9.2 or above)
Plug 'fatih/vim-go', { 'tag': '*' }
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'arcticicestudio/nord-vim'
Plug 'preservim/nerdtree'
"Plug 'morhetz/gruvbox'
call plug#end()
"let g:gruvbox_gruvbox_contrast_dark = 'soft'
"colorscheme gruvbox
"set background=dark
colorscheme nord
" custom key bindings
vmap <C-c> "+yi
vmap <C-x> "+c
vmap <C-v> c<ESC>"+p
imap <C-v> <C-r><C-o>+
" set compatibility to vim only
set nocompatibible
" status bar
set laststatus=2
"auto wrap text that extents beyond the sreen length
set wrap
" Encoding
set encoding=utf-8
filetype plugin indent on
" show existing tab with 4 spaces width
set tabstop=4
" when indenting with '>', use 4 spaces width
set shiftwidth=4
" On pressing tab, insert 4 spaces
set expandtab
set smartindent
" Auto save
let g:auto_save = 1
autocmd TextChanged, TextChangedI <buffer> silent write
autocmd BufRead, BufNewFile * start
" Airline
let g:airline_theme = 'base16_adwaita'
let g:airline_powerline_fonts = 1
set tags+=./tags;,tags
let g:zettelkasten = "/home/danhpc/opt/note_linked/"
" Make Ctrlp use ripgrep
if executable('rg')
let g:ctrlp_user_command = 'rg %s --files --color=never --glob ""'
let g:ctrlp_user_caching = 0
endif
" Make :grep use ripgrep
if executable('rg')
set grepprg=rg\ --color=never\ --vimgrep
endif
" My own version, only searches markdown as well using ripgrep
" Thus depends on grepprg being set to rg
command! -nargs=1 Ngrep grep "<args>" -g "*.md" $NOTES_DIR
nnoremap <leader>nn :Ngrep<space>
command! Vlist botright vertical copen | vertical resize 50
nnoremap <leader>v :Vlist<CR>
" Generate ctags
nnoremap <leader>tt :silent !ctags -R . <CR>:redraw!<CR>
" Go to tag file
nnoremap <leader>nt :e $NOTES_DIR/tags<CR>:cd $NOTES_DIR<CR>
" Go to the note dir
nnoremap <leader>nd :ex $NOTES_DIR<CR>:cd $NOTES_DIR<CR>
" Change directory to directory of current file
nnoremap <leader>cd :cd %:h<CR>
" Binding for searching tags ("search tag")
nnoremap <leader>st :CtrlPTag<CR>
" 1) pre-fills all the stuff we don’t want to type, namely the timestamp and the extension (always markdown)
" 2) that prompts you for the name of your note
command! -nargs=1 NewZettel :execute ":e" zettelkasten . strftime("%Y%m%d%H%M%S") . "-<args>.md"
nnoremap <leader>nz :NewZettel
" CtrlP function for inserting a markdown link with Ctrl-X
function! CtrlPOpenFunc(action, line)
if a:action =~ '^h$'
" Get the filename
let filename = fnameescape(fnamemodify(a:line, ':t'))
let l:filename_wo_timestamp = fnameescape(fnamemodify(a:line, ':t:s/\(^\d\+-\)\?\(.*\)\..\{1,3\}/\2/'))
let l:filename_wo_timestamp = substitute(l:filename_wo_timestamp, "_", " ", "g")
" Close CtrlP
call ctrlp#exit()
call ctrlp#mrufiles#add(filename)
" Insert the markdown link to the file in the current buffer
let mdlink = "[".filename_wo_timestamp."]( ".filename." )"
put=mdlink
else
" Use CtrlP's default file opening function
call call('ctrlp#acceptfile', [a:action, a:line])
endif
endfunction
let g:ctrlp_open_func = {
\ 'files': 'CtrlPOpenFunc',
\ 'mru files': 'CtrlPOpenFunc'
\ }
Edit 1: a part of my flex file
%x NESTED_COMMENT INLINE_COMMENT
int nested_level = 0;
%}
DARROW =>
%%
// Nested comment
<INITIAL,NESTED_COMMENT>"(*" {BEGIN NESTED_COMMENT;
++nested_level;}
<NESTED_COMMENT>"*"+) {if(nested_level) --nested_level;
else BEGIN INITIAL;}
<NESTED_COMMENT>[^*)\n]+ { }
<NESTED_COMMENT>"*"+ { }
<NESTED_COMMENT>\n { }
// inline comment
<INITIAL>
vimrc
. Since you did, may I say that it looks just a little bit cluttered? Two plugin managers being used, the same options being set multiple times etc.Plug
then I needVurdle
to isntallYCM
. If you have any tips to make myvimrc
more concise, I would really appreciate.