Cian Butler před 2 měsíci
rodič
revize
40990bbe12
Podepsáno: butlerx ID GPG klíče: B37CA765BAA89170
19 změnil soubory, kde provedl 460 přidání a 355 odebrání
  1. +21
    -0
      config/nvim/autoload/functions.vim
  2. +2
    -0
      config/nvim/indent/html.lua
  3. +0
    -2
      config/nvim/indent/html.vim
  4. +225
    -0
      config/nvim/init.lua
  5. +0
    -218
      config/nvim/init.vim
  6. +46
    -0
      config/nvim/lua/plugins.lua
  7. +21
    -0
      config/nvim/lua/utils.lua
  8. +0
    -39
      config/nvim/plug.vim
  9. +2
    -2
      config/nvim/plugin/airline.vim
  10. +70
    -0
      config/nvim/plugin/ale.lua
  11. +0
    -62
      config/nvim/plugin/ale.vim
  12. +0
    -2
      config/nvim/plugin/findRm.vim
  13. +4
    -0
      config/nvim/plugin/hipster.lua
  14. +0
    -5
      config/nvim/plugin/hipster.vim
  15. +5
    -0
      config/nvim/plugin/indent.lua
  16. +0
    -5
      config/nvim/plugin/indent.vim
  17. +19
    -19
      config/nvim/plugin/lsp.lua
  18. +1
    -1
      config/nvim/plugin/nerdtree.vim
  19. +44
    -0
      config/nvim/plugin/startify.lua

+ 21
- 0
config/nvim/autoload/functions.vim Zobrazit soubor

@@ -0,0 +1,21 @@
" load vim-plug if it does not exist in the dotfiles
let s:plugpath = '~/.local/share/nvim/site/autoload/plug.vim'
function! functions#PlugLoad()
if empty(glob(s:plugpath))
if executable('curl')
echom "Installing vim-plug at " . s:plugpath
let plugurl = 'https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
call system('curl -fLo ' . shellescape(s:plugpath) . ' --create-dirs ' . plugurl)
if v:shell_error
echom "Error downloading vim-plug. Please install it manually.\n"
exit
endif
augroup Plugins
au!
au VimEnter * PlugInstall | source $MYVIMRC
else
echom "vim-plug not installed. Please install it manually or install curl.\n"
exit
endif
endif
endfunction

+ 2
- 0
config/nvim/indent/html.lua Zobrazit soubor

@@ -0,0 +1,2 @@
-- Indent after <p> paragraph tags too
vim.g.html_indent_inctags = 'p'

+ 0
- 2
config/nvim/indent/html.vim Zobrazit soubor

@@ -1,2 +0,0 @@
" Indent after <p> paragraph tags too
let g:html_indent_inctags = 'p'

+ 225
- 0
config/nvim/init.lua Zobrazit soubor

@@ -0,0 +1,225 @@
local utils = require("utils")
local set = vim.opt
local map = utils.map

vim.cmd [[runtime system.vim]]
require('plugins')

if vim.api.nvim_eval("has('autocmd')") then
-- Set leader to space
vim.g.mapleader = " "
vim.cmd [[filetype plugin indent on]]
end
if vim.api.nvim_eval("has('syntax')") then
-- Use syntax highlighting
if not vim.g.syntax_on then
vim.cmd [[syntax enable]]
end
-- Use my colorscheme if using the GUI or if we have 256 colors
if vim.api.nvim_eval("has('gui_running') || &t_Co >= 256") then
vim.cmd [[silent! color monokai]]
end
-- If not monokai, then default with dark background
if not vim.g.colors_name then
vim.o.background = "dark"
end
end

-- Use UTF-8 if we can and env LANG didn't tell us not to
if vim.api.nvim_eval("has('multi_byte') && !exists('$LANG') && &encoding ==# 'latin1'") then
set.encoding = "utf-8"
end

-- The all-important default indent settings; filetypes to tweak
set.autoindent = true -- Use indent of previous line on new lines
set.expandtab = true -- Use spaces instead of tabs
set.shiftwidth = 2 -- Indent with two spaces
set.softtabstop = 2 -- Insert two spaces with tab key
set.smartindent = true -- Enable smart-indent
set.smarttab = true -- Enable smart-tabs
set.tabstop = 2
set.cindent = true

-- Let me backspace over pretty much anything
set.backspace = "indent,eol,start"
-- Indent wrapped lines
set.breakindent = true

