Package up vim-prettier plugin

This commit is contained in:
Dave Gallant
2021-02-06 01:32:21 -05:00
parent 3d5eccd772
commit 3c477cbfc6
3 changed files with 125 additions and 111 deletions

View File

@@ -1,6 +1,16 @@
{ pkgs, ... }: { pkgs, ... }:
{ let
vim-prettier = pkgs.vimUtils.buildVimPlugin {
name = "vim-prettier";
src = pkgs.fetchFromGitHub {
owner = "prettier";
repo = "vim-prettier";
rev = "0.2.7";
sha256 = "sha256-FDeyGH5OPAYV7zePCfDujsj+nGd5AFnqySPStJYEY2E=";
};
};
in {
home = { sessionVariables = { EDITOR = "vim"; }; }; home = { sessionVariables = { EDITOR = "vim"; }; };
@@ -152,7 +162,6 @@
window.padding.y = 10; window.padding.y = 10;
scrolling.history = 100000; scrolling.history = 100000;
live_config_reload = true; live_config_reload = true;
selection.save_to_clipboard = true;
mouse.hide_when_typing = true; mouse.hide_when_typing = true;
font = { font = {
@@ -291,7 +300,6 @@
vimAlias = true; vimAlias = true;
extraConfig = builtins.readFile ./init.vim; extraConfig = builtins.readFile ./init.vim;
plugins = with pkgs.vimPlugins; [ plugins = with pkgs.vimPlugins; [
coc-go coc-go
coc-json coc-json
@@ -314,6 +322,7 @@
vim-markdown vim-markdown
vim-nix vim-nix
vim-pandoc vim-pandoc
vim-prettier
vim-pandoc-syntax vim-pandoc-syntax
vim-repeat vim-repeat
vim-sneak vim-sneak

View File

@@ -1,24 +1,24 @@
set autoread set autoread
set cursorline set cursorline
set encoding=utf-8 set encoding=utf-8
set expandtab set expandtab
set foldlevel=99 set foldlevel=99
set foldmethod=indent set foldmethod=indent
set hlsearch set hlsearch
set ignorecase set ignorecase
set incsearch set incsearch
set mouse=a set mouse=a
set nocompatible set nocompatible
set noswapfile set noswapfile
set number relativenumber set number relativenumber
set pastetoggle=<F3> set pastetoggle=<F3>
set shiftwidth=2 set shiftwidth=2
set showcmd set showcmd
set showmode set showmode
set smartcase set smartcase
set t_Co=256 set t_Co=256
set tabstop=2 set tabstop=2
set wildmenu set wildmenu
" Custom statusline " Custom statusline
function! GitBranch() function! GitBranch()
@@ -44,108 +44,112 @@ set statusline+=\[%{&fileformat}\]
set statusline+=\ %p%% set statusline+=\ %p%%
set statusline+=\ %l:%c set statusline+=\ %l:%c
" Remember line number " Remember line number
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal! g`\"" | endif au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal! g`\"" | endif
" Search down into subfolders " Search down into subfolders
" Provides tab-completion for all file-related tasks " Provides tab-completion for all file-related tasks
set path+=** set path+=**
filetype plugin indent on filetype plugin indent on
" Enable folding with the spacebar " Enable folding with the spacebar
nnoremap <space> za nnoremap <space> za
" Replace visually selected " Replace visually selected
vnoremap <C-r> "hy:%s/<C-r>h//g<left><left> vnoremap <C-r> "hy:%s/<C-r>h//g<left><left>
" Custom Commands " Custom Commands
command JsonFormat execute "::%!jq '.'" command JsonFormat execute "::%!jq '.'"
" Shortcuts " Shortcuts
map <Leader>r :Rg<CR> map <Leader>r :Rg<CR>
map <Leader>f :Files<CR> map <Leader>f :Files<CR>
map <Leader>g :GFiles<CR> map <Leader>g :GFiles<CR>
map <Leader>n :NERDTreeToggle<CR> map <Leader>n :NERDTreeToggle<CR>
map <C-s> :tabn<CR> map <C-s> :tabn<CR>
map <C-a> :tabp<CR> map <C-a> :tabp<CR>
map <C-n> :tabnew<CR> map <C-n> :tabnew<CR>
" Copypasta " Copypasta
noremap <Leader>y "+y noremap <Leader>y "+y
noremap <Leader>p "+p noremap <Leader>p "+p
" Indent YAML " Indent YAML
au FileType yaml setlocal ts=2 sts=2 sw=2 expandtab au FileType yaml setlocal ts=2 sts=2 sw=2 expandtab
" Python indentation " Python indentation
au BufNewFile,BufRead *.py set tabstop=4 softtabstop=4 shiftwidth=4 textwidth=79 expandtab autoindent fileformat=unix au BufNewFile,BufRead *.py set tabstop=4 softtabstop=4 shiftwidth=4 textwidth=79 expandtab autoindent fileformat=unix
let python_highlight_all=1 let python_highlight_all=1
syntax on syntax on
colorscheme gruvbox colorscheme gruvbox
" Highlight whitespace " Highlight whitespace
highlight ExtraWhitespace ctermbg=red guibg=red highlight ExtraWhitespace ctermbg=red guibg=red
match ExtraWhitespace /\s\+$/ match ExtraWhitespace /\s\+$/
" Groovy syntax " Groovy syntax
au BufNewFile,BufRead *.groovy set tabstop=2 shiftwidth=2 expandtab au BufNewFile,BufRead *.groovy set tabstop=2 shiftwidth=2 expandtab
au BufNewFile,BufRead Jenkinsfile setf groovy au BufNewFile,BufRead Jenkinsfile setf groovy
au BufNewFile,BufRead Jenkinsfile set tabstop=2 shiftwidth=2 expandtab au BufNewFile,BufRead Jenkinsfile set tabstop=2 shiftwidth=2 expandtab
" vim-go " vim-go
let g:go_auto_sameids = 0 let g:go_auto_sameids = 0
let g:go_fmt_command = "goimports" let g:go_fmt_command = "goimports"
let g:go_fmt_experimental = 1 let g:go_fmt_experimental = 1
let g:go_highlight_array_whitespace_error = 1 let g:go_highlight_array_whitespace_error = 1
let g:go_highlight_build_constraints = 1 let g:go_highlight_build_constraints = 1
let g:go_highlight_chan_whitespace_error = 1 let g:go_highlight_chan_whitespace_error = 1
let g:go_highlight_extra_types = 1 let g:go_highlight_extra_types = 1
let g:go_highlight_fields = 1 let g:go_highlight_fields = 1
let g:go_highlight_format_strings = 1 let g:go_highlight_format_strings = 1
let g:go_highlight_function_calls = 1 let g:go_highlight_function_calls = 1
let g:go_highlight_function_parameters = 1 let g:go_highlight_function_parameters = 1
let g:go_highlight_functions = 1 let g:go_highlight_functions = 1
let g:go_highlight_generate_tags = 1 let g:go_highlight_generate_tags = 1
let g:go_highlight_operators = 1 let g:go_highlight_operators = 1
let g:go_highlight_space_tab_error = 1 let g:go_highlight_space_tab_error = 1
let g:go_highlight_string_spellcheck = 1 let g:go_highlight_string_spellcheck = 1
let g:go_highlight_trailing_whitespace_error = 0 let g:go_highlight_trailing_whitespace_error = 0
let g:go_highlight_types = 1 let g:go_highlight_types = 1
let g:go_highlight_variable_assignments = 1 let g:go_highlight_variable_assignments = 1
let g:go_highlight_variable_declarations = 1 let g:go_highlight_variable_declarations = 1
let g:go_rename_command = 'gopls' let g:go_rename_command = 'gopls'
let g:go_metalinter_autosave=1 let g:go_metalinter_autosave=1
let g:go_metalinter_autosave_enabled=['golint', 'govet'] let g:go_metalinter_autosave_enabled=['golint', 'govet']
" vim-terraform " vim-terraform
let g:terraform_align=1 let g:terraform_align=1
let g:terraform_fmt_on_save=1 let g:terraform_fmt_on_save=1
let g:terraform_fold_sections=1 let g:terraform_fold_sections=1
" rust.vim " rust.vim
let g:rustfmt_autosave = 1 let g:rustfmt_autosave = 1
" syntastic " syntastic
set statusline+=%#warningmsg# set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()} set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%* set statusline+=%*
let g:syntastic_always_populate_loc_list = 1 let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1 let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1 let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0 let g:syntastic_check_on_wq = 0
" fzf.vim " fzf.vim
let g:fzf_preview_window = 'up:50%' let g:fzf_preview_window = 'up:50%'
let g:fzf_layout = { 'window': 'enew' } let g:fzf_layout = { 'window': 'enew' }
" vim-markdown " vim-markdown
let g:vim_markdown_override_foldtext=0 let g:vim_markdown_override_foldtext=0
let g:vim_markdown_no_default_key_mappings=1 let g:vim_markdown_no_default_key_mappings=1
let g:vim_markdown_emphasis_multiline=0 let g:vim_markdown_emphasis_multiline=0
let g:vim_markdown_conceal=0 let g:vim_markdown_conceal=0
let g:vim_markdown_frontmatter=1 let g:vim_markdown_frontmatter=1
let g:vim_markdown_new_list_item_indent=0 let g:vim_markdown_new_list_item_indent=0
" vim-javacomplete2
autocmd FileType java setlocal omnifunc=javacomplete#Complete
" vim-prettier
let g:prettier#autoformat = 1
" vim-javacomplete2
autocmd FileType java setlocal omnifunc=javacomplete#Complete

View File

@@ -56,6 +56,7 @@
# node # node
nodejs-14_x nodejs-14_x
nodePackages.prettier
nodePackages.yarn nodePackages.yarn
# social media # social media