-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from PrashanthaTP/version-1.1.0-rc-1
Version 1.1.0 rc 1
- Loading branch information
Showing
12 changed files
with
474 additions
and
141 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# My Dotfiles | ||
|
||
--- | ||
|
||
Configuration files for windows applications | ||
|
||
- Nvim |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# My Dotfiles  | ||
|
||
--- | ||
|
||
My setup for various applications. | ||
|
||
## nvim 🚀 | ||
|
||
- with language support for cpp and python | ||
- for coc | ||
- `:CocCommand clangd.install ` (make sure clangd path is added to `:CocConfig`) | ||
- `:CocInstall coc-clangd coc-css coc-emmet coc-eslint coc-html coc-java coc-jedi coc-json coc-lua coc-pairs coc-prettier coc-pyright coc-snippets coc-tsserver coc-vimlsp ` |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"coc.preferences.formatOnSaveFiletypes": [ | ||
"css", | ||
"markdown", | ||
"javascript", | ||
"graphql", | ||
"html", | ||
"yaml", | ||
"json", | ||
"python" | ||
], | ||
|
||
// python config | ||
"python.linting.enabled": true, | ||
"python.linting.pylintEnabled": true, | ||
|
||
"diagnostic.checkCurrentLine": true, | ||
//"diagnostic.enableMessage": "jump", | ||
"jedi.hover.enable": true, | ||
"hover.target": "float", | ||
"clangd.path": "C:\\Users\\Prashanth T P\\AppData\\Local\\coc\\extensions\\coc-clangd-data\\install\\12.0.1\\clangd_12.0.1\\bin\\clangd.exe", | ||
//html | ||
"html.autoClosingTags": true, | ||
"html.filetypes": ["html", "javascript", "handlebars", "htmldjango", "blade"], | ||
"html.enable": true, | ||
"snippets.extends": { | ||
|
||
"cpp": ["c"], | ||
"javascript":["html"], | ||
"javascriptreact": ["javascript"], | ||
"typescript": ["javascript"] | ||
} | ||
|
||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
" MODES ----- {{{ | ||
"use jk in insert mode to switch to normal mode | ||
inoremap jk <ESC> | ||
" }}} | ||
|
||
" yanking ----- {{{ | ||
"to match the behaviour of 'C' and 'D' | ||
nnoremap Y y$ | ||
"highlight the yanked area for an extened period | ||
augroup highlight_yank | ||
autocmd! | ||
au TextYankPost * silent! lua vim.highlight.on_yank{higroup="IncSearch", timeout=300} | ||
augroup END | ||
" }}} | ||
|
||
" searching : the primeagen : top 5 keybindings ----- {{{ | ||
"put the cursor at screen center while going to next search result | ||
nnoremap n nzz | ||
nnoremap N Nzz | ||
" }}} | ||
" | ||
" breakpoints ----- {{{ | ||
"puts the next line at the end of current line : mz = create a mark called z , do J, `z = goto mark z | ||
nnoremap J mzJ`z | ||
"undo breakpoints | ||
inoremap . .<C-g>u | ||
inoremap , ,<C-g>u | ||
inoremap ! !<C-g>u | ||
inoremap ? ?<C-g>u | ||
" }}} | ||
" | ||
" moving lines with ALT key ----- {{{ | ||
"https://vim.fandom.com/wiki/Moving_lines_up_or_down | ||
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 | ||
" }}} | ||
|
||
"htmlhttps://stackoverflow.com/questions/130734/how-can-one-close-html-tags-in-vim-quickly | ||
"inoremap ><Space> ><Esc>F<lyt>o</<C-r>"><Esc>O<Space> | ||
|
||
" better indentation ----- {{{ | ||
vnoremap > >gv | ||
vnoremap < <gv | ||
" }}} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,16 @@ | ||
|
||
let mapleader = "\<Space>" | ||
|
||
" Mappings with leader key | ||
" source vim file | ||
nmap <leader>sv :source $LOCALAPPDATA/nvim/init.vim<CR> | ||
nmap <leader>so :e $LOCALAPPDATA/nvim/init.vim<CR> | ||
" nmap <leader>so :vsplit <bar> :e $LOCALAPPDATA/nvim/init.vim<CR> | ||
nnoremap <leader>n :bnext<CR> | ||
nnoremap <leader>p :bprev<CR> | ||
nnoremap <leader>b :buffers<CR> | ||
nnoremap <leader>w <C-W>w | ||
nnoremap <leader>h <C-W>h | ||
nnoremap <leader>l <C-W>l | ||
nnoremap <leader>j <C-W>j | ||
nnoremap <leader>k <C-W>k | ||
"nmap <leader>ws : | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,16 @@ | ||
let mapleader = "\<Space>" | ||
|
||
source $LOCALAPPDATA/nvim/plugs/plugins.vim | ||
source $LOCALAPPDATA/nvim/plugs/coc.vim | ||
source $LOCALAPPDATA/nvim/plugs/markdown.vim | ||
source $LOCALAPPDATA/nvim/general/general.vim | ||
source $LOCALAPPDATA/nvim/general/leader.vim | ||
source $LOCALAPPDATA/nvim/general/keybindings.vim | ||
source $LOCALAPPDATA/nvim/plugs/plugins.vim | ||
source $LOCALAPPDATA/nvim/languages/languages.vim | ||
"set path+=* | ||
hi Normal ctermbg=none guibg=none | ||
"wrap backspace | ||
set backspace=indent,eol,start | ||
hi Comment gui=italic cterm=italic | ||
hi htmlArg gui=italic cterm=italic | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,18 @@ | ||
" python ----- {{{ | ||
let g:python3_host_prog = "$PYTHON_HOME/Python/python.exe" | ||
" }}} | ||
" cpp ----- {{{ | ||
"autocmd vimEnter *.cpp map <F8> :w <CR> :!clear ; g++ --std=c++17 %; if [ -f a.out ]; then time ./a.out; rm a.out; fi <CR> | ||
"map <F8> :!g++ % -o %:r && \./%:r <CR> | ||
" | ||
augroup languages | ||
autocmd! | ||
autocmd filetype cpp nnoremap <F5> :w <bar> !g++ -std=c++11 -O2 -Wall % -o %:r && %:r.exe <CR> | ||
autocmd filetype javascript,javascript_react UltiSnipsAddFiletypes javascript.javascript_react.html | ||
" autocmd FileType javascript_react UltiSnipsAddFiletypes html | ||
" autocmd FileType javascript,javascriptreact,typescript,typescriptreact | ||
" \ UltiSnipsAddFiletypes javascript.javascriptreact.typescript.typescriptreact | ||
augroup END | ||
" | ||
" }}} | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
" coc ----- {{{ | ||
" Always show the signcolumn, otherwise it would shift the text each time | ||
" diagnostics appear/become resolved. | ||
if has("nvim-0.5.0") || has("patch-8.1.1564") | ||
" Recently vim can merge signcolumn and number column into one | ||
"set signcolumn=number | ||
set signcolumn=yes | ||
else | ||
set signcolumn=yes | ||
endif | ||
|
||
" Use tab for trigger completion with characters ahead and navigate. | ||
" NOTE: Use command ':verbose imap <tab>' to make sure tab is not mapped by | ||
" other plugin before putting this into your config. | ||
inoremap <silent><expr> <TAB> | ||
\ pumvisible() ? "\<C-n>" : | ||
\ <SID>check_back_space() ? "\<TAB>" : | ||
\ coc#refresh() | ||
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>" | ||
function! s:check_back_space() abort | ||
let col = col('.') - 1 | ||
return !col || getline('.')[col - 1] =~# '\s' | ||
endfunction | ||
|
||
" Use <c-space> to trigger completion. | ||
if has('nvim') | ||
inoremap <silent><expr> <c-space> coc#refresh() | ||
else | ||
inoremap <silent><expr> <c-@> coc#refresh() | ||
endif | ||
|
||
" Make <CR> auto-select the first completion item and notify coc.nvim to | ||
" format on enter, <cr> could be remapped by other vim plugin | ||
inoremap <silent><expr> <cr> pumvisible() ? coc#_select_confirm() | ||
\: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>" | ||
"let g:coc_snippet_next = '<tab>' "tab to go to first suggestion | ||
|
||
|
||
" GoTo code navigation. | ||
nmap <silent> gd <Plug>(coc-definition) | ||
nmap <silent> gy <Plug>(coc-type-definition) | ||
nmap <silent> gi <Plug>(coc-implementation) | ||
nmap <silent> gr <Plug>(coc-references) | ||
" Use K to show documentation in preview window. | ||
nnoremap <silent> K :call <SID>show_documentation()<CR> | ||
function! s:show_documentation() | ||
if (index(['vim','help'], &filetype) >= 0) | ||
execute 'h '.expand('<cword>') | ||
elseif (coc#rpc#ready()) | ||
call CocActionAsync('doHover') | ||
else | ||
execute '!' . &keywordprg . " " . expand('<cword>') | ||
endif | ||
endfunction | ||
|
||
" Highlight the symbol and its references when holding the cursor. | ||
autocmd CursorHold * silent call CocActionAsync('highlight') | ||
|
||
" Symbol renaming. | ||
nmap <leader>rn <Plug>(coc-rename) | ||
" Formatting selected code. | ||
xmap <leader>f <Plug>(coc-format-selected) | ||
nmap <leader>f <Plug>(coc-format-selected) | ||
augroup mygroup | ||
autocmd! | ||
" Setup formatexpr specified filetype(s). | ||
autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected') | ||
" Update signature help on jump placeholder. | ||
autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp') | ||
augroup end | ||
|
||
" Applying codeAction to the selected region. | ||
" Example: `<leader>aap` for current paragraph | ||
xmap <leader>a <Plug>(coc-codeaction-selected) | ||
nmap <leader>a <Plug>(coc-codeaction-selected) | ||
" Remap keys for applying codeAction to the current buffer. | ||
nmap <leader>ac <Plug>(coc-codeaction) | ||
" Apply AutoFix to problem on the current line. | ||
nmap <leader>qf <Plug>(coc-fix-current) | ||
" Use CTRL-S for selections ranges. | ||
" Requires 'textDocument/selectionRange' support of language server. | ||
nmap <silent> <C-s> <Plug>(coc-range-select) | ||
xmap <silent> <C-s> <Plug>(coc-range-select) | ||
" Add `:Format` command to format current buffer. | ||
command! -nargs=0 Format :call CocAction('format') | ||
|
||
" Add `:Fold` command to fold current buffer. | ||
command! -nargs=? Fold :call CocAction('fold', <f-args>) | ||
|
||
" Add `:OR` command for organize imports of the current buffer. | ||
command! -nargs=0 OR :call CocAction('runCommand', 'editor.action.organizeImport') | ||
|
||
" Add (Neo)Vim's native statusline support. | ||
" NOTE: Please see `:h coc-status` for integrations with external plugins that | ||
" provide custom statusline: lightline.vim, vim-airline. | ||
set statusline^=%{coc#status()}%{get(b:,'coc_current_function','')} | ||
|
||
"nnoremap <silent> <leader>q :call CocAction('diagnosticInfo') <CR> |
Oops, something went wrong.