-- Give me a prompt instead of just rejecting risky :write, :saveas
set.confirm = true

-- Clear default 'comments' value, let the filetype handle it
set.comments = ""

vim.cmd [[
" Add completion options
if exists('+completeopt')
set completeopt+=noinsert
set completeopt+=longest " Insert longest common substring
set completeopt+=menuone " Show the menu even if only one match
set completeopt+=noselect " Show the menu even if only one match
else
set completeopt=noinsert,longest,menuone,noselect
endif

" Don't wait for a key after Escape in insert mode
" In vim-tiny but not NeoVim, so just suppress errors
silent! set noesckeys

" Fold based on indent, but only when I ask
if has('folding')
set foldlevelstart=99
set foldmethod=indent
endif

" Delete comment leaders when joining lines, if supported
silent! set formatoptions+=j

" If available, use GNU grep niceties for searching
if system('grep --version') =~# '^grep (GNU grep)'
set grepprg=grep\ -HnRs\ --exclude='.git*'
endif

" Don't load GUI menus; set here before GUI starts
if has('gui_running')
set guioptions+=M
set guioptions+=LlRrb
set guioptions-=LlRrb
set guioptions-=T
set guioptions-=m
endif

" Allow buffers to have changes without being displayed
set hidden

" Keep much more command and search history
set history=2000

" Highlight completed searches; clear on reload
set hlsearch
if 1
nohlsearch
endif
]]
-- Don't assume I'm editing C; let the filetype set this
set.include=""

vim.cmd [[
" Show search matches as I type my pattern
set incsearch

" Don't join lines with two spaces at the end of sentences
set nojoinspaces

" Don't show a statusline if there's only one window
" This is the Vim default, but NeoVim changed it
if &laststatus != 1
set laststatus=1
endif

" Don't redraw the screen during batch execution
set lazyredraw

" Break lines at word boundaries
set linebreak

" Disable command line display of file position
" This is the Vim default, but NeoVim changed it
if &ruler
set noruler
endif

" Show row and column ruler information
set ruler
set colorcolumn=100

" Options for file search with gf/:find
set path-=/usr/include " Let the C/C++ filetypes set that
set path+=** " Search current directory's whole tree

" Prefix wrapped rows with three dots
set showbreak=...

" New windows go below or to the right of a split
set splitbelow
set splitright

" Give me a bit longer to complete mappings
set notimeout
set nottimeout
set timeoutlen=10000
set ttimeoutlen=10000

" No terminal mouse, even if we could
silent! set ttymouse=

" Keep undo files, hopefully in a dedicated directory
if has('persistent_undo')
set undofile
set undodir^=~/.vim/cache/undo//
endif
set undolevels=1000 " Number of undo levels

" Wildmenu settings; see also plugin/wildignore.vim
set wildmenu " Use wildmenu
"set wildmode=list:longest " Tab press completes and lists
silent! set wildignorecase " Case insensitive, if supported

" Let me move beyond buffer text in visual block mode
if exists('+virtualedit')
set virtualedit+=block
endif
]]

set.diffopt = "filler,iwhite"
set.fileencoding="utf-8"
vim.cmd [[set fillchars+=stl:\ ,stlnc:\ ]]
set.foldcolumn = "1"
set.foldlevel = 0
set.foldmethod = "expr"
set.foldexpr = "nvim_treesitter#foldexpr()"
-- Always case-insensitive
set.ignorecase = true
set.laststatus = 2
-- Break lines at word (requires Wrap lines)
set.linebreak = true
vim.cmd [[
set list lcs=tab:\|\
set noerrorbells vb t_vb=
]]
set.foldenable = false
-- Show line numbers
set.number = true
set.omnifunc = "syntaxcomplete#Complete"
set.scrolloff = 1
set.showcmd = true
-- Highlight matching brace
set.showmatch = true
-- Enable smart-case search
set.smartcase = true
vim.cmd [[set termencoding=utf-8]]
-- Line wrap (number of cols)
set.textwidth = 100
-- Use visual bell (no beeping)
set.visualbell = true

-- Delete Selected word from whole file
map {'n', '<Leader>s', ':%s/<<C-r><C-w>>//g<Left><Left>'}

-- Stop C-r from being seen as backspace
map {'n', '<BS>', ':TmuxNavigateLeft<cr>'}

-- \R reloads ~/.vimrc
map {'n', '<Bslash>R', ':<C-U>source $MYVIMRC<CR>'}

-- \DEL deletes the current buffer
map {'n', '<Bslash><Delete>', ':bdelete<CR>'}

-- \INS edits a new buffer
map {'n', '<Bslash><Insert>', ':<C-U>enew<CR>'}

-- \/ types :vimgrep for me ready to enter a search pattern
map {'n', '<Bslash>/', ':<C-U>vimgrep /c/ **<S-Left><S-Left><Right>'}

-- \p toggles paste mode
map {'n', '<Bslash>p', ':<C-U>set paste! paste?<CR>'}

+ 0
- 218
config/nvim/init.vim Zobrazit soubor

@@ -1,218 +0,0 @@
runtime system.vim

" Plug initialization
if empty(glob('~/.local/share/nvim/site/autoload/plug.vim'))
silent !curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
augroup Plugins
au!
au VimEnter * PlugInstall | source $MYVIMRC
augroup END
endif
call plug#begin('~/.local/share/nvim')
runtime plug.vim
call plug#end()

if has('autocmd')
"Set leader to space
let g:mapleader = "\<Space>"
filetype plugin indent on
endif

if has('syntax')
" Use syntax highlighting
if !exists('g:syntax_on')
syntax enable
endif
" Use my colorscheme if using the GUI or if we have 256 colors
if has('gui_running') || &t_Co >= 256
silent! color monokai
endif
" If not monokai, then default with dark background
if !exists('g:colors_name')
set background=dark
endif
endif

" Use UTF-8 if we can and env LANG didn't tell us not to
if has('multi_byte') && !exists('$LANG') && &encoding ==# 'latin1'
set encoding=utf-8
endif

" The all-important default indent settings; filetypes to tweak
set autoindent " Use indent of previous line on new lines
set expandtab " Use spaces instead of tabs
set shiftwidth=2 " Indent with two spaces
set softtabstop=2 " Insert two spaces with tab key
set smartindent " Enable smart-indent
set smarttab " Enable smart-tabs
set tabstop=2
set cindent shiftwidth=2

" Let me backspace over pretty much anything
set backspace=indent,eol,start

" Indent wrapped lines
silent! set breakindent

" Give me a prompt instead of just rejecting risky :write, :saveas
set confirm

" Clear default 'comments' value, let the filetype handle it
set comments=

" Add completion options
if exists('+completeopt')
set completeopt+=noinsert
set completeopt+=longest " Insert longest common substring
set completeopt+=menuone " Show the menu even if only one match
set completeopt+=noselect " Show the menu even if only one match
else
set completeopt=noinsert,longest,menuone,noselect
endif

" Don't wait for a key after Escape in insert mode
" In vim-tiny but not NeoVim, so just suppress errors
silent! set noesckeys

" Fold based on indent, but only when I ask
if has('folding')
set foldlevelstart=99
set foldmethod=indent
endif

" Delete comment leaders when joining lines, if supported
silent! set formatoptions+=j

" If available, use GNU grep niceties for searching
if system('grep --version') =~# '^grep (GNU grep)'
set grepprg=grep\ -HnRs\ --exclude='.git*'
endif

" Don't load GUI menus; set here before GUI starts
if has('gui_running')
set guioptions+=M
set guioptions+=LlRrb
set guioptions-=LlRrb
set guioptions-=T
set guioptions-=m
endif

" Allow buffers to have changes without being displayed
set hidden

" Keep much more command and search history
set history=2000

" Highlight completed searches; clear on reload
set hlsearch
if 1
nohlsearch
endif

" Don't assume I'm editing C; let the filetype set this
set include=

" Show search matches as I type my pattern
set incsearch

" Don't join lines with two spaces at the end of sentences
set nojoinspaces

" Don't show a statusline if there's only one window
" This is the Vim default, but NeoVim changed it
if &laststatus != 1
set laststatus=1
endif

" Don't redraw the screen during batch execution
set lazyredraw

" Break lines at word boundaries
set linebreak

" Disable command line display of file position
" This is the Vim default, but NeoVim changed it
if &ruler
set noruler
endif

" Show row and column ruler information
set ruler
set colorcolumn=100

" Options for file search with gf/:find
set path-=/usr/include " Let the C/C++ filetypes set that
set path+=** " Search current directory's whole tree

" Prefix wrapped rows with three dots
set showbreak=...

" New windows go below or to the right of a split
set splitbelow
set splitright

" Give me a bit longer to complete mappings
set notimeout
set nottimeout
set timeoutlen=10000
set ttimeoutlen=10000

