Search Results

Search found 28682 results on 1148 pages for 'drop down menu'.

Page 119/1148 | < Previous Page | 115 116 117 118 119 120 121 122 123 124 125 126  | Next Page >

  • How do I make my character slide down high-angled slopes?

    - by keinabel
    I am currently working on my character's movement in Unity3D. I managed to make him move relatively to the mouse cursor. I set a slope limit of 45°, which does not allow the character to walk up the mountains with higher degrees. But he can still jump them up. How do I manage to make him slide down again when he jumped at places with too high slope? Thanks in advance. edit: Code snippet of my basic movement. using UnityEngine; using System.Collections; public class BasicMovement : MonoBehaviour { private float speed; private float jumpSpeed; private float gravity; private float slopeLimit; private Vector3 moveDirection = Vector3.zero; void Start() { PlayerSettings settings = GetComponent<PlayerSettings>(); speed = settings.GetSpeed(); jumpSpeed = settings.GetJumpSpeed(); gravity = settings.GetGravity(); slopeLimit = settings.GetSlopeLimit(); } void Update() { CharacterController controller = GetComponent<CharacterController>(); controller.slopeLimit = slopeLimit; if (controller.isGrounded) { moveDirection = new Vector3(Input.GetAxis("Horizontal"), 0, Input.GetAxis("Vertical")); moveDirection = transform.TransformDirection(moveDirection); moveDirection *= speed; if (Input.GetButton("Jump")) { moveDirection.y = jumpSpeed; } } moveDirection.y -= gravity * Time.deltaTime; controller.Move(moveDirection * Time.deltaTime); } }

    Read the article

  • Why does the player fall down when in between platforms? Tile based platformer

    - by inzombiak
    I've been working on a 2D platformer and have gotten the collision working, except for one tiny problem. My games a tile based platformer and whenever the player is in between two tiles, he falls down. Here is my code, it's fire off using an ENTER_FRAME event. It's only for collision from the bottom for now. var i:int; var j:int; var platform:Platform; var playerX:int = player.x/20; var playerY:int = player.y/20; var xLoopStart:int = (player.x - player.width)/20; var yLoopStart:int = (player.y - player.height)/20; var xLoopEnd:int = (player.x + player.width)/20; var yLoopEnd:int = (player.y + player.height)/20; var vy:Number = player.vy/20; var hitDirection:String; for(i = yLoopStart; i <= yLoopEnd; i++) { for(j = xLoopStart; j <= xLoopStart; j++) { if(platforms[i*36 + j] != null && platforms[i*36 + j] != 0) { platform = platforms[i*36 + j]; if(player.hitTestObject(platform) && i >= playerY) { hitDirection = "bottom"; } } } } This isn't the final version, going to replace hitTest with something more reliable , but this is an interesting problem and I'd like to know whats happening. Is my code just slow? Would firing off the code with a TIMER event fix it? Any information would be great.

    Read the article

  • How to disable the drop down function of combo box on certain conditions?

    - by Angeline Aarthi
    Hi, I have a combo box in my application. I also have a variable called "Status". I want the combo box to be enabled only when the value of the Status variable is 5 or 6. Otherwise, I should not be able to change the value in the combo box. It should have the previous value only.. I had written a click event to disable the combo box. But even though the combo box is disabled, I get the drop down list of the combo box, and If I select some othe value in the drop down,it changes..Only after that it gets disabled.. How to avoid this? I want the drop down function itself to be disabled. This is the code I have written. Someone guide me. <mx:FormItem label="Review Status:" width="100%" horizontalAlign="right"> <mx:HBox> <mx:Label width="30"/> <mx:ComboBox id="reviewStatus" dataProvider="{Status}" width="150" click="onStatusChange(event)"/> </mx:HBox> Action Script part: private function onStatusChange(event:Event):void { var i:int; for(i=0;i<defectDetails.length;i++) { var defStatusId:String=defectDetails.getItemAt(i).DefectStatusId; if(defStatusId=="5"){ reviewStatus.enabled=true; } else if(defStatusId=="6"){ reviewStatus.enabled=true; } else{ reviewStatus.enabled=false; //reviewStatus.selectedItem.label="Review"; reviewStatus.toolTip="Status can be changed only if Defect Status is Verified or Deferred."; //Alert.show("Status can be changed only if defect status is verified or deferred"); } } } If I use Change event also, for the first time the value is changed. Only after that,the combo box is disabled. How to retain the same value and disable the combo box when the status is not 5 or 6?

    Read the article

  • Do I need to recreate statistics if I had to drop them to add a foreign key

    - by Adam J.R. Erickson
    I have a database which had all it's foreign-key relationships dropped at some unknown time in the past (don't ask). I have an old copy of the database which isn't good to restore from, but the schema has the relationships. I'm working from that to create a script to restore the keys. In updating the tables, I've had to drop statistics from several tables. Do I need to manually recreate those, or can I just run the statistics update procedure when all the tables are updated?

    Read the article

  • Is there an alternative to Windows-Down to minimize?

    - by RoboShop
    I remember with Windows XP, minimize used to be like alt m - n or something. In Windows 7, it is Windows - Down. The problem with that though is that you have to use both hands (the Window button is too far away from the directional buttons), which is kind of annoying because generally, one of my hands is on the mouse. Is there any other keyboard to minimize a window besides Windows - Down in Windows 7?

    Read the article

  • Color drop down in Excel cell (with no text)? e.g. bgcolor = Red-Green-Amber-unknown

    - by adolf garlic
    I have an Excel sheet that I'm using to keep track of the status of certain things. I want to have a column which consists of cells containing a repeated drop down that allows you to select (as background) red amber green unknown I don't want any text in this cell, I just want a coloured block. Is this possible? I've tried playing around with data-validation-list (based on range containing all of said colours but to no avail)

    Read the article

  • How to flip video feed that's presented upside down?

    - by Zuul
    Skype an other applications running under windows 7 Ultimate are presenting the video captured from the laptop built-in webcam upside down. I've tried many solution that I was able to find regarding issues like this, but to no avail. Some of the most relevant are discussed here: From Skype Support Network, the thread why is my video image of myself upside-down??? From ASUSTek Forums, the thread Built-in camera upside down Both present several potential solutions to this issue, but I've been unable to fix it for the laptop ASUS U6S. What I've already tried: Changing Drivers The driver that works must be the one from Windows, all others available from ASUS drivers either don't install or install but the webcam doesn't provide any video feed. This disallows all options that concern using an older driver or editing the .inf file as to manually adjust the settings. ASUS does not provide drivers for Windows 7, so I've used drivers from Windows Vista 32 Bit. Using the application manycam This application actually solves the issue (temporarily), but creates new ones: If I use the application to flip the video feed, Skype video call cease to work. This application doesn't save the settings, at least I wasn't able to find any way to save the settings I've used to flip the video feed. A computer restart brings all back to how it was, video feed upside down and if the application is still installed, Skype continues to fail on video calls. Regedit I've searched thru Windows Registry Editor as to find any reference to the webcam settings, hopping to find a key with the Flip parameter, since it's up to the driver to flip the image (by what I could ascertain from this problem). Couldn't find any reference to such settings, either they actually don't exist within the Windows Registry or they use some weird name that I could think off. System Configuration I was able to access the webcam system settings from the Windows Device Manager, but the tab that actually has the Image Rotation setting is always disabled. The same goes for the settings available from the Skype webcam options (that essentially is presenting the same settings as Windows Device Manager, just within a custom Skype pop-up). Question: How can I flip the video feed from the laptop's built-in webcam, as to properly see and broadcast the video?

    Read the article

  • Slow down individual connections passing through a Linux router?

    - by davr
    We have a Linux server acting as a router/firewall for our office. Occasionally someone will upload a large file that takes up all our bandwidth. I don't want to implement any complex rules or traffic shaping, but I'm wondering if there is a way to slow down a single connection on the spot? I found tcpnice, but it doesn't slow down the transfers in my testing.

    Read the article

  • Cisco - Zone Policy Actions (pass, inspect, drop, log) - What is the difference?

    - by Jonathan Rioux
    Have these commands for instance: policy-map type inspect IN-OUT_PlcyMAP class type inspect IN-OUT_ClassMAP inspect <------ policy-map type inspect IN-OUT_PlcyMap class type inspect IN-OUT_ClassMAP pass <------ zone security INSIDE zone security OUTSIDE zone-pair security IN->OUT source INSIDE destination OUTSIDE service-policy type inspect IN-OUT_PlcyMAP What is the difference between "inspect", "pass", "drop", "log", and "reset ? I could not found any information on this on Google.

    Read the article

  • Computer shows error message when being shut down. What does it mean?

    - by Xavierjazz
    My OS is Windows XP SP3. This message sometimes comes up when I am shutting the computer down: The instruction at 0x00000000 referenced memory at 0x00000000. The memory could not be read. The computer still shuts down. I cannot find a reference to this happening on shutdown, it only seems to be connected to programs that I don't have. I have the whole Word 2003 package. Any direction appreciated.

    Read the article

  • Why does my computer restart immediately after I shut it down?

    - by Youri
    After I shut down my computer it automatically starts up again. I've tried re-installing Windows 7 64-bit, resetting my BIOS, installing the newest drivers and also changing the boot and recovery settings. The motherboard I have is a MSI P67A-GD65 (B3), and the processor is a Intel Core i7-2600K. How can I shut down my computer and have it stay off? Also, what is causing it to immediately boot back up?

    Read the article

  • How can I populate other columns after user selects choice in drop-down?

    - by user360332
    I have a spreadsheet that is essentially going to be a form for our user to print out and hand to the necessary individuals. What the user needs to be able to do is select a customer number from a drop down, choose his number, have 2 other (so a total of 3) columns populate. I need the rest of the worksheet to stay in place. I have tried just about everything. How can I solve this with the simplest solution possible?

    Read the article

  • Play Your Position Until the Play Breaks Down&hellip;then Do Whatever it Takes.

    - by AjarnMark
    If I didn’t know better, I would think that K. Brian Kelley (blog | twitter) has been listening in on conversations with my boss. In his recent blog post Successful Teams: Knowing When to Step Out of Your Role, Brian describes quite clearly a philosophy that my boss has been trying to get across to everyone in the department.  We have been using sports analogies, like how important it is to play your position, until the play breaks down (such as a fumble) and then do whatever it takes it to cover each other / recover the ball / win.  While we like having very skilled people who could do a lot of different tasks, it is important that you first do your assigned tasks, and only once those are complete, or failure of the larger mission is probable, do you consider walking away from them to help someone else with their responsibilities. The thing that you cannot afford, especially on a lean team, is the really nice guy who is always trying to help out other people, but in doing so, is never quite getting his own responsibilities taken care of.  Yes, if the Running Back drops the football, you want any member of the team in the vicinity to jump on it, whether that is the leading blocker or the Quarterback.  But until the fumble happens, you want the leading blocker to focus on doing his job, and block for the Running Back.  If the blocker is doing any other job than his primary responsibility, you’re probably going to lose. This sounds logical enough, but it is really easy to go astray with the best of intentions.  This is especially true on a small, tight-knit team, where it is really easy to get sucked into someone else’s task or problem, doubly so if you think you can do it better or faster than them.  Now you are really setting yourself up for failure.  The right thing is to let the other person do the job, even if it seems less efficient in the short-run, so that you can focus on the tasks which require your expertise.  Don’t break formation…don’t abandon your assignment, until it is clear that mission failure is imminent, and even then, as Brian writes, it should be with the agreement of the mission leader. Thanks, Brian, for putting it so well.  This has been distributed throughout our department.

    Read the article

  • Zelda-style top-down RPG. How to store tile and collision data?

    - by Delerat
    I'm looking to build a Zelda: LTTP style top-down RPG. I've read a lot on the subject and am currently going back and forth on a few solutions. I'm using C#, MonoGame, and Tiled. For my tile maps, these are the choices I can see in front of me: Store each tile as its own array. Each one having 3-4 layers, texture/animation, depth, flags, and maybe collision(depending on how I do it). I've read warning about memory issues going this route, and my biggest map will probably be 160x120 tiles. My average map however will be about 40x30. The number of tiles might cut in half if I decide to double my tile size, which is currently 16x16. This is the most appealing approach for me, as I feel like I would know how to save maps, make changes, and separate it into chunks for collision checks. Store the static parts of my tile map in multiple arrays acting as the different layers. Then I would just use entities for anything that wasn't static. All of the other tile data such as collisions, depth, etc., would be stored in their own layers as well I guess? This way just seems messy to me though. Regardless of which one I choose, I'm also unsure how to plan all of that other tile data. I could write a bunch of code that would know which integer represents what tile and it's data, but if I changed a tileset in Tiled and exported it again, all of those integers could potentially change and I'd have to adjust a whole bunch of code. My other issue is about how I could do collision. I want to at least support angled collision that slides you around the corners of objects like LTTP does, if not more oddball shapes as well. So do I: Store collision as a flag for binary collision. Could I get this to support angles? Would it be fine to store collision as an integer and have each number represent a certain angle of collision? Store a list of rectangles or other shapes and do collision that way? Sorry for the large two-part(three-part?) question. I felt like these needed to be asked together as I believe each choice influences the other.

    Read the article

  • How do you optimize stunicholls' "Professional dropdown #2" with jquery?

    - by geff_chang
    Link to menu: Professional dropdown #2 I was wondering if these posts Suckerfish meets jQuery or Son of Suckerfish dropdowns in jQuery could optimize the menu above. I need the menu to be optimized for IE6, because when I use the menu as it is, the menu hangs after I click on a menu item that loads a page with heavy processing. It takes too long for the menu to be enabled again. Any ideas?

    Read the article

  • List of common ways those could shut down server unexpectedly ?

    - by SpawnCxy
    After running a bash fork bomb which made my webserver down, I think I should be more careful even not under root.I thought it would be totally fine while I'm not under root.So I ignored the warning and ran the bash fork bomb which is :() { :|:& }; : .(Please don't run it if u don't understand this code cuz it will make you system down).And I think I need a list of common ways those could cause a sever shutting down unexpectly even not under root. Any suggestion would be appreciated. Regards `

    Read the article

  • Problem in Rich : menubar

    - by Ramesh G
    Hi, I'm using rich:toolbar with backing bean menuAction method.I'm facing one problem in menu link icons.Suppose if i ve child menu in my parent menu it is displaying "hand symbol" for that.else if i dont ve any child menu in my parent menu it is showing "I" this icon.While clicking parent menu(without having child menu) i want hand symbol icon instead of "I" this icon. please help me....... Regards, Ramesh G

    Read the article

  • How to make inner UL list not inherit from outer UL List in CSS

    - by Minghui Yu
    For the HTML List below, I need to add a background image only to the LI of the outer list. (aka the one with class "menu-mlid-594 dhtml-menu expanded start-collapsed") HTML codes are: <li class="menu-mlid-594 dhtml-menu expanded start-collapsed ">About the Collection<ul class="menu"><li class="leaf first dhtml-menu ">By Theme</li><li class="leaf last dhtml-menu ">By Individual</li></ul></li> How can I do that? Thanks.

    Read the article

  • How can I make Access combo boxes unfurl on arrow key down?

    - by Matt Parker
    With combo box controls, I'm used to being able tab to them, click the down arrow key to open up the options, and then use the up and down arrow keys to navigate those options. In an Access form I've designed, pressing down while a combo box is active moves to the next control. I already have tab for that, so how can I get the down arrow to behave as I expect? These combo boxes are the only thing between me and a mouse-free form, which I consider essential for data entry. Thanks in advance for your help!

    Read the article

  • Is this a good starting point for iptables in Linux?

    - by sbrattla
    Hi, I'm new to iptables, and i've been trying to put together a firewall which purpose is to protect a web server. The below rules are the ones i've put together so far, and i would like to hear if the rules makes sense - and wether i've left out anything essential? In addition to port 80, i also need to have port 3306 (mysql) and 22 (ssh) open for external connections. Any feedback is highly appreciated! #!/bin/sh # Clear all existing rules. iptables -F # ACCEPT connections for loopback network connection, 127.0.0.1. iptables -A INPUT -i lo -j ACCEPT # ALLOW established traffic iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT # DROP packets that are NEW but does not have the SYN but set. iptables -A INPUT -p tcp ! --syn -m state --state NEW -j DROP # DROP fragmented packets, as there is no way to tell the source and destination ports of such a packet. iptables -A INPUT -f -j DROP # DROP packets with all tcp flags set (XMAS packets). iptables -A INPUT -p tcp --tcp-flags ALL ALL -j DROP # DROP packets with no tcp flags set (NULL packets). iptables -A INPUT -p tcp --tcp-flags ALL NONE -j DROP # ALLOW ssh traffic (and prevent against DoS attacks) iptables -A INPUT -p tcp --dport ssh -m limit --limit 1/s -j ACCEPT # ALLOW http traffic (and prevent against DoS attacks) iptables -A INPUT -p tcp --dport http -m limit --limit 5/s -j ACCEPT # ALLOW mysql traffic (and prevent against DoS attacks) iptables -A INPUT -p tcp --dport mysql -m limit --limit 25/s -j ACCEPT # DROP any other traffic. iptables -A INPUT -j DROP

    Read the article

  • iptables block everything except http

    - by arminb
    I'm trying to configure my iptables to block any network traffic except HTTP: iptables -P INPUT DROP #set policy of INPUT to DROP iptables -P OUTPUT DROP #set policy of OUTPUT to DROP iptables -A INPUT -p tcp --sport 80 -m state --state ESTABLISHED,RELATED -j ACCEPT iptables -A OUTPUT -p tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT The iptables output (iptables -L -v) gives me: Chain INPUT (policy DROP 0 packets, 0 bytes) pkts bytes target prot opt in out source destination 4 745 ACCEPT tcp -- any any anywhere anywhere tcp spt:http state RELATED,ESTABLISHED Chain FORWARD (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination Chain OUTPUT (policy DROP 0 packets, 0 bytes) pkts bytes target prot opt in out source destination 2 330 ACCEPT tcp -- any any anywhere anywhere tcp dpt:http state NEW,ESTABLISHED When I try to wget 127.0.0.1 (yes i do have a web server and it works fine) i get: --2012-11-14 16:29:01-- http://127.0.0.1/ Connecting to 127.0.0.1:80... The request never finishes. What am I doing wrong? I'm setting iptables to DROP everything by default and add a rule to ACCEPT HTTP.

    Read the article

  • jQuery: Scroll down page a set increment (in pixels) on click?

    - by bcWeb
    I'm trying to make a page scroll down 150px from the current position when an element is clicked. So lets say you're roughly halfway scrolled down a page. You click this link, and it will slide you down an additional 150 pixels. Is this possible with jQuery? I've been looking at scrollTop and the scrollTo plugin, but I can't seem to connect the dots.

    Read the article

  • How do I call an upside down jQuery.slideDown()?

    - by Mark Rogers
    In the web app I'm working on I want to do a little slide up notification, like on twitter or your desktop. jQuery's .slideDown does exactly what I want, but it's upside down. The .slideUp doesn't execute an upside down version of slideDown. Instead it hides stuff, like after your cleaning up an old message you've displayed with slideDown. So what's the simplest code to do an upside down slideDown() in jQuery?

    Read the article

  • Creating an ASP.NET report using Visual Studio 2010 - Part 3

    - by rajbk
    We continue building our report in this three part series. Creating an ASP.NET report using Visual Studio 2010 - Part 1 Creating an ASP.NET report using Visual Studio 2010 - Part 2 Adding the ReportViewer control and filter drop downs. Open the source code for index.aspx and add a ScriptManager control. This control is required for the ReportViewer control. Add a DropDownList for the categories and suppliers. Add the ReportViewer control. The markup after these steps is shown below. <div> <asp:ScriptManager ID="smScriptManager" runat="server"> </asp:ScriptManager> <div id="searchFilter"> Filter by: Category : <asp:DropDownList ID="ddlCategories" runat="server" /> and Supplier : <asp:DropDownList ID="ddlSuppliers" runat="server" /> </div> <rsweb:ReportViewer ID="rvProducts" runat="server"> </rsweb:ReportViewer> </div> The design view for index.aspx is shown below. The dropdowns will display the categories and suppliers in the database. Changing the selection in the drop downs will cause the report to be filtered by the selections in the dropdowns. You will see how to do this in the next steps.   Attaching the RDLC to the ReportViewer control by clicking on the top right of the control, going to Report Viewer tasks and selecting Products.rdlc.   Resize the ReportViewer control by dragging at the bottom right corner. I set mine to 800px x 500px. You can also set this value in source view. Defining the data sources. We will now define the Data Source used to populate the report. Go back to the “ReportViewer Tasks” and select “Choose Data Sources” Select a “New data source..” Select “Object” and name your Data Source ID “odsProducts”   In the next screen, choose “ProductRepository” as your business object. Choose “GetProductsProjected” in the next screen.   The method requires a SupplierID and CategoryID. We will set these so that our data source gets the values from the drop down lists we defined earlier. Set the parameter source to be of type “Control” and set the ControlIDs to be ddlSuppliers and ddlCategories respectively. Your screen will look like this: We are now going to define the data source for our drop downs. Select the ddlCategory drop down and pick “Choose Data Source”. Pick “Object” and give it an id “odsCategories”   In the next screen, choose “ProductRepository” Select the GetCategories() method in the next screen.   Select “CategoryName” and “CategoryID” in the next screen. We are done defining the data source for the Category drop down. Perform the same steps for the Suppliers drop down.   Select each dropdown and set the AppendDataBoundItems to true and AutoPostback to true.     The AppendDataBoundItems is needed because we are going to insert an “All“ list item with a value of empty. Go to each drop down and add this list item markup as shown below> Finally, double click on each drop down in the designer and add the following code in the code behind. This along with the “Autopostback= true” attribute refreshes the report anytime a drop down is changed. protected void ddlCategories_SelectedIndexChanged(object sender, EventArgs e) { rvProducts.LocalReport.Refresh(); }   protected void ddlSuppliers_SelectedIndexChanged(object sender, EventArgs e) { rvProducts.LocalReport.Refresh(); } Compile your report and run the page. You should see the report rendered. Note that the tool bar in the ReportViewer control gives you a couple of options including the ability to export the data to Excel, PDF or word.   Conclusion Through this three part series, we did the following: Created a data layer for use by our RDLC. Created an RDLC using the report wizard and define a dataset for the report. Used the report design surface to design our report including adding a chart. Used the ReportViewer control to attach the RDLC. Connected our ReportWiewer to a data source and take parameter values from the drop downlists. Used AutoPostBack to refresh the reports when the dropdown selection was changed. RDLCs allow you to create interactive reports including drill downs and grouping. For even more advanced reports you can use Microsoft® SQL Server™ Reporting Services with RDLs. With RDLs, the report is rendered on the report server instead of the web server. Another nice thing about RDLs is that you can define a parameter list for the report and it gets rendered automatically for you. RDLCs and RDLs both have their advantages and its best to compare them and choose the right one for your requirements. Download VS2010 RTM Sample project NorthwindReports.zip   Alfred Borden: Are you watching closely?

    Read the article

  • How to select the first ocurrence in the auto-completion menu by pressing Enter?

    - by janoChen
    Every time there's is a pop up menu. I select the first occurrence and press enter but nothing happens (the word is not completed with he selected occurrence). The only way is to press Tab until you reach the term for a second time. Is there a way of selecting the first occurrence pressing Enter (or other Vim hotkey)? My .vimrc: " SHORTCUTS nnoremap <F4> :set filetype=html<CR> nnoremap <F5> :set filetype=php<CR> nnoremap <F3> :TlistToggle<CR> " press space to turn off highlighting and clear any message already displayed. nnoremap <silent> <Space> :nohlsearch<Bar>:echo<CR> " set buffers commands nnoremap <silent> <M-F8> :BufExplorer<CR> nnoremap <silent> <F8> :bn<CR> nnoremap <silent> <S-F8> :bp<CR> " open NERDTree with start directory: D:\wamp\www nnoremap <F9> :NERDTree /home/alex/www<CR> " open MRU nnoremap <F10> :MRU<CR> " open current file (silently) nnoremap <silent> <F11> :let old_reg=@"<CR>:let @"=substitute(expand("%:p"), "/", "\\", "g")<CR>:silent!!cmd /cstart <C-R><C-R>"<CR><CR>:let @"=old_reg<CR> " open current file in localhost (default browser) nnoremap <F12> :! start "http://localhost" file:///"%:p""<CR> " open Vim's default Explorer nnoremap <silent> <F2> :Explore<CR> nnoremap <C-F2> :%s/\.html/.php/g<CR> " REMAPPING " map leader to , let mapleader = "," " remap ` to ' nnoremap ' ` nnoremap ` ' " remap increment numbers nnoremap <C-kPlus> <C-A> " COMPRESSION function Js_css_compress () let cwd = expand('<afile>:p:h') let nam = expand('<afile>:t:r') let ext = expand('<afile>:e') if -1 == match(nam, "[\._]src$") let minfname = nam.".min.".ext else let minfname = substitute(nam, "[\._]src$", "", "g").".".ext endif if ext == 'less' if executable('lessc') cal system( 'lessc '.cwd.'/'.nam.'.'.ext.' &') endif else if filewritable(cwd.'/'.minfname) if ext == 'js' && executable('closure-compiler') cal system( 'closure-compiler --js '.cwd.'/'.nam.'.'.ext.' > '.cwd.'/'.minfname.' &') elseif executable('yuicompressor') cal system( 'yuicompressor '.cwd.'/'.nam.'.'.ext.' > '.cwd.'/'.minfname.' &') endif endif endif endfunction autocmd FileWritePost,BufWritePost *.js :call Js_css_compress() autocmd FileWritePost,BufWritePost *.css :call Js_css_compress() autocmd FileWritePost,BufWritePost *.less :call Js_css_compress() " GUI " taglist right side let Tlist_Use_Right_Window = 1 " hide tool bar set guioptions-=T "remove scroll bars set guioptions+=LlRrb set guioptions-=LlRrb " set the initial size of window set lines=46 columns=180 " set default font set guifont=Monospace " set guifont=Monospace\ 10 " show line number set number " set default theme colorscheme molokai-2 " encoding set encoding=utf-8 setglobal fileencoding=utf-8 bomb set fileencodings=ucs-bom,utf-8,latin1 " SCSS syntax highlight au BufRead,BufNewFile *.scss set filetype=scss " LESS syntax highlight syntax on au BufNewFile,BufRead *.less set filetype=less " Haml syntax highlight "au! BufRead,BufNewFile *.haml "setfiletype haml " Sass syntax highlight "au! BufRead,BufNewFile *.sass "setfiletype sass " set filetype indent filetype indent on " for snipMate to work filetype plugin on " show breaks set showbreak=-----> " coding format set tabstop=4 set shiftwidth=4 set linespace=1 " CONFIG " set location of ctags let Tlist_Ctags_Cmd='D:\ctags58\ctags.exe' " keep the buffer around when left set hidden " enable matchit plugin source $VIMRUNTIME/macros/matchit.vim " folding set foldmethod=marker set foldmarker={,} let g:FoldMethod = 0 map <leader>ff :call ToggleFold()<cr> fun! ToggleFold() if g:FoldMethod == 0 exe 'set foldmethod=indent' let g:FoldMethod = 1 else exe 'set foldmethod=marker' let g:FoldMethod = 0 endif endfun " save and restore folds when a file is closed and re-opened "au BufWrite ?* mkview "au BufRead ?* silent loadview " auto-open NERDTree everytime Vim is invoked au VimEnter * NERDTree /home/alex/www " set omnicomplete autocmd FileType python set omnifunc=pythoncomplete#Complete autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS autocmd FileType html set omnifunc=htmlcomplete#CompleteTags autocmd FileType css set omnifunc=csscomplete#CompleteCSS autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags autocmd FileType php set omnifunc=phpcomplete#CompletePHP autocmd FileType c set omnifunc=ccomplete#Complete " Remove trailing white-space once the file is saved au BufWritePre * silent g/\s\+$/s/// " Use CTRL-S for saving, also in Insert mode noremap <C-S> :update!<CR> vnoremap <C-S> <C-C>:update!<CR> inoremap <C-S> <C-O>:update!<CR> " DEFAULT set nocompatible source $VIMRUNTIME/vimrc_example.vim "source $VIMRUNTIME/mswin.vim "behave mswin " disable creation of swap files set noswapfile " no back ups wwhile editing set nowritebackup " disable creation of backups set nobackup " no file change pop up warning autocmd FileChangedShell * echohl WarningMsg | echo "File changed shell." | echohl None set diffexpr=MyDiff() function MyDiff() let opt = '-a --binary ' if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif let arg1 = v:fname_in if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif let arg2 = v:fname_new if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif let arg3 = v:fname_out if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif let eq = '' if $VIMRUNTIME =~ ' ' if &sh =~ '\<cmd' let cmd = '""' . $VIMRUNTIME . '\diff"' let eq = '"' else let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"' endif else let cmd = $VIMRUNTIME . '\diff' endif silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq endfunction

    Read the article

< Previous Page | 115 116 117 118 119 120 121 122 123 124 125 126  | Next Page >