https://github.com/dogukanayd/.vim
https://github.com/dogukanayd/.vim
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/dogukanayd/.vim
- Owner: dogukanayd
- Created: 2021-12-27T10:12:18.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-12-30T10:04:26.000Z (over 3 years ago)
- Last Synced: 2025-01-27T21:14:32.532Z (5 months ago)
- Language: Vim script
- Size: 33.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Vim Configuration File
## Installation
```shell
git clone [email protected]:dogukanayd/.vim.git
vim .vimrc
```.vimrc file should be like;
```text
so ~/.vim/vimrc.vim
```Open vim and;
```sh
:GoInstallBinaries
```## Mappings
### Go
|key strokes|command|details|
|----------|:----------:|----------:|
|leader rn|coc-rename|rename the selected|
|leader gr|coc-references|go to the reference |
|leader gf|:GoFmt|fix the styling of the Go files|
|leader gd|:GoDef|go to the def with vim-go|
|leader gat|:GoAddTags|add json tags to the struct|
|leader gl|:GoMetaLinter|run all of the linters|
|leader gt|:GoAlternate|go the the test file|
|cmd+ctrl+r|:GoTestFunc|run the test function|### Vim
| key strokes | command | details |
|----------|:-------------:|------:|
|leader gi|coc-implementation |go to the implementation of function|
|leader space|:nohlsearch|highlight removal|
|leader vdoc| |open the readme file|
|ctrl+f|:echo expand("%:p")|print the full path|
|cmd+1|:NERDTreeToggle|toggle the NERDTree|
|ctrl+6| |go to the latest location|
|Ag 'search keyword'| | search a keyword|
|bufdo bd!| |close every buffer|
|ctags -R|ctags -R|create ctags for the folder|
|leader gcc| |comment the selected lines|
### Php
| key strokes | command | details |
|----------|:-------------:|------:|
|leader lm|php artisan make| |
|leader lfc| | open the controller folder|
|leader lfs| | open the services folder|
|leader n|:call IPhpInsertUse|import classes|
|leader pf|:call PhpCsFixerFixFile()|fix the file by psr2|## How to?
### How to find and replace in all files?
1. :Gsearch
2. select all of the lines you want to change
3. : s/{keyword}/{keyword}
4. :Greplace
5. press `a` to accept all of the replacements
6. :wa to save all of the changes### How to change surround?
1. cs ' " -> all of the single quotes on the selected line will be double quotes
2. ds ' -> delete the surrounding single quotes
3. Capital S -> surround the selected text with desired text### How to sort with Vim?
Select the text block that you want to sort and type :sort## Brew packages
```sh
brew install the_silver_searcher
brew install ctags
brew install php-cs-fixer
```## COC packages
```sh
:CocInstall coc-markdown-preview-enhanced
:CocInstall coc-go
:CocInstall coc-webview
```## Notes