" No terminal mouse, even if we could
silent! set ttymouse=

" Keep undo files, hopefully in a dedicated directory
if has('persistent_undo')
set undofile
set undodir^=~/.vim/cache/undo//
endif
set undolevels=1000 " Number of undo levels

" Wildmenu settings; see also plugin/wildignore.vim
set wildmenu " Use wildmenu
"set wildmode=list:longest " Tab press completes and lists
silent! set wildignorecase " Case insensitive, if supported

" Let me move beyond buffer text in visual block mode
if exists('+virtualedit')
set virtualedit+=block
endif

set diffopt=filler,iwhite
set fileencoding=utf-8
set fillchars+=stl:\ ,stlnc:\
set foldcolumn=1
set foldlevel=0
set foldmethod=indent
set ignorecase " Always case-insensitive
set laststatus=2
set linebreak " Break lines at word (requires Wrap lines)
set list lcs=tab:\|\
set noerrorbells vb t_vb=
set nofoldenable
set number " Show line numbers
set omnifunc=syntaxcomplete#Complete
set scrolloff=1
set showcmd
set showmatch " Highlight matching brace
set smartcase " Enable smart-case search
set termencoding=utf-8
set textwidth=100 " Line wrap (number of cols)
set visualbell " Use visual bell (no beeping)

" Stop C-r from being seen as backspace
nnoremap <silent> <BS> :TmuxNavigateLeft<cr>

" \R reloads ~/.vimrc
nnoremap <Bslash>R :<C-U>source $MYVIMRC<CR>

" \DEL deletes the current buffer
nnoremap <Bslash><Delete> :bdelete<CR>
" \INS edits a new buffer
nnoremap <Bslash><Insert> :<C-U>enew<CR>

" \/ types :vimgrep for me ready to enter a search pattern
nnoremap <Bslash>/ :<C-U>vimgrep /\c/ **<S-Left><S-Left><Right>

" \p toggles paste mode
nnoremap <Bslash>p :<C-U>set paste! paste?<CR>

+ 46
- 0
config/nvim/lua/plugins.lua Zobrazit soubor

@@ -0,0 +1,46 @@
local Plug = vim.fn['plug#']

vim.call('functions#PlugLoad')
vim.call('plug#begin', '~/.local/share/nvim')

Plug('Yggdroot/indentLine')
Plug('cespare/vim-toml', {['for']='toml'})
Plug('chrisbra/csv.vim', {['for']='csv'})
Plug('christoomey/vim-tmux-navigator')
Plug('dense-analysis/ale')
Plug('nathanmsmith/nvim-ale-diagnostic')
Plug('ekalinin/Dockerfile.vim', {['for']=[['Dockerfile', 'docker-compose']]})
Plug('elzr/vim-json')
Plug('fatih/vim-go', {['do']=':GoInstallBinaries', ['for']=[['go', 'gohtmltmpl']]})
Plug('godlygeek/tabular')
Plug('plasticboy/vim-markdown')
Plug('google/vim-jsonnet')
Plug('gregsexton/gitv')
Plug('hashivim/vim-terraform')
Plug('hrsh7th/nvim-cmp')
Plug('hrsh7th/vim-vsnip')
Plug('hrsh7th/cmp-buffer')
Plug('leafgarland/typescript-vim', {['for']=[['typescript.tsx', 'typescriptreact', 'typescript',
'vue']]})
Plug('mhinz/vim-signify')
Plug('mhinz/vim-startify')
Plug('moll/vim-node')
Plug('neovim/nvim-lspconfig')
Plug('kabouzeid/nvim-lspinstall')
Plug('nvim-treesitter/nvim-treesitter', {['branch']='0.5-compat', ['do']=':TSUpdate'})
Plug('pangloss/vim-javascript', {['for']=[['typescript.tsx', 'typescriptreact', 'javascript', 'vue']]})
Plug('racer-rust/vim-racer', {['for']='rust'})
Plug('rodjek/vim-puppet')
Plug('rust-lang/rust.vim', {['for']='rust'})
Plug('ryanoasis/vim-devicons')
Plug('scrooloose/nerdcommenter')
Plug('scrooloose/nerdtree')
Plug('Xuyuanp/nerdtree-git-plugin')
Plug('sheerun/vim-polyglot')
Plug('sickill/vim-monokai')
Plug('tpope/vim-fugitive')
Plug('tpope/vim-surround')
Plug('vim-airline/vim-airline')
Plug('vim-airline/vim-airline-themes')

