hey in vimscript to concate/join string which is the most efficient way?
Jump to turn (9)
- 1hey in vimscript to concate/join string which is the most efficient way?
- 2which is faster and process less/efficient? compare dot operator with join() and
- 3is there any thing efficient than dot operator in vimscript?
- 4improve this code make it more faster and readable if possible function CreateHi
- 5which is better? function CreateHighlightGroup(groupfg, groupbg, newgroupname, g
- 6is there any better aproach to achieve ths?
- 7this can beat 1st approach in performance?
- 8this is the first version i code: function HighlightGroupCreator(existingGroup,n
- 9instead of single quote u used ‘’ why? this is not right
- User
hey in vimscript to concate/join string which is the most efficient way?
- Assistant
In Vimscript, the most efficient way to concatenate or join strings is by using the
.operator. Here's an example:vimlet str1 = "Hello" let str2 = "World" let result = str1 . " " . str2In this example,
str1 . " " . str2will concatenatestr1, a space, andstr2, resulting in the string "Hello World".Using the
.operator allows you to concatenate as many strings as desired efficiently. However, if you need to concatenate a large number of strings, it's generally more efficient to use the function. Here's an example: