This Docker image adds Go tools and the following vim plugins to the official Go image:
when use screen, don't forget to use 256 colors. By default, screen use an 8-color terminal emulator. To enable 256 colors, you need to edit ~/.screenrc
attrcolor b ".I"
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
defbce on
for more information pls visit use 256 colors in screen
LESS.Run this image from within your go workspace. You can than edit your project using vim, and usual go commands: go build, go run, etc.
cd your/go/workspace
docker run --rm -tiv `pwd`:/go any35/golang-web-vim
#or you can specify port mapping
docker run --rm -p 9000:9000 -p 35729:35729 -tiv `pwd`:/go any35/golang-web-vim
add --privileged flag debugger is needed
TBD.
shift+tab jump to next autocomplete chart


Modify .vimrc
syntax enable
set background=dark
colorscheme solarized
or
syntax enable
set background=light
colorscheme solarized
=====
<cursor>Lorem ipsum dolor sit amet.
Type <Leader><Leader>w(<Plug>(easymotion-w)) to trigger the word motion w.
When the motion is triggered, the text is updated (no braces are actually added,
the text is highlighted in red by default):
<cursor>Lorem {a}psum {b}olor {c}it {d}met.
Press c to jump to the beginning of the word "sit":
Lorem ipsum dolor <cursor>sit amet.
Similarly, if you're looking for an "o", you can use the f motion.
Type <Leader><Leader>fo, and all "o" characters are highlighted:
<cursor>L{a}rem ipsum d{b}l{c}r sit amet.
Press b to jump to the second "o":
Lorem ipsum d<cursor>olor sit amet.
Jeffrey Way of Nettuts+ has also written a tutorial about EasyMotion.
For example, in C, typing for<tab> could be expanded to
for (i = 0; i < count; i++) {
/* code */
}
with successive presses of tab jumping around the snippet.
in go, type fun<tab> could be expanded to
func funcName() error {
}
for more snippets in golang pls see go.snippets and more snippets
this plugin auto detect CJK and Unicode file encodings.
:FencAutoDectect or :FencView
and you can select the right encodings.
Before:
one = 1
two = 2
three = 3
four = 4
Running :Tab /= produces
one = 1
two = 2
three = 3
four = 4
There are a couple of different ways that colon assignments could be aligned. If we start with an example that is not aligned:
var video = {
metadata: {
title: "Aligning assignments"
h264Src: "/media/alignment.mov",
oggSrc: "/media/alignment.ogv"
posterSrc: "/media/alignment.png"
duration: 320,
}
}
Select the inner block by positioning your cursor inside it and running vi} (enable Visual mode, and select inner Brace). Then you could run :Tab/: which would produce this result:var
video = {
metadata: {
title : "Aligning assignments"
h264Src : "/media/alignment.mov",
oggSrc : "/media/alignment.ogv"
posterSrc : "/media/alignment.png"
duration : 320,
}
}
If you don’t like stacking the colons in a column, you could use the \zs atom to exclude the : character from the search match. Running :Tab /:\zs produces this result:
var video = {
metadata: {
title: "Aligning assignments"
h264Src: "/media/alignment.mov",
oggSrc: "/media/alignment.ogv"
posterSrc: "/media/alignment.png"
duration: 320,
}
}
Be aware that if you work in a team, there may be a house style that you should follow.
Here is a scenario outline for cucumber steps, including a pipe-delimited table of examples:
Scenario Outline: eating
Given there are <start> cucumbers
When I eat <eat> cucumbers
Then I should have <left> cucumbers
Examples:
|start|eat|left|
|12|5|7|
|20|5|15|
With the cursor positioned anywhere in the table, running :Tab/| produces:
Scenario Outline: eating
Given there are <start> cucumbers
When I eat <eat> cucumbers
Then I should have <left> cucumbers
Examples:
| start | eat | left |
| 12 | 5 | 7 |
| 20 | 5 | 15 |
see tabular for more information. See doc/Tabular.txt for detailed documentation.
F7 nerdTreeTabs toggle
i### buf explorer
F4 open BufExplorer
<Leader>be BufExplorer
after open buf explorer windows,
j or k to choose file, r re-order files, d or D close fiel.
F6 or :CtrlP or :CtrlP [starting-directory] to invoke CtrlP in find file mode.:CtrlPBuffer or :CtrlPMRU to invoke CtrlP in find buffer or find MRU file mode.:CtrlPMixed to search in Files, Buffers and MRU files at the same time.Check :help ctrlp-commands and :help ctrlp-extensions for other commands.
<F6> to purge the cache for the current directory to get new files, remove deleted files and apply new ignore options.<c-f> and <c-b> to cycle between modes.<c-d> to switch to filename only search instead of full path.<c-r> to switch to regexp mode.<c-j>, <c-k> or the arrow keys to navigate the result list.<c-t> or <c-v>, <c-x> to open the selected entry in a new tab or in a new split.<c-n>, <c-p> to select the next/previous string in the prompt's history.<c-y> to create a new file and its parent directories.<c-z> to mark/unmark multiple files and <c-o> to open them.Run :help ctrlp-mappings or submit ? in CtrlP for more mapping help.
.. to go up the directory tree by one or multiple levels.: followed by a command to execute it on the opening file(s)::25 to jump to line 25.:diffthis when opening multiple files to run :diffthis on the first 4 files.F8 TagbarToggle
F5 UndotreeToggle
This plugin defines two new text objects. These are very similar - they differ only in whether they include the line below the block or not.
Key Mapping Description ~
===
<count>ai (A)n (I)ndentation level and line above.
<count>ii (I)nner (I)ndentation level (no line above).
<count>aI (A)n (I)ndentation level and lines above/below.
<count>iI (I)nner (I)ndentation level (no lines above/below).
Note that the iI mapping is mostly included simply for completeness, it is effectively a synonym for ii.
Just like regular text objects, these mappings can be used either with operators expecting a motion, such as 'd' or 'c', as well as in visual mode. In visual mode the mapping can be repeated, which has the effect of iteratively increasing the scope of indentation block selected. Specifying a count can be used to achieve the same effect.
The difference between |ai| and |aI| is that |ai| includes the line immediately above the indentation block, whereas aI includes not only that, but also the line below. Which of these is most useful largely depends on the structure of the language being edited.
For example, when editing the Python code, |ai| is generally more useful, as the line above the indentation block is usually related to it. For example, in the following code ( * is used to indicate the cursor position):
if foo > 3:
log("foo is big") *
foo = 3
do_something_else()
the if clause is logically related to the code block, whereas the function call below is not. It is unlikely we would want to select the line below when we are interested in the if block.
However, in other languages, such as Vim scripts, control structures are usually terminated with something like 'endif'. Therefore, in this example:
if foo > 3
echo "foo is big" *
let foo = 3
endif
call do_something_else()
we would more likely want to include the endif when we select the if structure. for example( * is used to indicate the cursor position)
aaaaaaaaaaaaa
bbbbbbbbb*
ccccccccc
ddddddddd
eeeeeeeeeeeee
in normal model, when we execute
>ai it become aaaaaaaaaaaaa
bbbbbbbbb*
ccccccccc
ddddddddd
eeeeeeeeeeeee
>ii it cecomeaaaaaaaaaaaaa
bbbbbbbbb*
ccccccccc
ddddddddd
eeeeeeeeeeeee
>aI it cecome aaaaaaaaaaaaa
bbbbbbbbb*
ccccccccc
ddddddddd
eeeeeeeeeeeee
>iI it cecomeaaaaaaaaaaaaa
bbbbbbbbb*
ccccccccc
ddddddddd
eeeeeeeeeeeee
<leader>ig to switch indent guides display
=G auto indent
NOTE: jquery syntax is not worked yet!
]]: go to next header. <Plug>Markdown_MoveToNextHeader[[: go to previous header. Contrast with ]c. <Plug>Markdown_MoveToPreviousHeader][: go to next sibling header if any. <Plug>Markdown_MoveToNextSiblingHeader[]: go to previous sibling header if any. <Plug>Markdown_MoveToPreviousSiblingHeader]c: go to Current header. <Plug>Markdown_MoveToCurHeader]u: go to parent header (Up). <Plug>Markdown_MoveToParentHeader
details documentThe following key mappings are provided by default (there is also a menu provided that contains menu items corresponding to all the below mappings):
Most of the following mappings are for normal/visual mode only. The |NERDComInsertComment| mapping is for insert mode only.
[count]\<leader\>cc |NERDComComment|
Comment out the current line or text selected in visual mode.
[count]\<leader\>cn |NERDComNestedComment|
Same as <leader>cc but forces nesting.
[count]\<leader\>c<space> |NERDComToggleComment|
Toggles the comment state of the selected line(s). If the topmost selected
line is commented, all selected lines are uncommented and vice versa.
[count]\<leader\>cm |NERDComMinimalComment|
Comments the given lines using only one set of multipart delimiters.
[count]\<leader\>ci |NERDComInvertComment|
Toggles the comment state of the selected line(s) individually.
[count]\<leader\>cs |NERDComSexyComment|
Comments out the selected lines ``sexily''
[count]\<leader\>cy |NERDComYankComment|
Same as <leader>cc except that the commented line(s) are yanked first.
\<leader\>c$ |NERDComEOLComment|
Comments the current line from the cursor to the end of line.
\<leader\>cA |NERDComAppendComment|
Adds comment delimiters to the end of line and goes into insert mode between
them.
|NERDComInsertComment|
Adds comment delimiters at the current cursor position and inserts between.
Disabled by default.
\<leader\>ca |NERDComAltDelim|
Switches to the alternative set of delimiters.
[count]\<leader\>cl
[count]\<leader\>cb |NERDComAlignedComment|
Same as |NERDComComment| except that the delimiters are aligned down the
left side (<leader>cl) or both sides (<leader>cb).
[count]\<leader\>cu |NERDComUncommentLine|
Uncomments the selected line(s).
F7 NERDTreeTabsToggle
Press + to expand the visual selection and _ to shrink it.