vim.call('plug#end')

+ 21
- 0
config/nvim/lua/utils.lua Zobrazit soubor

@@ -0,0 +1,21 @@
local utils = {}

utils.map = function (key)
-- get the extra options
local opts = { noremap=true, silent=true }
for i, v in pairs(key) do
if type(i) == 'string' then opts[i] = v end
end

-- basic support for buffer-scoped keybindings
local buffer = opts.buffer
opts.buffer = nil

if buffer then
vim.api.nvim_buf_set_keymap(0, key[1], key[2], key[3], opts)
else
vim.api.nvim_set_keymap(key[1], key[2], key[3], opts)
end
end

return utils

+ 0
- 39
config/nvim/plug.vim Zobrazit soubor

@@ -1,39 +0,0 @@
" vim: set syntax=vim:
Plug 'Yggdroot/indentLine'
Plug 'cespare/vim-toml', { 'for': 'toml' }
Plug 'chrisbra/csv.vim', { 'for': 'csv' }
Plug 'christoomey/vim-tmux-navigator'
Plug 'dense-analysis/ale' |
Plug 'nathanmsmith/nvim-ale-diagnostic'
Plug 'ekalinin/Dockerfile.vim', { 'for': ['Dockerfile', 'docker-compose'] }
Plug 'elzr/vim-json'
Plug 'fatih/vim-go', { 'do': ':GoInstallBinaries', 'for': ['go', 'gohtmltmpl'] }
Plug 'godlygeek/tabular' |
Plug 'plasticboy/vim-markdown'
Plug 'google/vim-jsonnet'
Plug 'gregsexton/gitv'
Plug 'hashivim/vim-terraform'
Plug 'hrsh7th/nvim-cmp' |
Plug 'hrsh7th/vim-vsnip' |
Plug 'hrsh7th/cmp-buffer'
Plug 'leafgarland/typescript-vim', { 'for': ['typescript.tsx', 'typescriptreact', 'typescript', 'vue'] }
Plug 'mhinz/vim-signify'
Plug 'mhinz/vim-startify'
Plug 'moll/vim-node'
Plug 'neovim/nvim-lspconfig' |
Plug 'kabouzeid/nvim-lspinstall'
Plug 'nvim-treesitter/nvim-treesitter', { 'branch': '0.5-compat', 'do': ':TSUpdate'}
Plug 'pangloss/vim-javascript', { 'for': ['typescript.tsx', 'typescriptreact', 'javascript', 'vue'] }
Plug 'racer-rust/vim-racer', { 'for': 'rust' }
Plug 'rodjek/vim-puppet'
Plug 'rust-lang/rust.vim', { 'for': 'rust' }
Plug 'ryanoasis/vim-devicons'
Plug 'scrooloose/nerdcommenter'
Plug 'scrooloose/nerdtree' |
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'sheerun/vim-polyglot'
Plug 'sickill/vim-monokai'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-surround'
Plug 'vim-airline/vim-airline' |
Plug 'vim-airline/vim-airline-themes'

+ 2
- 2
config/nvim/plugin/airline.vim Zobrazit soubor

@@ -1,7 +1,7 @@
" vim airline
let g:airline_powerline_fonts = 1
let g:airline_powerline_fonts = v:true
let g:airline#extensions#po#displayed_limit = 80
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#enabled = v:true
let g:airline#extensions#tabline#left_alt_sep = '|'
let g:airline#extensions#tabline#right_alt_sep = '|'
let g:airline#extensions#tabline#formatter = 'unique_tail_improved'


+ 70
- 0
config/nvim/plugin/ale.lua Zobrazit soubor

@@ -0,0 +1,70 @@
local utils = require('utils')

vim.g['ale_fixers'] = {
['javascript'] = [['prettier', 'eslint']],
['typescript'] = [['prettier', 'tslint', 'eslint']],
['typescriptreact'] = [['prettier', 'tslint', 'eslint']],
['html'] = [['eslint']],
['json'] = [['prettier', 'fixjson', 'jq']],
['scss'] = [['prettier', 'stylelint']],
['css'] = [['prettier', 'stylelint']],
['less'] = [['prettier', 'stylelint']],
['stylus'] = [['stylelint']],
['c'] = [['clang-format']],
['cpp'] = [['clang-format']],
['rust'] = [['rustfmt']],
['python'] = [['yapf', 'isort', 'black']],
['zsh'] = [['shfmt']],
['sh'] = [['shfmt']],
['go'] = [['gofmt', 'goimports']],
['markdown'] = [['prettier']],
['vue'] = [['prettier']],
['yaml'] = [['prettier']],
['ansible'] = [['prettier']],
['puppet'] = [['puppetlint']],
['java'] = [['google_java_format']]
}
vim.g['ale_fix_on_save'] = 1
vim.g['ale_go_gofmt_options'] = '-s'
vim.g['ale_go_gometalinter_options'] = '--fast'
vim.g['ale_go_golangci_lint_options'] = '--fast'
vim.g['ale_go_golangci_lint_package'] = 1
vim.g['ale_rust_cargo_use_clippy'] = 1
vim.g['ale_rust_analyzer_config'] = {
['rust-analyzer'] = {
['assist'] = {
['importMergeBehavior'] = 'last',
['importPrefix'] = 'by_self',
},
['cargo.loadOutDirsFromCheck'] = true,
['procMacro.enable'] = true
}
}
vim.g['ale_linters'] = {
['go'] = [['golangci-lint', 'gobuild', 'golint']],
['rust'] = [['cargo', 'rls']],
['typescript'] = [['tslint', 'tsserver', 'typecheck']]
}
vim.g['ale_completion_enabled'] = 1
vim.g['ale_echo_msg_error_str'] = 'E'
vim.g['ale_echo_msg_warning_str'] = 'W'
vim.g['ale_echo_msg_format'] = '[%linter%] [%severity%] %code = %%s '

-- alt k & j to jump through errors
utils.map{'n', '<M-k>', '<Plug>(ale_previous_wrap)'}
utils.map{'n', '<M-j>', '<Plug>(ale_next_wrap)'}

-- Disable for minified code and enable whitespace trimming
vim.g['ale_pattern_options'] = {
['.min.js$'] = {['ale_linters'] = [[]], ['ale_fixers'] = [[]]},
['.min.css$'] = {['ale_linters'] = [[]], ['ale_fixers'] = [[]]},
['*'] = {['ale_fixers'] = [['trim_whitespace', 'remove_trailing_lines']]}
}

vim.g['ale_set_loclist'] = 0
vim.g['ale_set_quickfix'] = 1

-- Define :ALEToggleFixer command to Disable autofix globally
vim.cmd [[
command! ALEToggleFixer execute "let g:ale_fix_on_save = get(g:, 'ale_fix_on_save', 0) ? 0 : 1"
]]

+ 0
- 62
config/nvim/plugin/ale.vim Zobrazit soubor

@@ -1,62 +0,0 @@
let g:ale_fixers = {
\ '*': ['remove_trailing_lines', 'trim_whitespace'],
\ 'javascript': ['prettier', 'eslint'],
\ 'typescript': ['prettier', 'tslint', 'eslint'],
\ 'typescriptreact': ['prettier', 'tslint', 'eslint'],
\ 'html': ['eslint'],
\ 'json': ['prettier', 'fixjson', 'jq'],
\ 'scss': ['prettier', 'stylelint'],
\ 'css': ['prettier', 'stylelint'],
\ 'less': ['prettier', 'stylelint'],
\ 'stylus': ['stylelint',],
\ 'c': ['clang-format'],
\ 'cpp': ['clang-format'],
\ 'rust': ['rustfmt'],
\ 'python': ['yapf', 'isort', 'black'],
\ 'zsh': ['shfmt'],
\ 'sh': ['shfmt'],
\ 'go': ['gofmt', 'goimports'],
\ 'markdown': ['prettier'],
\ 'vimwiki': ['prettier'],
\ 'vue': ['prettier'],
\ 'yaml': ['prettier'],
\ 'ansible': ['prettier'],
\ 'puppet': ['puppetlint'],
\ 'java': ['google_java_format']}
let g:ale_fix_on_save = 1
let g:ale_go_gofmt_options = '-s'
let g:ale_go_gometalinter_options = '--fast'
let g:ale_go_golangci_lint_options = '--fast'
let g:ale_go_golangci_lint_package = 1
let g:ale_rust_cargo_use_clippy = 1
let g:ale_rust_analyzer_config = {
\'rust-analyzer': {
\ 'assist': {
\ 'importMergeBehavior': 'last',
\ 'importPrefix': 'by_self',
\ },
\ 'cargo.loadOutDirsFromCheck': v:true,
\ 'procMacro.enable': v:true }}
let g:ale_linters = {
\ 'go': ['golangci-lint', 'gobuild', 'golint'],
\ 'rust': ['cargo', 'rls'],
\ 'typescript': ['tslint', 'tsserver', 'typecheck']}
let g:ale_completion_enabled = 1
let g:ale_echo_msg_error_str = 'E'
let g:ale_echo_msg_warning_str = 'W'
let g:ale_echo_msg_format = '[%linter%] [%severity%] %code: %%s '