It's great for quick refactoring

p with fp<C-n>c to change<Esc> to quit back to regular VimAdd a cursor to each line of your visual selection

VG<C-n> to add a cursor at the beginning of every line and move to normal modeI to insert at the beginning of the line", move to end of line with <C-e>, type another " followed by ,<C-j>(this is a custom mapping of mine in Insert mode)<BS>, now all the words are on the same lineDo it backwards too! This is not just a replay of the above gif :)

dt" to delete everything until the first quote$ to go to end of liner, to replace the ] with ,^, press f, to find the first commav to select , in visual mode, and mash on <C-n> until the last occurrencec followed by <CR> to break the line into multiple lines<C-k> (again my custom mapping)C-g<BS> (custom mapping to move cursor in insert mode)C-e<BS>Add multiple cursors using regexes

jV to visually select the second lineGk to select all but the last line: followed by the MultipleCursorsFind commando to toggle the cursor for each visual selectionp to paste the content of the + register (I have clipboard=unnamedplus in my vimrc) to each virtual cursor
see more detailsOut of the box, all you need to know is a single key Ctrl-n. Pressing the key in Normal mode highlights the current word under the cursor in Visual mode and places a virtual cursor at the end of it. Pressing it again finds the next occurrence and places another virtual cursor at the end of the visual selection. If you select multiple lines in Visual mode, pressing the key puts a virtual cursor at every line and leaves you in Normal mode.
After you've marked all your locations with Ctrl-n, you can change the visual selection with normal Vim motion commands in Visual mode. You could go to Normal mode by pressing v and wield your motion commands there. Single key command to switch to Insert mode such as c or s from Visual mode or i, a, I, A in Normal mode should work without any issues.
At any time, you can press <Esc> to exit back to regular Vim.
Two additional keys are also mapped:
Ctrl-p in Visual mode will remove the current virtual cursor and go back to the previous virtual cursor location. This is useful if you are trigger happy with Ctrl-n and accidentally went too far.Ctrl-x in Visual mode will remove the current virtual cursor and skip to the next virtual cursor location. This is useful if you don't want the current selection to be a candidate to operate on later.You can also add multiple cursors using a regular expression. The command MultipleCursorsFind accepts a range and a pattern, and it will create a virtual cursor at the end of every match within the range. If no range is passed in, then it defaults to the entire buffer.
NOTE: If at any time you have lingering cursors on screen, you can press Ctrl-n in Normal mode and it will remove all prior cursors before starting a new one.
many command to git.
vim:Gstatus show the confilc file listdv, this will open merge windowsgit add command.more information, see the document
TDB.
If you've ever tried using the . command after a plugin map, you were likely disappointed to discover it only repeated the last native command inside that map, rather than the map as a whole. That disappointment ends today. Repeat.vim remaps . in a way that plugins can tap into it.
The following plugins support repeat.vim:
It's easiest to explain with examples. Press cs"' inside
"Hello world!"
to change it to
'Hello world!'
Now press cs'<q> to change it to
<q>Hello world!</q>
To go full circle, press cst" to get
"Hello world!"
To remove the delimiters entirely, press ds".
Hello world!
Now with the cursor on "Hello", press ysiw] (iw is a text object).
[Hello] world!
Let's make that braces and add some space (use } instead of { for no
space): cs]{
{ Hello } world!
Now wrap the entire line in parentheses with yssb or yss).
({ Hello } world!)
Revert to the original text: ds{ds)
Hello world!
Emphasize hello: ysiw<em>
<em>Hello</em> world!
Finally, let's try out visual mode. Press a capital V (for linewise
visual mode) followed by S<p class="important">.
<p class="important">
<em>Hello</em> world!
</p>
This plugin is very powerful for HTML and XML editing, a niche which currently seems underfilled in Vim land. (As opposed to HTML/XML inserting, for which many plugins are available). Adding, changing, and removing pairs of tags simultaneously is a breeze.
The . command will work with ds, cs, and yss
Keymappings:
<Leader>vv - Grep for the word under the cursor, match all occurences,
like |gstar|<Leader>vV - Grep for the word under the cursor, match whole word, like
|star|<Leader>va - Like vv, but add to existing list
<Leader>vA - Like vV, but add to existing list
<Leader>vr - Perform a global search search on the word under the cursor
and prompt for a pattern with which to replace it.
<Leader>vo - Select the files to search in and set grep optionsCommands:
+ :Grep [arg]
Search for the specified arg, like vv. When an ! is added,
search like vV
+ `:GrepAdd [arg]`
Search for the specified arg, add to existing file list, as in
<Leader>va. When an ! is added, search like <Leader>vA
+ `:Replace [target] [replacement]`
Perform a global search and replace. The function searches
the same set of files a grep for the desired target and opens a dialog to
confirm replacement.
+ `:ReplaceUndo`
Undoes the last :Replace operation. Does not stack successive
searches; only the last replace may be undone. This function may not
work well when edits are made between a call to Replace and a call to
ReplaceUndo.
+ `:GrepOptions [arg]`
Open a window to set grep options.
Examples:
yyContent type
Image
Digest
sha256:30586ce4d…
Size
457.8 MB
Last updated
almost 11 years ago
docker pull any35/golang-web-vim