" alt k & j to jump through errors
nmap <silent> <M-k> <Plug>(ale_previous_wrap)
nmap <silent> <M-j> <Plug>(ale_next_wrap)

" Disable for minified code and enable whitespace trimming
let g:ale_pattern_options = {
\ '\.min\.js$': {'ale_linters': [], 'ale_fixers': []},
\ '\.min\.css$': {'ale_linters': [], 'ale_fixers': []},
\ '*': {'ale_fixers': ['trim_whitespace', 'remove_trailing_lines']}}

let g:ale_set_loclist = 0
let g:ale_set_quickfix = 1
command! ALEToggleFixer execute "let g:ale_fix_on_save = get(g:, 'ale_fix_on_save', 0) ? 0 : 1"
"let g:ale_open_list = 1

+ 0
- 2
config/nvim/plugin/findRm.vim Zobrazit soubor

@@ -1,2 +0,0 @@
" Delete Selected word from whole file
:nnoremap <Leader>s :%s/\<<C-r><C-w>\>//g<Left><Left>

+ 4
- 0
config/nvim/plugin/hipster.lua Zobrazit soubor

@@ -0,0 +1,4 @@
-- Define :Hipster command to dump in a paragraph of Hipster ipsum
vim.cmd [[
command! -nargs=0 Hipster :lua require'hipster'.output()
]]

+ 0
- 5
config/nvim/plugin/hipster.vim Zobrazit soubor

@@ -1,5 +0,0 @@
if exists('g:loaded_hipster') | finish | endif

" Define :Hipster command to dump in a paragraph of Hipster ipsum
command! -nargs=0 Hipster :lua require'hipster'.output()
let g:loaded_hipster = 1

+ 5
- 0
config/nvim/plugin/indent.lua Zobrazit soubor

@@ -0,0 +1,5 @@
-- See line indentation
vim.g.indentLine_color_term = 239
vim.g.indentLine_color_gui = "#A4E57E"
vim.g.indentLine_color_tty_light = 7 -- (default: 4)
vim.g.indentLine_color_dark = 1 -- (default: 2)

+ 0
- 5
config/nvim/plugin/indent.vim Zobrazit soubor

@@ -1,5 +0,0 @@
" See line indentation
let g:indentLine_color_term = 239
let g:indentLine_color_gui = '#A4E57E'
let g:indentLine_color_tty_light = 7 " (default: 4)
let g:indentLine_color_dark = 1 " (default: 2)

config/nvim/lua/lsp.lua → config/nvim/plugin/lsp.lua Zobrazit soubor

@@ -1,3 +1,4 @@
local map = require('utils').map
local nvim_lsp_config = require('lspconfig')
local nvim_lsp_install = require('lspinstall')
local cmp = require('cmp')
@@ -21,29 +22,28 @@ local on_attach = function(client, bufnr)
buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc')

-- Mappings.
local opts = { noremap=true, silent=true }
buf_set_keymap('n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<CR>', opts)
buf_set_keymap('n', 'gd', '<cmd>lua vim.lsp.buf.definition()<CR>', opts)
buf_set_keymap('n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>', opts)
buf_set_keymap('n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<CR>', opts)
buf_set_keymap('n', '<C-k>', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts)
buf_set_keymap('n', '<space>wa', '<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>', opts)
buf_set_keymap('n', '<space>wr', '<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>', opts)
buf_set_keymap('n', '<space>wl', '<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>', opts)
buf_set_keymap('n', '<space>D', '<cmd>lua vim.lsp.buf.type_definition()<CR>', opts)
buf_set_keymap('n', '<space>rn', '<cmd>lua vim.lsp.buf.rename()<CR>', opts)
buf_set_keymap('n', '<space>ca', '<cmd>lua vim.lsp.buf.code_action()<CR>', opts)
buf_set_keymap('n', 'gr', '<cmd>lua vim.lsp.buf.references()<CR>', opts)
buf_set_keymap('n', '<space>e', '<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>', opts)
buf_set_keymap('n', '[d', '<cmd>lua vim.lsp.diagnostic.goto_prev()<CR>', opts)
buf_set_keymap('n', ']d', '<cmd>lua vim.lsp.diagnostic.goto_next()<CR>', opts)
buf_set_keymap('n', '<space>q', '<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>', opts)
map{'n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<CR>'}
map{'n', 'gd', '<cmd>lua vim.lsp.buf.definition()<CR>'}
map{'n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>'}
map{'n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<CR>'}
map{'n', '<C-k>', '<cmd>lua vim.lsp.buf.signature_help()<CR>'}
map{'n', '<space>wa', '<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>'}
map{'n', '<space>wr', '<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>'}
map{'n', '<space>wl', '<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>'}
map{'n', '<space>D', '<cmd>lua vim.lsp.buf.type_definition()<CR>'}
map{'n', '<space>rn', '<cmd>lua vim.lsp.buf.rename()<CR>'}
map{'n', '<space>ca', '<cmd>lua vim.lsp.buf.code_action()<CR>'}
map{'n', 'gr', '<cmd>lua vim.lsp.buf.references()<CR>'}
map{'n', '<space>e', '<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>'}
map{'n', '[d', '<cmd>lua vim.lsp.diagnostic.goto_prev()<CR>'}
map{'n', ']d', '<cmd>lua vim.lsp.diagnostic.goto_next()<CR>'}
map{'n', '<space>q', '<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>'}

-- Set some keybinds conditional on server capabilities
if client.resolved_capabilities.document_formatting then
buf_set_keymap("n", "<space>f", "<cmd>lua vim.lsp.buf.formatting()<CR>", opts)
map{"n", "<space>f", "<cmd>lua vim.lsp.buf.formatting()<CR>"}
elseif client.resolved_capabilities.document_range_formatting then
buf_set_keymap("n", "<space>f", "<cmd>lua vim.lsp.buf.range_formatting()<CR>", opts)
map{"n", "<space>f", "<cmd>lua vim.lsp.buf.range_formatting()<CR>"}
end

-- Set autocommands conditional on server_capabilities

+ 1
- 1
config/nvim/plugin/nerdtree.vim Zobrazit soubor

@@ -16,7 +16,7 @@ augroup END
map <C-n> :NERDTreeToggle<CR>
let g:NERDTreeDirArrowExpandable = '▸'
let g:NERDTreeDirArrowCollapsible = '▾'
let g:NERDTreeIndicatorMapCustom = {
let g:NERDTreeGitStatusIndicatorMapCustom = {
\ 'Modified' : '✹',
\ 'Staged' : '✚',
\ 'Untracked' : '✭',


+ 44
- 0
config/nvim/plugin/startify.lua Zobrazit soubor

@@ -0,0 +1,44 @@
local map = require("utils").map
local g = vim.g
local fn = vim.fn

g.startify_files_number = 10
g.startify_change_to_dir = 0
local ascii = {
[[]],
[[ /___/\]],
[[ _\ \/_/\]],
[[ __\ \/_/\ .--.--.|__|.--.--.--.]],
[[ \ __ __ \ \ | | || || |]],
[[ __\ \_\ \_\ \ \ __ \___/ |__||__|__|__|]],
[[ /_/\\ __ __ \ \_/_/\]],
[[ \_\/_\__\/\__\/\__\/_\_\/]],
[[ \_\/_/\ /_\_\/]],
[[ \_\/ \_\/]]
}

-- g.startify_custom_header = 'startify#center(g:ascii)'
g.startify_custom_header = ascii
g.startify_relative_path = 1
g.startify_use_env = 1

g.startify_lists = {
{type = "dir", header = {"Files: " .. fn.getcwd()}},
{type = "sessions", header = {"Sessions"}},
{type = "bookmarks", header = {"Bookmarks"}},
{type = "commands", header = {"Commands"}}
}

g.startify_commands = {
{up = {"Update Plugins", ":PlugUpdate"}},
{ug = {"Upgrade Plugin Manager", ":PlugUpgrade"}},
{ts = {"Update Treesitter", "TSUpdate"}},
{ch = {"Check Health", "checkhealth"}}
}

g.startify_bookmarks = {
{c = "~/.config/nvim/init.vim"},
{g = "~/.gitconfig"},
{z = "~/.zshrc"}
}
map{"n", "<leader>st", ":Startify<cr>"}

Načítá se…
Zrušit
Uložit